I need a c++ program, works with while loop, for Write a program that calculates the number of private offices in a high rise building. The program should start by asking the user how many floors are in the building. A loop should then iterate once for each floor. In each iteration, the loop should ask the user how many offices are on the floor and how many of them are private offices. After all the iterations, the program should display the how many offices the building has, how many are private, how many of them are shared, and the percentage of private offices. The percentage may be calculated by dividing the number of private offices by the total number of offices. Input Validation: Do not accept a number less than 1 for the number of floors or the number of offices.
Types of Loop
Loops are the elements of programming in which a part of code is repeated a particular number of times. Loop executes the series of statements many times till the conditional statement becomes false.
Loops
Any task which is repeated more than one time is called a loop. Basically, loops can be divided into three types as while, do-while and for loop. There are so many programming languages like C, C++, JAVA, PYTHON, and many more where looping statements can be used for repetitive execution.
While Loop
Loop is a feature in the programming language. It helps us to execute a set of instructions regularly. The block of code executes until some conditions provided within that Loop are true.
I need a c++
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images