Question
Any help would be appreciated! A program has been started for you: student_project.java . You must finish the code to read data from a data
Any help would be appreciated!
A program has been started for you: student_project.java. You must finish the code to read data from a data file into the parallel arrays as follows: (the arrays are already defined in the code)
Student Number (5 digits)
Student name
Advisor last name (Smith, Jones, or Atkins)
Major (CIS, Math, or English)
Cost of tuition
GPA
The data file that is to be used is slist.txt and is included with this assignment.
In order for the program to find the correct data file, it MUST be copied to the main folder of your project. For example, if the project is called student_project, there will be a folder under workspace called student_project. This is where you MUST copy the file. When the program runs it will look for it in that folder.
Method stubs have also been written for you. These are methods that are called at the proper time, but do not have code created yet.
You are to finish these stubs as follows:
start_program() read all data from the data file into parallel arrays. The valiable count will keep track of how many students have been read in
print_all_info() - Print all student information from the arrays
print_specific_major()- Print all students of a specific major (prompt for the major)
print_advisor_list()-Print all students who have a specific advisor (prompt for the advisor name)
print_total_tuition()-Print the total amount of tuition for each of the majors
print_honor_students()- Print the student name, GPA and major for all students with a GPA of 3.5 or higher (also print the count of honor students in each major)
Java File: package student_project; import javax.swing.JOptionPane; import java.io.*; import java.util.*; import java.text.*; public class student_project { public static void main(String[] args) { int selection; int[] student_number=new int[100]; String[] student_name=new String[100]; String[] advisor_name=new String[100]; String[] major=new String[100]; double[] tuition=new double[100]; int count=-1; start_program(); selection=menu(); while (selection !=6) { if(selection ==1) print_all_info(); else if (selection ==2) print_specific_major(); else if(selection ==3) print_advisor_list(); else if(selection ==4) print_total_tuition(); else if(selection==5) print_honor_students(); selection=menu(); }//end of while loop }//end of main method //****************************************************************************** public static void start_program() { }//end start_program //****************************************************************************** public static int menu() { int selection; String value; String output="RMU REPORT MENU"+" "+ "=================="+" "+ "1. Print all student information"+" "+ "2. Print all students of a specific Major"+" "+ "3. Print all students of a specific Advisor"+" "+ "4. Print total amount of tuition for all students"+" "+ "5. Report of your choice"+" "+ "6. Exit"+" "+ "Enter your slection > "; value =JOptionPane.showInputDialog(null, output,"Input Data",JOptionPane.QUESTION_MESSAGE); selection =Integer.parseInt(value); return selection; }//end menu //****************************************************************************** public static void print_all_info() { System.out.println(" "+"Executing print_all_info"); } //****************************************************************************** public static void print_specific_major() { System.out.println(" "+"Executing print_specific_major"); } //****************************************************************************** public static void print_advisor_list() { System.out.println(" "+"Executing print_advisor_list"); } //****************************************************************************** public static void print_total_tuition() { System.out.println(" "+"Executing print_total_tuition"); } //****************************************************************************** public static void print_honor_students() { System.out.println(" "+"Executing print honor students"); } //****************************************************************************** }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started