Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need to take this design and convert it into Java code. This includes writing the Student class along with its variables and methods. Make

i need to take this design and convert it into Java code. This includes writing the Student class along with its variables and methods. Make sure that you use the proper accessibility modifiers (private & public) such that encapsulation is properly enforced. After writing the Student class, write another class named StudentData, and add your main function in that class. In the main function, create two objects of the Student class, add four courses for the first student object, and three courses for the second student object. Each added course is associated with a letter grade and a number of credits. Then call the compute_gpa() function to compute the GPA for each student, and print out the GPA for each student, along with his list of courses, grades and credits. here is what i have . Student ** Variables - String name - String major - String academic_level - String[] course_list - String[] grade_list - int[] credit_list - double gpa - int max_n_courses - int n_taken_courses ** Methods - add_course(course_name, grade, credits) - compute_GPA() - convert_grade(letter_grade) =========================== Algorithm for add_course(course_name, grade, credits) 1. set course_list[ n_taken_courses ] = course_name 2. set grade_list [ n_taken_courses ] = grade 3. set credit_list[ n_taken_courses ] = credits 4. n_taken_courses ++ =========================== Algorithm for compute_GPA() 1. compute total_credits total_credits = 0 for i going from 0 up to n_taken_courses - 1 total_credits += credit_list[i] total_grades = 0 for i going from 0 up to n_taken_courses - 1 total_grades += credit_list[i] * convert_grade( grade_list[i] ) gpa = total_grades / total_credits =========================== numeric_grade convert_grade(letter_grade) if letter_grade == "A" return 4.0 else if letter_grade == "A-" return 3.67 if letter_grade==B return 3.00 else if letter_gradeB- return2.67 if letter_grade==C return 2.00 else if letter_gradeC- return1.67 if letter_grade==D return 3.00 else if letter_gradeD- return 0.67 if letter_grade==F return 0 Failed Class.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

Learn the ABA family of reversal designs

Answered: 1 week ago

Question

7. What decisions would you make as the city manager?

Answered: 1 week ago

Question

8. How would you explain your decisions to the city council?

Answered: 1 week ago