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