1. A list of students (student ID, first name, last name, list of 4 test grades) will be transformed into
Student objects. We will provide this file for you.
a. Each feature will be separated by commas, however; the grades will be separated by
spaces, as shown in this example line: 82417619,Erik,Macik,95.6 85 100 88
[Hint: It seems like you might need to use the split method twice]
b. Your program should work with any file with any number of lines.
2. A menu will be displayed on loop to the user (meaning after a user completes a selection, the
menu will be displayed again, unless the user exits).
The menu options should be the following:
a. View Student Grade and Average
b. Get Test Average
c. Get Top Student per exam
d. Exit
3. Your system shall incorporate the following classes. Each class will require one file.
GRADE CALCULATOR
Purpose
A class that contains useful methods that can be used to calculate averages and
convert grades to letter grades
Attributes: None
Methods
convertToLetterGrade(double grade): This method will return the letter
grade of a given a test score or average grade. In this case, if we are given a grade
that is greater than 100 or less than 0, we will return ‘E’. Use this conversion chart:
A 90 <= grade <= 100
B 80 <= grade < 90
C 70 <= grade < 80
D 60 <= grade < 70
F 0 <= grade < 60
E Otherwise
calculateAverage(double[] grades): Given a list of grades, return the
average grade.
STUDENT
Purpose
A class that will represent a student from the file. In the file, each line represents a
student
Attributes
private int studentId;
[CS1101] Comprehensive Lab 3
private String firstName;
private String lastName;
private double[] grades;
Methods
Student(): The default constructor for the Student class.
Student(String studentId, String firstName, String lastName,
double[] grades): The constructor for the Student class that receives all
attributes for a Student. HINT: Be sure not to pass a String[] for grades. Grades is a
double[].
Getters and Setters: Create a getter and setter for each attribute of the
Student class.
calculateAverage(): This method will calculate and return the average grade of
the Student. If the student has no grades, return 0.0.
calculateLetterGrade(): This method will calculate and return the letter grade
of the student. HINT: first call calculateAverage(), then use GradeCalculator to
convert the average to a letter grade.
viewGrades(): This method will display all grades of the Student.
toString(): This method will return a String containing the studentId, firstName,
and lastName of the Student.
Purpose
Stores an array of Student objects. This class contains methods to populate the
database, view students in the database, and calculate student and test averages.
Attributes
private String filename;
private Student[] studentList;
private int numOfTests;
Methods
Database(String fileName): The constructor for the Database class.
Receives the filename that this database will be constructed from.
getNumberOfStudents(): This method will traverse through the file and return
the number of students (number of lines) that exist in the file. This method does not
receive any arguments.
populateDatabase(): This method will traverse every line of the file, create a
Student object from every line, and store them in studentList. This method does not
receive any arguments. HINT: Use getNumberOfStudents() to figure out how large
to make the studentList array.
viewListOfStudents(): This method displays ID number, first name, and last
name of every student in the database.
getStudent(int studentId): This method returns the Student object in the
database with the matching studentId. If the student does not exist, return null.
getStudentAvg(int studentId): Given a studentId, this method will return
the grade of the corresponding student in the database. If the student does not
exist in the database, return -1.0.
getTestAvg(int testNum): Given a testNum, this method will return the
average test grade over all students in the database. If the test does not exist,
return -1.0.
viewTopStudentPerExam(): This method will display the name of the student
with the highest grade per exam.
RUNNER
[IMPORTANT: Runner will primarily interact with the Database class. Runner should not
create any Student objects.]
Methods
main method
File:
id,First Name,Last Name,Test1 Test2 Test3 Test4
82417619,Erik,Macik,95.6 85 100 88
88557812,Ali,Pashamohammad,75.2 87 97 96
88915283,Ana,Arellano,78 79.3 92 64.3
87734896,Montserrat,Molina,67 99.7 90 74
85119645,Manuel,Gutierrez,87 94.6 89 69.4
80080012,Melina,Salazar,65.2 84 75 86
88011201,Joshua,Ramos,98.2 74 85.4 97
80001234,Diana,Licon,98.6 85 98 100
80512311,Ericka,Najera,95.6 75.1 85 92
80123456,Lorelyne,Chavez,100 94.2 87.6 91
Step by stepSolved in 3 steps with 17 images
- In c++ Create a new project named lab9_2. You will continue to use the Courses class, but this time you will create a vector of Courses. The file you will read from is below: 6CSS 2A 1111 35CSS 2A 2222 20CSS 1 3333 40CSS 1 4444 33CSS 3 5555 15CSS 44 6666 12 Read this information into a vector of Courses. Then, print out a summary of your vector. Here's a sample driver: #include <iostream>#include <string>#include <fstream>#include <vector>#include <cstdlib>#include "Course.h"using namespace std;int main(){vector<Course> myclass;string dep, c_num;int classes, sec, num_stus;ifstream fin("sample.txt");if (fin.fail()){cout << "File path is bad\n";exit(1);}fin >> classes;for (int i = 0; i < classes; i++){fin >> dep >> c_num >> sec >> num_stus;// Now how do you create a Course object// that contains the information you just read in// and add it to your myclass vector?}cout << "Here are the college courses: "…arrow_forwardI am trying to read a CSV file and then store it into an ArrayList. For each row, I'm trying to create a new Country class instance and add it to the list. However, it is giving me the following as the output: edu.uga.cs1302.quiz.Country@7c9bb6b8 edu.uga.cs1302.quiz.Country@441847 edu.uga.cs1302.quiz.Country@2621fba7 edu.uga.cs1302.quiz.Country@4fa6e7a1 edu.uga.cs1302.quiz.Country@6e29b69b edu.uga.cs1302.quiz.Country@4e0f0d39 edu.uga.cs1302.quiz.Country@67da3b9c edu.uga.cs1302.quiz.Country@1f394329 edu.uga.cs1302.quiz.Country@3c07b33b edu.uga.cs1302.quiz.Country@a570747 edu.uga.cs1302.quiz.Country@3ce7cb4a edu.uga.cs1302.quiz.Country@6912e7f4 edu.uga.cs1302.quiz.Country@680d0f86 edu.uga.cs1302.quiz.Country@5a5250ff edu.uga.cs1302.quiz.Country@58ed7d64 edu.uga.cs1302.quiz.Country@26be1cca edu.uga.cs1302.quiz.Country@26cf56a4 edu.uga.cs1302.quiz.Country@6ed22f2a edu.uga.cs1302.quiz.Country@5de769c9 edu.uga.cs1302.quiz.Country@b6966f3 edu.uga.cs1302.quiz.Country@574f6b4c…arrow_forwardThe shape class variable is used to save the shape of the forestfire_df dataframe. Save the result to ff_shape. # TODO 1.1 ff_shape = print(f'The forest fire dataset shape is: {ff_shape}') todo_check([ (ff_shape == (517,13),'The shape recieved for ff_shape did not match the shape (517, 13)') ])arrow_forward
- Suppose a csv file contains three comma-separated values (strings) on each line (see the leftcolumn of the example table below). Assume, each line of values are, respectively, thewidth, height, and depth of a box. Write a program called box.py and add thefollowing functions to this program.• read_file() takes a csv filename as a parameter that contains the widths, heights, anddepths of all boxes. This function must read the content of the file, store these values ina 2-D list as shown in the right column of the example table below, and return this list.All strings must be converted to integers before they are stored in the list. Example:csv data 2-D list[[15, 6, 3],[3, 7, 4],[6, 9, 3],[15, 6, 11],[6, 5, 5],[13, 10, 9],[9, 10, 3],[14, 5, 4],[4, 6, 11],[12, 10, 9]]• Add another function called max_volume() to this program that takes this 2-D list as aninput parameter. Each item in that list contains 3 integers representing the dimensions ofa box (i.e., width, height, depth). This…arrow_forwardOutput should be 5. Please help me find my error, and create 5 tests below in a seperate file using the corrected code. Thanks. 1. create a strawberryStand object2. create one or more MenuItem objects and add them to the strawberryStand's menu3. create a dictionary of sales for the day that includes sales of at least one item that isn't in the menu4. try calling enter_sales_for_today(), passing that sales dictionary as the argument5. If an InvalidSalesItem is raised, it should be caught with a try/except that prints an explanatory message for the user (otherwise the function should proceed normally). class MenuItem: def __init__(self, name, wholesale_cost, selling_price): self.name = name self.wholesale_cost = wholesale_cost self.selling_price = selling_price def get_name(self): return self.name def get_wholesale_cost(self): return self.wholesale_cost def get_selling_price(self): return self.selling_price class SalesForDay:…arrow_forwardThe goal for Lab06b is to use the provided Student class (ATTACHED IN IMAGE) and create an array of Student objects that are stored in a School object. This program uses a Student class that is provided and shown below. The class is placed in its own separate file and should not be altered. This program sequence started with Lab06a. It is a reminder that it is the same Student file used by Lab06a. This lab will add data processing to the earlier Lab06a. This program will continue with the Lab06b program that performs some data processing on the Student records. For this lab 10 Student objects need to be constructed and placed in a students array, which is stored in a School object. You actually did this already for Lab06a. You also need to complete the School constructor, addData method and toString Method, which were in Lab06a. Feel free to just copy them over. You need to complete three bubbleSort methods; one that sorts according to the student gpa., one for age and one for name.…arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY