A beginner-friendly C++ console application that calculates the current number of people in a room based on the number of people entering and leaving.
- Takes the initial number of people as input
- Takes the number of people entering
- Takes the number of people leaving
- Calculates the current number of people in the room
- Calculates total people movement
- Calculates the net change in the number of people
- Variables
- Integer data types (
int) - User input with
cin - Output with
cout - Arithmetic operators (
+and-) - Assignment operator (
=) - New lines using
\n
The program asks the user for three values:
- Current number of people in the room
- Number of people who entered
- Number of people who left
It then calculates:
Current People
Initial People + People Entered - People Left