Starting from:
$30

$24

Homework 2 Solution

Problem 1 (40 points)-Write a program. Submit a file named height.cpp







Amusement parks have minimum heights for their rides. Create a program that adds users to the line of a ride in an amusement park if they meet the minimum height requirement (given in inches).




Create three classes:



An amusement park class o A ride class



A rider class (people riding the rides)



It should work with the following main (DO NOT MODIFY-NO CREDIT IF YOU MODIFY):










int main()




{

Rider r1("Yaris", 45); //name, height in inches




Rider r2(49); //height in inches




Amusement_park a1(3); //3 is the number of rides in the amusement park a1.get_ride(1).add_line(r1); //add a rider to the line of a ride




Amusement_park a2(2); //2 is the number of rides in the amusement park a2.get_ride(1).add_line(r2); //add a rider to the line of a ride




return 0;




}










Possible Sample Run 1 (your program does not have to match the following exactly, but should have the same functionality):

~~~Amusement Park Info~~~




Ride 1- Enter minimum ride height and ride name:




40 ride1




Ride 2- Enter minimum ride height and ride name:

50 ride2




Ride 3- Enter minimum ride height and ride name:

60 ride3




-Adding rider to line.










~~~Amusement Park Info~~~




Ride 1- Enter minimum ride height and ride name:




75 ride1




Ride 2- Enter minimum ride height and ride name:

76 ride2




-Sorry can't add rider-too short.










Problem 2 (60 points)-Write a program. Submit a file named money.cpp




XYZ Airport has two currency exchange offices. ABC Conversions services the north and east side of the airport while DEF Conversions services the south and the west side of the airport.




Notes:

-You should have a minimum of 2 classes (you decide which classes and how many) -You decide which currencies are available for conversion




Possible Sample Run 1 (your program does not have to match the following exactly, but should have the same functionality):




Enter name of exchange office and manager: ABC Conversions Armin




Enter name of exchange office and manager: DEF Conversions Jep




********

Hello traveler! Where are you in the airport? North




********




Welcome to ABC Conversions. Please contact the manager Armin if you have any complaints. What currency are you converting to dollars and how much? 200 yen




Here you go: $---- //the amount in dollars should be displayed here (based on your calculation)

********










Hello traveler! Where are you in the airport? West

********




Welcome to DEF Conversions. Please contact the manager Jep if you have any complaints. What currency are you converting to dollars and how much? 300 dinar We do not convert the dinar currency here. Sorry.




********




Hello traveler! Where are you in the airport? West




********

Welcome to DEF Conversions. Please contact the manager Jep if you have any complaints. What currency are you converting to dollars and how much? 300 peso




Here you go: $---- //the amount in dollars should be displayed here (based on your calculation)










********




Hello traveler! Where are you in the airport? exit

********




$$$Total dollars given out: $ --- //total amount of dollars dispensed should be displayed Exiting…

More products