Create a pogram that uses inheritance

Assignment Help Basic Computer Science
Reference no: EM13307716

Create 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.

Reference no: EM13307716

Questions Cloud

Create a simple program that manipulates vectors : Create a simple program that manipulates vectors as follows.
Psychological factors in risk management : Could you share with us any psychological factors you have come across in risk management on an infrastructure project (or any other project)?
Defining the activities in every instance : Determine the need to develop the WBS before defining the activities in every instance. In the given scenario, think of the different types of dependencies within the project. In your opinion, how do the activity dependencies impact the project durat..
What are the rms values of the electric and magnetic fields : A future space station in orbit about the earth is being powered by an electromagnetic beam from the earth. What are the rms values of the electric and magnetic fields
Create a pogram that uses inheritance : 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.
Calculate the ph of a drop of pure rainwater at a temp : . In order to get full credit for this problem you must list all unknown species that would exist in the raindrop and all pertinent equations regardless of their level of significance. You must algebraically solve the equations to determine pH.
Determines whether the number is even or odd : The numbers should be generated using the rand() function. Use a while loop to list out the values using the pointer array.
Compute the coordinates of the center of mass : Three balls with masses of 3.0 kg, 1.0 kg, and 5.0 kg are located at coordinates (8.0m,8.5m), (8.5m,4.5m), and (4.5m,1.0m), What is the x-coordinate of the center of mass
Compute the maximum torque that this coil can experience : A wire has a length of 6.63 Ã- 10-2 m and is used to make a circular coil of one turn. compute the maximum torque that this coil can experience

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Display both two-dimensional and one-dimensional array

For testing purposes, you may do a compile-time initialization of a 6 x 3 two-dimensional array. Display both the two-dimensional and the one-dimensional array.

  What features look for switches and explain why want feature

You have been called in to consult on a new network design for CNT Books. The requirements of this design are summarized as follows: *The building has 3 floors. *There are 300 user workstations and 10 servers.

  Explaining regular language and context-free language

Let L1 be a regular language and L2 be a context-free language, both defined over the same alphabet Σ.

  Hat does mbsa do to check for weak local account passwords

hat does MBSA do to check for weak local account passwords?

  Explain security awareness and training document

Amy walked into her office cubicle and sat down. The entire episode with the blond man had taken well over two hours of her day. Based on this case study, what security awareness and training documents and posters had an impact in this event?

  Create an employee class with two fields

Create an Employee class with two fields-IDNum and hourlyWage. The Employee constructor requires values for both fields. Upon construction, throw an ArgumentException if the hourlyWage is less than $6.00 or more than $50.00.

  Two-dimensional arr named number of three rows

Given a two-dimensional arr named number of three rows and four columns of type ont, write the nigle code statement that both declare and initialize the arry such that the first row is initialize to 0,1,2,3, the second row is initialized to 4,5,6,..

  Display the total and average number of calories burned

Write a condition-controlled while loop that allows the user to enter the calories they burned. Stop looping when the user enters a negative number. Display the Total and Average number of calories burned.

  Determine throughput for file transfer form one host-another

Assume Host A wishes to send the large file to Host B. Suppose no other traffic in network, Determine the throughput for the file transfer?

  Actions-hard disk crash and all data backed up are lost

You come to work on a Monday morning and find that the office computer is not working. The system manager informs everyone that the computer's hard disk crashed and that all datat that wer not backed up are lost. What do you do?

  How to choose optimal location of pipeline for oil field

A Consultant is to lay oil pipeline running east to west through the oil field of n wells. From each well spur pipeline is to be connected directly to main pipeline along shortest path.

  Explain the term omniscience

Explain the term omniscience Explain the importance of autonomy in an agent Develop the task environment for an interactive language tutor

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd