Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 Write a class called Student.java with the following variables and methods. Variables: . . . department is a string value indicating department of

image text in transcribed
image text in transcribed
image text in transcribed
Question 1 Write a class called Student.java with the following variables and methods. Variables: . . . department is a string value indicating department of the student studentID is a string value indicating ID of the student. name is a string value indicating name of the student. yearsOfStudy is an integer value indicating how many years the student has studied at the university apa is a double value indicating gpa of the student. hasScholarship is a boolean value indicating if the student has scholarship or not. . a Methods: readinformation reads user inputs as in the sample output given below and assigns them to related variables. Student ID: 12345 Name: Ada Years of study: 4 GPA: 3,7 Department: ECON Scholarship (Yes/No): Yes predict Course predicts whether the student pass or fail the course CMPE113 according to the equations and it prints the result as in sample output given below. If the student has scholarship, the equation below must be used: GPA Pass = 3 yearsOf Study If the student does not have scholarship, the equation below must be used: GPA Pass = 2 yearsOfStudy If the equation has a result equal to 2 or higher than 2, you need to print the line below: The student will most likely pass CMPE113! Otherwise, below line should be printed: The student will most likely fail to pass CMPE 1131 printinformation prints information as given in the sample output below. (If the student has scholarship, you should write with scholarship, otherwise you should write "without scholarship". Also notice that years of study should be written as 1st, 2nd, 3rd or 4th.) Ada, whose student ID is 12345, is studying 4th year at the "CENG" department with scholarship. Ada has a GPA of 3.7. are StudentsEqual gets one Student object as parameter and compares two students in terms of their studenti, name, yearsOfStudy, GPA and hasScholarship variables. Finally, it returns a boolean value indicating whether all are same or not. Question 2 Write a class called StudentTest.java using main method. Create two Student objects with departments CENG and ECON, respectively . . Set features of the first student as follows: Student ID: 12345 Name: Ada Years of study: 4 GPA: 3.7 Department: ECON Scholarship (Yes/No): Yes Print information of the first student by using printinformation method. Predict future of the first student for the course CMPE113 by using predict Course method. . . . . Read information of the second student by using readinformation method. Print information of the second student by using printinformation method Predict future of the second student for the course CMPE 113 by using predict Course method. . Compare the two students by using are StudentsEqual method and print result as given in sample output Sample Outputs: Ada, whose student ID is 12345, is studying 4th year at the "CENG" department with scholarship. Ada has a GPA of 3.7. The student will most likely pass CMPE113! Enter information of second student: Student ID: 54321 Name: Eda Years of study: 2 GPA: 1,3 Department: ECON Scholarship (Yes/No): No Eda, whose student ID is 54321, is studying 2nd year at the "ECON" department without scholarship. Eda has a GPA of 1.3. The student will most likely fail to pass CMPE1131 These students are not same. Ada, whose student ID is 12345, is studying 4th year at the "CENG" department with scholarship. Ada has a GPA of 3.7. The student will most likely pass CMPE1131 Enter information of second student: Student ID: 12345 Name: Ada Years of study: 4 GPA: 3,7 Department: ECON Scholarship (Yes/No): Yes Ada, whose student ID is 12345, is studying 4th year at the "ECON" department with scholarship. Ada has a GPA of 3.7. The student will most likely pass CMPE113! These students are same

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

Students also viewed these Databases questions

Question

6. Have you used solid reasoning in your argument?

Answered: 1 week ago