Question: Assignment on interface Create a project with name Interface Project, and then write a Java application to: 1. Define the class Person and Student and

 Assignment on interface Create a project with name Interface Project, and

then write a Java application to: 1. Define the class Person and

Assignment on interface Create a project with name Interface Project, and then write a Java application to: 1. Define the class Person and Student and the interface Student Interface as the following class UML diagram: Person -name: String -age: int interface >> Student Interface +constructor +setters +getters +printInfo(): void +kind 0: String +isEqual (o: Object):boolean +getLetter Grade (a: double):String is-a Student -id String -av: double -major: String +constructor +sefters +getters printInfo(); void +kind(): String Note: printInfo() method implements as follows: - in Person class: print the information of the Person (name and age) - in Student class print the information of the Student (name, age, id, major, average and the letter Grade). kind() method implements as follows: in Person class: return "I'm a Person" kind() method implements as follows: in Student class: return "I'm a Student" isEqual() method implements as follows: compares between two Students and returns true if the two students have the same average and major and otherwise returns false, getLetterGrade() method implements as follows: if average between 0 and 49 returns F if average between 50 and 59 returns E if average between 60 and 69 returns if average between 70 and 79 returns if average between 80 and 89 returns B if average between 90 and 100 returns A otherwise returns "invalid average". 2. In the main method do the following: - Create an object of type Student with name "Ahmad Ali", age = 18, id= "201510122", major is "SE" and av 90.3. Print the information of this Student object. Create an object of type Student with name "Malik Anas", age = 20, id= "201310122", major is "CS" and av 80.3. Print the information of this student object. Change the age of the second student to any age. Print the information after updating. Print the kind of the first object, Compare between the two previous Name : Malek Anas students then print they are equal, otherwise print they are not equal. Letter Grade 1 B Name : Malek Anas AA run Name : Ahmad Ali Age 18 id : 201510122 Major 1 SE Average : 90.3 Letter Grade 1 A . Age : 20 id 201310122 Major 1 CS Average : 80.3 Age 21 id : 201310122 Major Cs Average 80.3 Letter Grade 1 B I'm a Student They are not Equal BUILD SUCCESSFUL (total time: 0 seconds)

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!