Hello. At school in Computing Studies I'm doing programming and the language that I have to use there is True BASIC. I have made a simple program in TB but want to try making it in C++ instead. By looking at the code you will probably see how simple the program I'm making is but since I've been working on simple C++ programs for only a few weeks I'm not quite sure what I'm doing wrong. You will probably want to see the code I've done so far:
Code:
//Made by <Removed following Request -- Fordy>
//04/02/06
#include <iostream>
using namespace std;
int main()
{
int total;
int score;
int percent;
cout<<"What is the total score? ";
cin>> total;
cin.ignore();
cout<<"What is your score? ";
cin>> score;
cin.ignore();
percent = ( score / total ) * 100;
cout<<"Your percentage mark is: "<< percent <<"\n";
cin.get();
}
CORRECTED THE CODE.
The area what I've marked in bold is where the error is or at least thats what the Dev-C++ tells me. I'm not sure if I'm doing the calculation correct or if anything in that line is. If you think you can help me then please reply.
Thanks in advance.