Create a base shape use this class to store two double

Assignment Help C/C++ Programming
Reference no: EM131097602

Program

Create a base shape. Use this class to store two double type values that could be used to compute the area of figures. Derive two specific classes called triangle and rectangle from the base shape. Add to the base class, a member function get_data() to initialize base class data members and another member function display_area() to compute and display the area of figures. Make display_area() as a virtual function and redefine this function in the derived classes to suit their requirements. 

Using these three classes, design a program that will accept dimensions of a triangle or a rectangle interactively and display the area. 

Remember the two values given as input will be treated as lengths of two sides in the case of rectangles and as base and height in the case of triangles and used as follows:

Area of rectangle = x* y
Area of triangle = ½ * x * y

Reference no: EM131097602

Questions Cloud

Marginal cost associated with producing in the two plants : You are the manager of a firm that produces output in two plants. The demand for your firm's product is P = 80-Q, where Q = Q1 + Q2. The marginal cost associated with producing in the two plants are MC1 = Q1 and MC2 = 8. How much output should be pro..
Different from the one facing firm in perfect competition : The monopolist’s marginal revenue is different from the one facing a firm in perfect competition because: (a) The price elasticity he faces is less than unity; (b) The price elasticity he faces is equal to unity; (c) The price elasticity he faces is ..
Increase in equilibrium level of national income : In an economy, the marginal propensity to consume is 0.8. The government balances the budget by adjusting the proportional tax level to the required government spending. An increase by 10 million in government required spending will lead to an increa..
Inflation and expectations are rational-longrun equilibrium : When there are expectations that there will be inflation and expectations are rational, the longrun equilibrium will be:
Create a base shape use this class to store two double : Create a base shape. Use this class to store two double type values that could be used to compute the area of figures. Derive two specific classes called triangle and rectangle from the base shape. Add to the base class, a member function get_data() ..
Fixed exchange rate regime : There is a fixed exchange rate regime. Assuming that all accounts are balanced in the balance of payments, a sale of a local enterprise to a foreign buyer will create:
Why is the behavior of an oligopolist so hard to predict : Why is the behavior of an oligopolist so hard to predict? How does it differ from that of a monopolist? Why? Also, If a monopolist has little substantial competition wouldn’t logic dictate that that there would be a portion of the Marginal revenue cu..
Money supply and interest rate related to investment : Was monetary policy (money supply and interest rate related to investment) part of John Maynard Keynes's principles and theories that he advocated? Or did he only contribute to fiscal policy (government spending and tax rates)?
Advances in eradicating extreme hunger and poverty : Why does Dupont Corporation fund this effort which has no direct benefit to its profit margin? WILMINGTON, Del., May 20, 2014 – Today, the DuPont Advisory Committee on Agricultural Innovation & Productivity issued an updated progress reporton the glo..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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