Answer to Question #324037 in C++ for ness

Question #324037

Cody was amazed that people could grow so old and wondered If he, a robot, would also be able to grow like that. Suddenly, he heard a sharp cry nearby, and as he tumed the comer, he saw a baby. Cody never saw a baby before, plus, he was never a baby himself so he was really surprised that something could be that young. Cody asked the baby his age and the baby replied through crying, "My age is the product of The Programmer's age and your teacher's age all of which is divided by Peter's age then added by 1 Cody quickly inputted all the ages.


1
Expert's answer
2022-04-05T13:18:08-0400
#include <iostream>

using namespace std;

int main()
{
	int progAge, teachAge, PetersAge;
	cout << "Please, enter The Programmer's age: ";
	cin >> progAge;
	cout << "Please, enter your teacher's age: ";
	cin >> teachAge;
	cout << "Please, enter Peter's age: ";
	cin >> PetersAge;
	cout << "The baby`s age is " << progAge*teachAge / PetersAge + 1;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS