Write an accessor function to get the angle

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

Re-combine the three files from the last assignment into one file (so it will be easier to submit and to grade). Add a child class called Parallelogram which has two more private member-variables, one for the acute angle in degrees, and the other for area. Write two constructors, one a default constructor that initializes the acute angle in the parallelogram to be 60 degrees; and the other to pass in an argument for the acute angle in the parallelogram. Write an accessor function to get the angle. Write a member-function that calculates the parallelogram's area.

Write a friend function to compare the area of a rectangle with sides 12 and 8 to the area of a parallelogram with sides 14 and 18 and an acute angle of 40 degrees. Test it in main, and check the answer by hand.

Write a main program to test these functions.

HII\ TS: Set the side lengths and the angle in constructors. Depending on whether you use the inherited constructor, you may have to refer to the handout that had the 4-combinations-of¬constructors. When you want to compare areas, use a friend function to get at that data, and you will probably have to list the friend function in BOTH classes, since you want the Quadrilateral's private data and also the Parallelogram's private data. Then that means you will need to put a "forward reference" at the beginning of your program. Here's how to put in a forward reference: on the next line after using namespace std; you just type class Parallelogram; and that's just before you start the definition of class Quadrilateral. Then later on you have your usual definition of the class Parallelogram with all the listing of its member-functions and member-variables.

(The reason for the forward reference is so you can say, in the friend function's arguments, that you have a variable of type Parallelogram and your program will recognize it is a variable type to-be-defined soon.)

 

Reference no: EM13316775

Questions Cloud

Calculate the production energy required for a 4 kwp system : The story: The Civil Engineering Department would like to have solar panels installed on the roof of Ghausi Hall to supply some of its electricity use - after all there is plenty of space on the roof and plenty of sun in Davis.
Define different career tracks within information technology : The range of information technology (IT) jobs is extensive, but all IT professionals focus on improving usability and the efficiency of technological systems and processes.
Would these motels be better off renting rooms : But in the off-season, when the kids are back at school, one can find rooms for as little as $60 a night. Assume the average fixed cost of a room per night, including local government rates, insurance, taxes and depreciation, is $75.
What power is supplied to the motor : An automobile starter motor has an equivalent resistance of 0.0480 and is supplied by a 12.0 V battery with a 0.0080 internal resistance. What power is supplied to the motor
Write an accessor function to get the angle : Write a friend function to compare the area of a rectangle with sides 12 and 8 to the area of a parallelogram with sides 14 and 18 and an acute angle of 40 degrees. Test it in main, and check the answer by hand.
Determine if intersection provides appropriate changes : Your job as a Highway Patrol Officer is to place a sign to ‘Slow Down' on the freeway prior to a major construction site. The posted freeway speed is 65 mph and a speed of 35 mph is required through the construction site.
What is the final rotational speed of the ball : A ball rolls down a hill 100 m. The hill is inclined 60 degrees. what is the final rotational speed of the ball
What is the rms voltage on the primary side of transformer : AC power is carried to a home via a transmission line, where each wire has a resistance of 0.36 OHMS. What is the rms voltage on the primary side of transformer T2
How long will take until the height is 1 m above the orifice : A tank with a 3m diameter has an 8 cm orifice at the bottom. The tank is currently filled with water to a height of 2.5m above the orifice. If the orifice is opened, how long will it take until the height is 1 m.

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