Re: What's wrong with my code?

  • From: Hrvoje Katić <hrvojekatic@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Tue, 06 Jul 2010 06:33:03 +0200

Hi,

Instead of writing
using std::bla
it's enough to write
using namespace std

Hrvoje

On 6.7.2010 5:54, Jes wrote:
Hi all,
This is a programming assignment I'm trying to do out of the class text book. Any assistance would be appreciated, as well as any feedback on how I am doing writing the code. I have this habit of not writing the code all the way through, and compiling the program bit by bit to make sure I don't get any errors in the process of coding. I just want to make sure that the code I have already written is working as it should before I continue writing. I'm sure this is not a good habit to get into.
Thanks for any help.
Jes

//Ch5 Exercise 4, page 287 //Calculates and displays the average of three test scores
//created/revised by Jes Smith on July 5 2010

#include <iostream>
using <<std::cout;>>
using <<std::cin;>>
using <<std::endl;>>

//declare variables
int score_1 (0);
int score_2 (0);
int score_3 (0);

//begin program
int main()
{
cout< "Please enter your first test score. You may enter decimal values: " >;
cin << score_1 >>;
cin <<score_2 >> ;
cin <<score_3 >> ;

return 0
}


Other related posts: