ARRAYS

Write a program that declares two arrays Gpa and Reg that store the GPAs and Registration
number of students of a class. Use a const initialized variable ‘size’ for array sizes. Program
should allow user to enter values for Gpa and Reg arrays. Index i in both arrays is about same
student i.e. the arrays are parallel. Once the values are entered, the program should display and
implement following menu
Press 1 for Average GPA of class
Press 2 for displaying names of students whose GPA is less than 2
Press 3 for displaying name of student whose GPA is highest
Press 4 for displaying GPA of a particular student
Press 5 for modifying GPA of a particular student
Press 6 to exit the application
Program should repeatedly show the menu and only quits when user presses 6
I do not know if u dont mind plzzz tell me the code........
What do you have so far?
what condition can i apply here for press5 for modifying the gpa....
It would be more clear what your problem is if you posted the code, but anyway,
you probably should have something like
1
2
3
4
5
6
7
cin >> chioce;
if(...)
...
else if( choice == 5 ){
   int id = ask_for_as_student_id();
   student_array[i] = ask_for_a_new_gpa();
}
I don't mind telling you the code:

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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
using namespace std;
int main()
{

     int choice = 0;
     
     while( choice != 6 ) //the code in this loop will execute until user enters a 6
     {
          //clear the screen
          system("cls");
          //display menu
          cout << "I will eventually be a menu!" << endl;
          cout << "I will eventually be option 1!" << endl;
          cout << "I will eventually be option 2!" << endl;
          cout << "I will eventually be option 3!" << endl;
          cout << "I will eventually be option 4!" << endl;
          cout << "I will eventually be option 5!" << endl;
          cout << "I will eventually be option 6!" << endl;

          //accept user input
          cin >> choice;

          //process user input
          switch( choice )
          {
                case 1:
                //insert code for when user presses 1 here...
                break;
                case 2:
                //etc...
                break;
                case 3:
                break;
                case 4:
                break;
                case 5:
                break;
          }
     }

     system("pause");
     return 0;//default exit 
              
}


ok there's a menu template... go!

for the actual functionality of what you are trying to do read http://cplusplus.com/doc/tutorial/ thoroughly. hope this helps!
Last edited on
@ceruleus: we don't hand out solutions here, especially to people who don't even bother to ask a question about programming and just ask us to "tell them the code".

And read this: http://www.cplusplus.com/forum/articles/11153/
That's not a solution! That code doesn't even do anything.
Topic archived. No new replies allowed.