Question: 1) Write a class encapsulating the concept of a Student, assuming that a student has the following attributes: last name, first name, id, array of

1) Write a class encapsulating the concept of a Student, assuming that a student has the following attributes: last name, first name, id, array of grades. Include a constructor, the accessors and mutators, and method toString. Also code the following methods: one returning the GPA using the array of grades (assuming each grade represents a course grade and all courses have the same number of credit hours) and a method to add a course grade to the array of grades (this means creating a larger array). Write a client class to test all your methods.

2)

Write a class encapsulating a Restaurant,which inherits from Store. Store has the following attributes: name and sales tax rate; A Restaurant has the following additional attributes: how many people are served every year and the average price per person. code the constructor, accessors, mutators, toString and equals method of the super class Store and the subclass Restaurant; also in Restaurant - code a method returning the average taxes per year. You also need to include a client class to test your code for both the parent class and the subclass.

You should test creating Store objects and Restaurant objects, your set methods and get methods, toString and equals methods.

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!