Original Post
I'm not completely new to programming, just new to clean coding. I started programming with QBasic ages ago, and now I'm trying to improve my C++ skills. I'm no expert, but I have gone as far as making an extremely dirty Tic-Tac-Toe game. Now I am pretty much starting my C++ from scratch so that I do everything right. Here is some sample code to an extremely simple program that I made, and I would like some input on how close I am to clean code, and how I should improve it.
Quote:I am working with a book titled "Beginning C++ Game Programming" authored by Michael Dawson. It seems pretty good so far, a lot easier to follow than the textbook I used in high school. Edit: Hmm, after looking at my post I see that "extremely dirty" could easily be taken in a different light, I meant the code was just sloppy.
//Average Score //A simple program that prompts the user for 3 scores, then displays the average of them //Created by Jim on 01/30/05 #include using std::cout; using std::cin; using std::endl; int score1 = 0; int score2 = 0; int score3 = 0; int main() { cout << "Enter the first score: "; cin >> score1; cout << "\nEnter the second score: "; cin >> score2; cout << "\nEnter the third score: "; cin >> score3; cout << "\nThe average of the 3 scores is " << (score1 + score2 + score3) / 3 << endl; system("PAUSE"); return 0; }