The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
University
| Teaching Since: | Apr 2017 |
| Last Sign in: | 438 Weeks Ago, 3 Days Ago |
| Questions Answered: | 9562 |
| Tutorials Posted: | 9559 |
bachelor in business administration
Polytechnic State University Sanluis
Jan-2006 - Nov-2010
CPA
Polytechnic State University
Jan-2012 - Nov-2016
Professor
Harvard Square Academy (HS2)
Mar-2012 - Present
Task 1Value: 12 marks
For this task you will create a Subjectclass, whose instances will represent the subjects for study at a university. A subject will have a name, just a String, and a subject code, which is a six-character String. The first three characters of a subject code are alphabetic and the last three are numeric. The first three characters define the subject's discipline area. A subject code must be unique.You will also write a TestSubjectclass to test the use of your Subjectclass. In particular this will maintain an array of subjects. In order to manage the uniqueness of the subject codes, your program will need to display information about existing subject codes as well as checking that any new subject code supplied by the user is not the same as any existing subject code.The following state and functionality should be provided for the Subjectclass:
To assist with managing subject codes and their uniqueness you will provide the Subjectclass with some class methods as follows:
Your TestSubjectprogram will perform the following sequence of actions, using good design techniques such as in the appropriate use of methods:
Note:
Task 2Value: 8 marksDesign a class named Octagon that extends GeometricObjectclass and implements the Comparable and Cloneable interface. Assume that all eight sides of the octagon are of equal size. The area can be computed using following formula:
Draw the UML diagram that involves Octagon, GeometricObjects, Comparable, and Cloneable. Write a test program that creates an Octagon object with side values 5 and display its area and perimeter. Create a new object using clone method and compare the two objects using compareTo method.GeometricObjectclass can be found in textbook. It is also given below.
-----------