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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:00, clairajogriggsk
Signal sets company contracts to deliver one hundred 52-inch plasma high-definition television sets to a new retail customer, tuner tv store, on may 1, with payment to be made on delivery. signal tenders delivery in its own truck. tuner's manager notices that some of the cartons have scrape marks. tuner's owner phones signal's office and asks whether the sets might have been damaged as they were being loaded. signal assures tuner that the sets are in perfect condition. tuner tenders signal a check, which signal refuses, claiming that the first delivery to new customers is always for cash. tuner promises to pay the cash within two days. signal leaves the sets with tuner, which stores them in its warehouse pending its "grand opening sale" on may 15. two days later, tuner's stocker opens some of the cartons and discovers that a number of the sets are damaged beyond ordinary repair. signal claims tuner has accepted the sets and is in breach by not paying on delivery. will signal succeed on these claims? explain.
Answers: 1
image
Computers and Technology, 22.06.2019 00:00, jahi1201
Ahorse is how much percent more powerful than a pony
Answers: 1
image
Computers and Technology, 22.06.2019 22:00, noeminm105
Consider the following declarations (1, 2, 3, 5, 7)class bagtype{public: void set(string, double, double, double, double); void print() const; string getstyle() const; double getprice() const; void get(double, double, double, double); bagtype(); bagtype(string, double, double, double, double); private: string style: double l; double w; double h; double price; }; a.) write the definition of the number function set so that private members are set according to the parametersb.) write the definition of the member function print that prints the values of the data membersc.) write the definition of the default constructor of the class bagtype so that the private member variables are initialized to "", 0.0, 0.0, 0.0, 0.0, respectively d.) write a c++ statement that prints the value of the object newbag. e.) write a c++ statement that declares the object tempbag of type bagtype, and initialize the member variables of tempbag to "backpack", 15, 8, 20 and 49.99, respectively
Answers: 3
image
Computers and Technology, 23.06.2019 06:30, Knownothing
When early motion pictures played in movie theaters, they were often accompanied by live organ or piano music. which of the following are the most likely reasons that this happened? (select all that apply). the music was provided to distract audience members from the loud sounds made when filmstrips were changed. the music accompanied the movies because the movies were silent and audiences were used to hearing music during plays in theaters. the music usually was played before, and sometimes after the movie, as an alternative form of entertainment. the music viewers to interpret the dramatic action in the films.
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 in other subjects:

Konu
Mathematics, 14.12.2020 04:00
Konu
Mathematics, 14.12.2020 04:00
Konu
Mathematics, 14.12.2020 04:00