IN JAVA CODE: One day while Cody was playing with his friends in the woods, they stumbled upon a bearded old man living
Posted: Mon May 09, 2022 6:12 am
IN JAVA CODE:
One day while Cody was playing with his friends in the woods,
they stumbled upon a bearded old man living alone in his cabin.
Cody and his friends were shocked that somebody could grow that
old. Cody, refusing to believe that it is possible, asked the old
man his age. The old man said, "My age is the sum of The Programmer
and your teacher’s ages subtracted by the age of your friend,
Peter". Puzzled with this statement, Cody quickly tried to input
the ages of The Programmer, his teacher, and his friend, Peter.
Help Cody find out the age of the old man.
Input
1. Age of The Programmer
2. Age of his teacher
3. Age of his friend, Peter
Output
The first line will contain a message prompt to input the age of
The Programmer. The second line will contain a message prompt to
input the age of his teacher. The third line will contain a message
prompt to input the age of his friend, Peter. The last line will
contain the age of the old man.
Enter age of The Programmer: 11
Enter age of his teacher: 29
Enter age of his friend, Peter: 5
The age of the old man is 35
One day while Cody was playing with his friends in the woods,
they stumbled upon a bearded old man living alone in his cabin.
Cody and his friends were shocked that somebody could grow that
old. Cody, refusing to believe that it is possible, asked the old
man his age. The old man said, "My age is the sum of The Programmer
and your teacher’s ages subtracted by the age of your friend,
Peter". Puzzled with this statement, Cody quickly tried to input
the ages of The Programmer, his teacher, and his friend, Peter.
Help Cody find out the age of the old man.
Input
1. Age of The Programmer
2. Age of his teacher
3. Age of his friend, Peter
Output
The first line will contain a message prompt to input the age of
The Programmer. The second line will contain a message prompt to
input the age of his teacher. The third line will contain a message
prompt to input the age of his friend, Peter. The last line will
contain the age of the old man.
Enter age of The Programmer: 11
Enter age of his teacher: 29
Enter age of his friend, Peter: 5
The age of the old man is 35