You should create two arrays one for storing the name of the student named John and the other for storing his grade in the following five courses for this semester.
C++ - 80
Java – 75
Mathematics – 65
Chemistry – 95
Physics – 85
You should use a for loop for calculate his average. The output of the program should display his average for the semester
c++
standard
C++ for beginners very desperate?
I'm not going to answer this for you... but I will give you some help. I know you can do this! First, make sure you know how to write a basic "Hello World!" program. This is just to get you familiar with how C++ works.
Next, how do you initialize arrays in C++? It looks like you're going to have one string array and one int array. How many elements are in your arrays? It looks like there are 5. So make sure you initialize two arrays of size five.
Now... how do you do create a loop? There are three types of loops. Which one should you use (do, while, for)? How are you going to keep a running total of his grades? Once you get the grades all added... how are you going to get the average? How do you print out the average?
These are the questions... Do some research on Google and you'll do fine!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment