Question: Write a C++ program. A telephone directory has 60 lines on each page and each page has exactly three columns. An entry in any column
Write a C++ program.
A telephone directory has 60 lines on each page and each page has exactly three columns.
An entry in any column has a name and a telephone number. On which page, column, and line is the "Xth" entry?
For example: entry 400 will be on page 3 (page one has 180 entries, page 2 has 180 entries) thus entry 400 will be the 40th entry on page 3. There are 60 entries in column 1 so entry 400 will be on page 3, column 1, line 40.
The user will enter an entry and your program will print out the page, column and line. For this program the integer divide operator / and the modulus operator % are essential.
TEST CASES:
875 Answer: Page 5, Column 3, Line 35
1850 Answer: Page 11, Column 1, Line 50
35891 Answer: Page 200, Column 2, Lin 11
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
