Reference no: EM132209647
Question :
Write a program that contains an array of rental prices initialized with the following data: 550.00, 675.00, 850.00.
The data is represented as rent prices for a one, two, or three bedroom property. (e.g. A three bedroom rental would cost $850.00 per month.)
The main() function will ask the user for their full name, and the city and state that they are interested in finding a rental property.
Your program will then call a function called getData() that will ask the user for the total number of bedrooms and the number of pets that they have. This data needs to be returned back to main().
You must validate the data! Number of bedrooms can only be 1-3 and the number of pets can't be a negative number.
Allow the user to continue entering data until they comply. Once you receive the validated data from the user, your main() function will then print the Rental Contract as follows where the rent array is used for the number of bedrooms and each pet costs $9.50 per month:
Please enter your full name: John Smith
Please enter the city you are interested in: Dearborn
Please enter the state: MI How many bedrooms would you like 1-3? 2
How many pets do you have? 3 Rental contract for John Smith located in Dearborn, MI Rent for a 2 bedroom is: $675.00
Additional cost for pets: $28.50
Your total monthly rent will be $ 703.50 You must print a copy of your source code AND upload your .c or .cpp file to our moodle class online.