Hello,
For a exercise I have to make a programm where several student puts thier home-grades in and thier names.
here's the code
#include <string>
#include <vector>
#include <iostream>
using namespace std ;
int main()
{
vector<string> names ;
typedef vector<double>::size_type siz_tp ;
siz_tp aantal ;
vector<double> numbers;
typedef vector<double>::size_type siz_tp ;
siz_tp aantal ;
string name ;
// ask for and read the words to count
cout << "Enter first your name"
while (cin >> name)
{
while (name.lenght == 0)
{
cout "You have not entered your name"
cin >> name
}
names.push_back (name) ;
cout " Enter now your 5 home-grades :"
cin >> number
numbers.push_back (number);
size = numbers.size () ;
}
}
But what's the best way how I can check if a student put in 5 numbers.
I can do if numbers.size = 5 but on student 2 the vector must be 10 , on student 3 14 and so on.
Anyone who have a tip ?
Roelof