improvement

hi.i am new to c++ and here is my best code so far. please make any sugestions to make it better.thanks-moot1

#include <iostream>

using namespace std;

void goodbye();



void title(){
cout << " IM A QUIZ CALCULATOR!!!" << endl << endl;

}

int main(){



title();

int number1;
int number2;
int number3;
int average;


cout << "enter three quiz grades that you want to find the average of";
cout << endl;

cin >> number1;
cin >> number2;
cin >> number3;

average = (number1 + number2 + number3) /3;

cout << "here is the average of you first 3 quiz grades: " << average;
cout << endl;

switch(average){
case 100:
cout << "wow!!! you have a 100 average" << endl;
break;
case 65:
cout << "utoh!!you just passed" << endl;
break;
}






if(average > 89){
cout << "you have good grades,keep it up!" << endl;
cout << "set goals and keep on working hard" << endl << endl;
}else{
cout << "your average is below a 90,you need to work harder...";
cout << endl << endl;
cout << "if you want to get into a good college!" << endl;
cout << endl;
}

cout << "have a nice day and stay in school!!" << endl;



system("pause");

return 0;

}
If you want good feedback, the first thing you should do is go back and edit your code to look nice by using tags.

How to use tags
http://www.cplusplus.com/articles/z13hAqkS/

Andy

P.S. This includes indenting. And losing all the extra, blank lines!
Last edited on
Ok I'll remember that next time.now can i have feedback on the actual code and not how it looks please.
They're not unconnected. Good layout make the structure of the code clear, so it's easier to understand.

It is the first thing you need to do to improve your code. Make it easier for people to read. And hence easier to check it's correct.

Last edited on
I do make it neater but when I paste the code it has the indents but when I press submit the indents go away.
That's why you've got to use [code]code tags[/code]. It stops the Web Browsers from stealing your spaces!
Last edited on
Topic archived. No new replies allowed.