|
what I learned so far
float
constant
assignment operator
getline () funtion
arguments
ignore ()
newline character
some thing like this :
example from text book
# include <iostream>
# include <string>
using std: : cout ;
using std: : cin ;
using std: : end l;
using std: : string ;
int main ()
{
//declare variables
double sales = 0.0 ;
string stateName = " " ;
// enter input items
cout << "Enter the sales amount : " ;
cin >> sales ;
cin.ignore (100, '\n') ;
cout << "Enter the state name : " ;
getline ( cin, stateName) ;
//display output items
cout << " You entered sales of " << sales ;
cout << " for " << stateName << end ;
return 0 ;
} // end of main function
(this was an example in the text book they gave us )
|