I'm trying to make a program that asks a user to enter a three digit number. One output will tell the user the floor number and the second the room number.
So far this is what I have (I just don't know where to go from here):
I don't fully understand. The program prompts for one input, the three digit number, then outputs 2 statements based on the number entered, like the first digit represents the floor, and the other two represent the room number?
i.e.,
"Enter a three digit number: 123
"That is room number 23 on floor 1.
you're gonna have to pick some combination for the room number; either the first digit or first two digits or you could even do first and third digit but you have to pick some condition. you cant tell someone to separate something without telling them how it must be separated.
int a = 12;
int b = a/10; //divides a by ten
cout << b << endl;
int c = 12;
int d = c%10; //takes the remainder of division of c by 10
cout << d << endl;
#include <iostream>
#include <iomanip>
#include <string>
usingnamespace std;
void main ()
{
string number;
string floor;
string roomnumber;
cout<<"Please enter a three or four digit number \n";
getline(cin,number);
}