How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask ATLPROG Your Own Question

ATLPROG
ATLPROG, Computer Software Engineer
Category: Programming
Satisfied Customers: 7677
Experience:  MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
44910485
Type Your Programming Question Here...
ATLPROG is online now
A new question is answered every 9 seconds

I've been sick last few weeks and I'm really behind

Customer Question

Hi, I've been sick for the last few weeks and I'm really behind in my C++ programming class... We've been asked to write the program below and I'm having trouble figuring out where to even start. If you'd be so kind as to write the program so I can review it I'd greatly appreciate it, but any help is appreciated!
Write the following 7 C++ files:
Shape.h - declaration of Shape class
Shape.cpp - definitions of Shape class functions
Circle.h - declaration of Circle class, publicly inherited from Shape
Circle.cpp - definitions of Circle class functions
Square.h - declaration of Square class, publicly inherited from Shape
Square.cpp - definitions of Square class functions
Prog13.cpp - main program to use the classes
Shape class contains:
Data:
name - will hold a string specifying what type of shape it is
Functions:
default constructor – stores “no name” to the name field
constructor that receives a string and stores it to the name field
getName – returns a copy of the name field
print – a virtual function that writes out the name field
calcArea – a pure virtual function that has no definition in this
class
Circle class contains:
Data:
radius - a double value that represents the radius of a circle
Functions:
default constructor – sends the string “circle” to the parent
constructor and then stores 1.0 into radius
constructor that receives a double – sends “circle” to parent
constructor and then assigns a value to radius. If the
double parameter value is positive, then store it to radius,
otherwise store 1.0.
setRadius – receives a double. If the double is >0, store it to
radius, otherwise store 1.0.
print – call parent class print to write out the type of shape, then
write out the radius and the area (from calcArea)
calcArea – calculates and returns the area of a circle with the
radius from the private data field.
Square class contains:
Data:
side - a double value that represents the length of one side of a
square
Functions:
default constructor – sends the string “square” to the parent
constructor and then stores 1.0 into the side field
constructor that receives a double – sends the string “square” to the
parent constructor and then assigns a value to side. If the
double parameter value is positive, then store it into side,
otherwise store 1.0.
setSide – receives a double. If the double is >0, store it to side,
otherwise store 1.0.
print – call parent class print to write out the type of shape, then
write out the side length and the area (from calcArea)
calcArea – calculates the area of a square with the side value from
the private data field.
Main Program:
Create an array of 5 pointers to Shape objects
Go through a loop 5 times, asking the user if they would like to create a Circle or
a Square each time. If they choose Circle, get a radius value from them
and then instantiate a new Circle using one of the Shape pointers. If they
choose Square, get the side value from the user and then instantiate a
Square object with the Shape pointer.
Use another loop to go through each element in the Shape pointer array and use the pointer to call its print function.
Create a Circle object and a Square object using their default constructors. Use
the set functions to give them sizes, and use their print functions to output
their data.
Show that the getName function works from one of the static objects.
Submitted: 7 months ago.
Category: Programming
Expert:  Aitizaz replied 7 months ago.
Hello and welcome to Just Answer! i amCustomerand i will assist you todaywhat is the deadline for this program?
Customer: replied 7 months ago.
It's due by 11pm PST tonight...
Expert:  Aitizaz replied 7 months ago.
how many hours left?
Customer: replied 7 months ago.
About 11 hours
Expert:  Aitizaz replied 7 months ago.
since i am in a different time zone, it will not be possible for me to work on it at this time . If we can have another 11 hours ( total of 22), then it could be developed by me
Customer: replied 7 months ago.
That's not possible unfortunately. Can we get someone else to work on it then?
Expert:  Aitizaz replied 7 months ago.
Sure. i will opt out so that any other expert may help you with this. thank you very much for your patience
Customer: replied 7 months ago.
Ok. So sorry about that.
Customer: replied 7 months ago.
I don't know if you can still see this, but I thought about it for a few minutes and actually my teacher has been lenient in the past and might be willing to give me a little extra time since I've been sick... I can give 24 hours for this answer. Also I just noticed I can add files, so here's the instructions. It'll probably be easier to read than the instructions I pasted.
Expert:  Aitizaz replied 7 months ago.
Yes that is much better. thank you very much for extending the deadline. i will get back to you tomorrow. I will develope the program using VC++ 2013
Customer: replied 7 months ago.
Thank you in advance for your hard work. What is VC++? Is it different from normal C++ or is it a program maybe?
Expert:  Aitizaz replied 7 months ago.
yes same thing. i will use C++ syntax, dont worry
Customer: replied 7 months ago.
Ok thanks!
Expert:  Aitizaz replied 7 months ago.
welcome!
Customer: replied 7 months ago.
Hello there. I'm wondering if you are close to being done?
Customer: replied 7 months ago.
We are already a few hours past 24 hours... I need it soon. Even now I'm relying on my teacher to be kind enough to still accept it.
Expert:  Aitizaz replied 7 months ago.
i am extremely sorry for the delay. I have almost completed the files ( .cpp and header). only main portion of the program needs to be implemented which i will do in a while.