Create a structure named Apartment that contains data fields to hold the number of bedrooms (short int), the number of baths (short int), and the monthly rent (int) for the Apartment. Write a C++...

Create a structure named Apartment that contains data fields to hold the number of bedrooms (short int), the number of baths (short int), and the monthly rent (int) for the Apartment. Write a C++ program that creates an Apartment object and prompts the user for number of bedrooms and baths desired. Determine the rent from the following table and set the rent field appropriately. If a requested apartment type is “Not available”, set the rent field to 0. At the end your program should display all the data on screen (in a neat and readable way). 1 bath 2 baths 1 bedroom Rs. 8,000 Not available 2 bedrooms Rs. 14,000 Rs. 16,000 3 bedrooms Not available Rs. 18,500 Note: You must perform Input Validation in your program. If the user enters an invalid value for the number of bedrooms (i.e. a value which is less than 1 or greater than 3) or the number of baths (i.e. a value which is less than 1 or greater than 2), then your program should display an appropriate error message, and it should keep prompting the user again and again till the user provides valid input.
Nov 17, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here