Ok, so I have to write this program that reads #'s into an array, such as grades...
The program must have:
* Read and Print the Numeric Grades
* Declare an array of characters to store the character grades associated w/ the numeric grades
* Translate the numeric grades into letter grades w/ an if-else or a switch statement in an array
* Then it has to print the above results w/ the array index, numeric grade, and letter grade.
How the heck do I incorporate the last 2 steps?
This is what I have so far...
How do you declare a character array? Thanks for the suggestions in advance... =/
# include <iostream>
# include <iomanip>
using namespace std;
const int MAXSIZE = 25; //global constant
// function prototypes
void getlist (int [], int&);
void putlist (const int [], int);
void find_grades (const int [], int, char []);
void print_grades(const int [], const char [], int);
int main ()
{
int list [MAXSIZE];
int num_grades;
getlist (list, num_grades);
putlist (list, num_grades);
system ("pause");
return 0;
}
void getlist (int list [], int &num_grades)
{
cout << "How Many Grades Will You Be Entering???: ";
cin >> num_grades;
int i; //controls loop
for (i = 0; i < num_grades; i++)
{
cout << "Please Enter A Grade: " << endl;
cin >> list [i];
}
}// End of getlist
void putlist (const int list [], int num_grades)
{
cout << "Grades" << endl;
for (int i = 0; i < num_grades; i++)
cout << i << " " << list [i] << endl;
}// End of putlist