the top n students Search for a student Exit the program. If the user chooses 1, the user will be prompted for the value of n, and the netID, major and GPA of the top n students will be listed, starting with the student with highest GPA and going down. If the user chooses 2, user will be

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question

Write code for this

Write a program that manages students’records. Each student’s record consists of a netID, a major and a GPA, maintained in parallel arrays. The program will read students’ data from a file and loop on displaying the following menu of choices:

  1. List the top n students
  2. Search for a student
  3. Exit the program.

If the user chooses 1, the user will be prompted for the value of n, and the netID, major and GPA of the top n students will be listed, starting with the student with highest GPA and going down.
If the user chooses 2, user will be prompted to enter the student’s netID. If the netID is found in the netID array, the array index, major and GPA of the student are displayed. If the student is not found, a “Student not found” message is displayed.
If the user chooses 3, the program prints “Exiting\n” and terminates.

 

 

Here are the expected screenshots when the program is executed on an external IDE ("interactive Console" on OnlineGDB) .

Enter file name: in0.txt Could not open file Exiting

Output-1

Enter file name: in1.txt Original arrays: ---------------- index netID major GPA index netID major GPA 0 1007 ME 3.80 1 1013 CS 3.20 2 1018 BME 3.75 3 1025 CS 3.30 4 1031 ME 2.90 5 1038 ME 3.00 6 1043 EE 3.10 7 1048 BME 3.70 8 1054 CS 3.95 9 1061 CS 3.50

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning