Question
Code in C++, use classes and comment on the code, please Scenario The users will be able to set the number of floors on the
Code in C++, use classes and comment on the code, please
Scenario
The users will be able to set the number of floors on the building, the number of offices on each floor, the rent of each office per month at the start of the program. They will be able to see the number of empty offices in total within the building and as well as the number of offices available per floor. They will also be able to exit the program if they wish to for exiting the program. The users will be able to add , modify , delete records for the building with certain commands which will be listed at the start of the program. The details of each office will be asked :
the name of the Office
A description of the office
monthly fee (setting the date of the first payment)
the yearly fee will be shown as well as the date of the next monthly payment.
Output of the Program- Do not forget to comment please
Hi welcome to the work Environment!! ------------------------------------ Enter the number of floors in the building: 3 Enter the number of offices per floor : 2 ----------------------------------------- *Number of underscores should be equivalent to the total number of spaces the input + output values Floor: 1 ----------- Would You like to occupy an office on floor: 1(number of offices available: 2) : Yes * The program should keep on going if the user input capslock or lowercase characters for (Yes) ------------------------------------------------------------------------------------------- Enter a monthly fee: 2000 What is the name of the office: Orthodontist Description of the office: Best Orthodontist on the market!!! Set the first date of payment (dd/mm/yyyy): 12/13/2020 *The date is incorrect so asks for the date once again Invalid date! Re-type the date(dd/mm/yyyy): 12/12/2020 ---------------------------------------- Would You like to occupy another office on floor: 1(number of offices available: 1) : No * Number of offices are decreased to 1 ----------------------------------------------------------------------------------------------------------------------------------- Moving onto floor: 2!! ---------------------- Would You like to occupy an office on floor: 2 (number of offices available: 2) : YES -------------------------------------------------------------------------------------------- Enter a monthly fee: -5000 Re-Enter the monthly fee: 5000 What is the name of the office: 2 Re-Enter the office name: Sushi market Description of the office: Nice Seafood : ) Set the first date of payment (dd/mm/2020): 04/02 * From the first date inputted it keeps track of the date ----------------------------------------------------------------------------------------------------------- Would You like to occupy another office on floor: 2(number of offices available: 1) : YES ------------------------------------------------------------------------------------------------- Enter a monthly fee: 4000 What is the name of the office: Burger King Description of the office: We sell Burgers : ) Set the first date of payment (dd/mm/2020): 05/08 ------------------------------------------------- Moving onto floor: 3!! ---------------------- Would You like to occupy an office on floor: 3(number of offices available: 2) : No ----------------------------------------------------------------------------------- Congrats!! you have completed the interface of the building!! Use the following commands to make changes to the interface of the building:
building outline: -building floor access: -floor[floornumber] exit program: -exit
Go ahead Make changes!: -room Unknown Comman Please Type a valid Command: -building ----------------------------------------------------- Building Outline ---------------- 1 office occupied on floor 1 : Orthodontist 2 offices occupied on floor 2 : Sushi market, Burger King No office occupied on floor 3 : -------------------------------------------------------- Any other changes [-building, -floor[floornumber], -exit]: -floor1 ------------------------------------------------------------------ This is the outline of floor 1:
Number of offices occupied= 1
Number of offices empty= 1
Would you like to make any changes to floor 1: Yes
what would you like to do: Add a office: -Add Remove an office: -Remove Change an office: -Change Details: -Details Your input: - Add ----------------- Enter a monthly fee: 4200 What is the name of the office: Taco Bell Description of the office: Tacos Set the first date of payment (dd/mm/2020): 01/12 ------------------------------------------------ Any other changes [-building, -floor[floornumber], -exit]: -building -------------------------------------------------------------------- Building Outline ---------------- 1 office occupied on floor 2 : Orthodontist,Taco bell 2 offices occupied on floor 2 : Sushi market, Burger King No office occupied on floor 3 : ------------------------------- Any other changes [-building, -floor[floornumber], -exit]: -floor1 -------------------------------------------------------------------- This is the outline of floor 1:
Number of offices occupied= 2
Number of offices empty= 0
Would you like to make any changes to floor 1: Yes
what would you like to do: Add a office: -Add Remove an office: -Remove Change an office: -Change Details: -Details Your input: - Add I am afraid we canniot do that the floor is full! Your input: - Details --------------------- These are the details about floor 1: Number of offices that are occupied are 2
office 1- Orthodontist Best Orthodontist on the market!!! Monthly fee : 2000 Date of the next payment: 12/01/2021
office 2- Taco Bell Tacos Monthly fee : 4200 Date of the next payment: 01/01/2021 ------------------------------------ Any other changes [-building, -floor[floornumber], -exit]: -floor1 ------------------------------------------------------------------ This is the outline of floor 1:
Number of offices occupied= 2
Number of offices empty= 0
Would you like to make any changes to floor 1: Yes
what would you like to do: Add a office: -Add Remove an office: -Remove Change an office: -Change Details: -Details Your input: -Change ------------------- To which office would you like to make changes to 1 for Orthodontist,2 for Taco bell: 1 write [keep] to keep the original details... Enter a monthly fee: 2500 What is the name of the office: Orthodontist!!! Description of the office: keep Set the first date of payment (dd/mm/yyyy): keep ------------------------------------------------ Any other changes [-building, -floor[floornumber], -exit]: -floor1 ------------------------------------------------------------------ This is the outline of floor 1:
Number of offices occupied= 2
Number of offices empty= 0
Would you like to make any changes to floor 1: Yes
what would you like to do: Add a office: -Add Remove an office: -Remove Change an office: -Change Details: -Details Your input: -Details -------------------- These are the details about floor 1: Number of offices that are occupied are 2
office 1- Orthodontist!!! Best Orthodontist on the market!!! Monthly fee : 2500 Date of the next payment: 12/01/2021
office 2- Taco Bell Tacos Monthly fee : 4200 Date of the next payment: 01/01/2021 ------------------------------------ Any other changes [-building, -floor[floornumber], -exit]: -exit ----------------------------------------------------------------
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started