Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CMPS 260 Fall 2018 Programming Assignment #11 (2018.115) 1 of 3 CMPS 260, Fall 2018 Programming Assignment #11 (100 points) Due Date: As indicated on
CMPS 260 Fall 2018 Programming Assignment #11 (2018.115) 1 of 3 CMPS 260, Fall 2018 Programming Assignment #11 (100 points) Due Date: As indicated on CMPS 260 Moodle site The coding for the solution to the following problem is to be done by you and only you. You may discuss the requirements of this project, Java, or Intellij with anyone, but you must code your own solutions. You may use text, class notes and examples, and online Java resources. You may discuss your code with the instructor, TAs or mentors, but no one else. The project is to be created using IntellJ in Oracle Java 10. The purpose of this assignment is to become familiar with implementing an interface. 1. Download the ZIP archive "pa11.zip" from Moodle, then extract (copy paste for you Windows users) the contalned Intellij project folder (pal1"). Oce extracted, open the Intellij project folder (pa1) in Intellij. 2. Create two out of the three classes described below, implementing interface RoundShapes into them. Note that RoundShapes extends interface Comparable,so each class you create will have to override the method compareTo. For this exercise, have compareTo compare the area of to RoundShapes objects. (a) Cirle-This class adds a data member radlus, along with its getter (accessor) and setter (mutator) methods. The implementation of the volume methad returns zero. (b) Sphere This class adds a data member radius, along with its getter (accessor) and setter (mutator) methods. (c Cylinder This class adds data members for radius and height, along with getter (accessor) and setter (mutator) methods for both. 3. nlass Main, create reference variables and objects of each of the two classes that you created then demonstrate that (a) inherited getter (accessor) methods work by passing the references to the class objects as the actual parameter used in calls to the method showRSlues (b) any methods unique to the classes work by using the reference variables to call these methods. (c) any changes made by calls to setter (mutator) methods work by again calling the showRsVlues method and any unique to the class getter(accessor) methods. (d) Create an ArrayList RoundShapes> and add at least two objects of each of your created classes to it. Collections.sorList) works by calling compare To. Since your classes implement Comparabie, the ArrayListcRoundShapes> can be socted by passing it to Sort the ArrayList RoundShapes>, then traverse it and output the class and area of each object in the list (List)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started