subject

Create an abstract base class called Shape and move the static variable scaleFactor and the three instance variables id, xLoc and yLoc from RightTriangle to Shape along with the get and set methods for those variables. Implement a Shape constructor and update the RightTriangle constructor to call the Shape constructor for the variables moved to Shape. Then add three abstract methods to Shape called getArea(), getPerimeter() and scaleShape(). Define three classes that extend Shape called Circle, Rectangle and RightTriangle. Much of RightTriangle can be copied from Lab 7, and much of Circle and Rectangle from the slides and in class work. For each class define the needed instance variables and an appropriate constructor to initializes those instance variables and call the Shape constructor for the instance variables defined on Shape, and then override the four abstract methods defined on Shape. Write an application which shows the user the following menu and implements all options. The program should continue to run and process requests until the user chooses to exit. The program should double-check that the user really wants to exit. You may use a limit of 10 possible shapes to simplify implementation. All input must be validated and appropriate feedback given for invalid input.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:40
Gabe wants to move text from one document to another document. he should copy the text, paste the text, and open the new document highlight the text, select the cut command, move to the new document, make sure the cursor is in the correct location, and select the paste command select the save as command, navigate to the new document, and click save highlight the text, open the new document, and press ctrl and v
Answers: 1
question
Computers and Technology, 22.06.2019 20:10
Assume the existence of a bankaccount class. define a derived class, savingsaccount that contains two instance variables: the first a double, named interestrate, and the second an integer named interesttype. the value of the interesttype variable can be 1 for simple interest and 2 for compound interest. there is also a constructor that accepts two parameters: a double that is used to initialize the interestrate variable, and a string that you may assume will contain either "simple", or "compound", and which should be used to initialize the interesttype variable appropriately. there should also be a pair of functions getinterestrate and getinteresttype that return the values of the corresponding data members (as double and int respectively).
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
Choose the answers that best complete each sentence. on average,are more expensive than other kinds of postsecondary schools. the cost of room and board includes. to save money, some students attend auniversity in their home state.
Answers: 2
question
Computers and Technology, 24.06.2019 03:30
What is the purpose of a computer network needs assessment? to analyze which workers need more training to improve their performance to compare worker productivity to determine what steps employees can take to increase company revenue to evaluate how to move from the current status to the desired goal
Answers: 2
You know the right answer?
Create an abstract base class called Shape and move the static variable scaleFactor and the three in...
Questions
question
Mathematics, 19.09.2019 10:30
question
Biology, 19.09.2019 10:30
question
Computers and Technology, 19.09.2019 10:30