SO I am trying to write a program in C++ that take in Grades 1-5 and how many cans they collect. This program needs to add the cans they collect then print them. I am very new to C++ and I am better at writing Pseudocode than actual C++ languange so bear with what I have so far.
#include <iostream>
using namespace std;
int main()
{
int grade[5];
int numberofcans;
print header ();
while (grade <1; grade>5;)
{ cout<<”Invalid data”<<;}
int i;
For (grade = i[1], grade++)
{cout <<grade 1 has collected”,” cans”<<;
}
}
My teacher gave me some template to go by but it is confusing me too much so I am trying to it my way. Am I close at all??
This is the template I have:
(it's in psuedocode)
int main()
{
/* declaration and initialization
delare variables to hold number of cans for each grade. This should be
an array (cans).
delcare any other variables.
print_header ();
read record
while this is not last record
{
is_valid = check_record (grade, collected)
if (is_valid)
print data and process record
else
print data and an invalid message
read record
}
print_header_per_grade ();
print_number_of_cans (cans);
return (0)
}