class

Write your question here.

Creat a pogram that uses inheritance. You will have a base class called Polygon which contains width and height. There will be two classes that inherit from this base class-rectangle and triangle. These two classes will have two member functions-1) calculate area and 2) show area. The base case will be able to show width and height. Remember to have constructors for the classes. Use the rand() function to generate the values for length and width. Have the values be between 1 and 10 to represent inches. The values you generate should be floating points and allow for decimal points. to perform this task you should generate random numbers between 200 and 1000 and then divide by 100 to generate the decimal points.

Create a program that illustrates your knowledge of temp;late classes and overloaded functions.There should be threee functions that find the difference between two values. you will have the following inputs (int, Int), (float,float) and (int, float).
Allow the user to enter values val1 and val2. Use cout statements in each of the functions so one can see which one is being called. The function will also output the results. The program should continue by using a loop until the user enters 0 for val and val2.
Write your question here.

Second assignment? Try again later!!!
Topic archived. No new replies allowed.