Question
Problem 5 1. A C++ teacher wants to find how many students he has in his classroom. He did the following to discover the number:
Problem 5
1. A C++ teacher wants to find how many students he has in his classroom. He did the following to discover the number:
a. When he forms groups of 4, he is left with one group of 3 students
b. When forming groups of 3, he is left with one group of 2 students
c. Finally when forming groups of 5, no odd group is left. All groups have five students.
Write a program to help the teacher find how many students in his classroom.
2. Loops, again!
a. Write a while loop, that adds 5 to n for as long as n is smaller than 15
b. What would the value of n be at the end of the loop if n = 3 before the loop?
c. What would the value of n be at the end of the loop if n = 21 before the loop?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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