Question: in programming language c++ Question 1 (25 points): A class figure contains the following: Ax coordinate A y coordinate An int area() method (pure virtual)

in programming language c++

in programming language c++ Question 1 (25 points): A class figure containsthe following: Ax coordinate A y coordinate An int area() method (pure

Question 1 (25 points): A class figure contains the following: Ax coordinate A y coordinate An int area() method (pure virtual) that computes the area of the figure. A move method (int newX, newY) to set the new location of the figure in a plane A class circle inherits from figure and has: A radius, which is private A constructor that takes the radius Its own implementation of int area(); A class rectangle inherits from figure and has A width, which is private A height, which is private A constructor that takes the width and height Its own implementation of int area); A class square that inherits from rectangle A width, which is private A constructor that takes the width Create all class implementations. Create a main method that tests the creation of a circle with radius 5, a rectangle of dimensions (5, 10), and a square with dimension (15). Print the area of all Question 2 (25 point): Create a class called fancyString that is composed of the following: A content of type char * A flag that indicates whether it is bold or not A flag that indicates whether it is italics or not. A constructor fancyString that takes a pointer to a char to initialize its content A constructor fancyString that takes another fancyString object to initialize it with (make sure you copy construct). Overload cout so that it can print a fancyString. Create fancyString fs1 Create fancyString fs2 = new fancyString(fs1). = new fancyString(First Example"); 5 points for documentation (inserting proper comments). 5 points for a professional judgment of your overall solution

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!