I'm taking C++ class at college currently online and the teacher does not teach, just gives us powerpoints and says good luck.
I've scraped by for now but I have no clue how to do my midterm and I need straight A's this semester by any means necessary.
Here is the assignment:
Create a program to store information about students and then print it to the screen.
Requirements:
1) The user will decide for how many students he wants to enter information
2) The program must accept the following information for each student:
- First name
- Last name
- Gender (accept both m/f and M/F)
- Age
- Height (inches)
3)For each student, print the data to the screen in tablular, left-justified format (hint: use iomanip functions)
Any help will be greatly appreciated.
I truly am clueless and this is all I have so far:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double firstname, lastname, gendermf, age1, height1;
cout << "What is your last name? ";
cin >> lastname;
cout << "What is your first name? ";
cin >> firstname;
cout << "What is your Gender? M or F? ";
cin >> gendermf;
cout << "What is your age? ";
cin >> age1;
cout << "What is your height? ";
cin >> height1;
cin.get(); cin.get();
return 0;
}
|