Question: Assignment 1 JohnnyTest Requirements: 4 variables must be created: studentName, studentGpa, and studentAy; they must be String, double, and String respectively. The 4 th should

Assignment 1 JohnnyTest

Requirements:

4 variables must be created: studentName, studentGpa, and studentAy; they must be String, double, and String respectively. The 4th should be an ArrayList or array called academicYears.

As stated, the studentsName is JohnnyTest.

Set the studentGpa = 4.0;

Set the studentAy = Junior.

Set academicYears = [Freshman, Sophomore, Junior, Senior]

Once youve done that, I want you to print out (remember the sout short cut in IntelliJ) the students name, gpa, and AY like this:

The students name is JohnnyTest, they currently have a GPA of 4.0 and theyre currently a junior!

Youll then write a logic test:

If the students GPA is greater than or equal 2.0 & the student is Less Than a senior they can move to the next academic year, set their studentAy to their new academic year

JohnnyTest obviously moves up to a Senior, but I want your logic to determine what his new academic year is based off of your array. Youll see why in the next section.

If the students GPA is greater than or equal to 3.5 & the student is a Senior then simply print:

Student InsertName Can graduate.

By this point all weve done is made JohnnyTest a Senior. Dont worry about changing his GPA.

After the logic youve just written print out the student, their GPA, and their current year. Use this format:

InsertStudentName has a GPA of insetrGPA and is a insertAcademicYear

Now youll make another student with different criteria

Set studentName = Ed

Set studentGpa = 2.5

Set studentAy = Senior.

Copy paste the same logic you used, and Ed should not get a graduation message, rather Ed should get a message that says something along the lines of Ed needs to repeat senior year

Extra credit (2pts)

1pt. Abstract getting the students academic year into its own method. This method should take as input the current academic year, and return the new one. Keep in mind seniors are graduating; so we dont need to increase their academic year.

1pt. Do you see anything wrong with the ArrayList we created? What would happen in a real world system where students that graduate forever have their academicYear as senior? Does it matter? Include a brief write up in your submission (on Blackboard) discussing this.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!