Answered step by step
Verified Expert Solution
Question
1 Approved Answer
SIDE NOTE: PLEASE USE C++, thanks in advanced uestion 2: Integer divisions & repetition (while You are asked to write a Java program which will
SIDE NOTE: PLEASE USE C++, thanks in advanced
uestion 2: Integer divisions & repetition (while You are asked to write a Java program which will serve as a tutorial for the addition of two whole numbers with at most 3-digits for primary school children. Your program is to read in two integers and show how the addition is done along with the carry. Assume that the numbers being added have at most 3 digits and are positive (so no validation of user input is required). This program is to repeat until the user says otherwise. Hint: You will need to use integer division and modulo to solve this problem 1% and /) Below is a sample output screen to illustrate the expected behavior of your program. Make sure that in your output, the numbers in the addition are right justified Note: user input indicated with a ter tuo nunbers with at nost 3-digits each and press enteri 123 8 Welcone to Nancy's Addition Tutorial Progrant ter tuo nunbers with at nost 3-digits each and press enter 123 456 ou requested the folloing operation: nuni: ou requested the following operation: nun2: 123 st addition: 123 nun2:456 last digit of each nunber 38- 11 so answer is 1 with a carry of 1 st addition: st addition: addition plus the niddle digit of each nunber last digit of each nunber 3 6 -9 so ansuer is 9 with a car the carry fron previous 1 + ? 10 so answer is 0 with a carry of 1 rd addition: st addition: the carry fron previous addition plus the first digit of each number 11 2 so answer is 2 the carry fron previous addition plus the niddle digit of each nunber 0 + 5 = 7 so answer is 7 with a carry of 0 inal ansuer: 123 nun2 78 rd addition: nun1 vious addition plus the first digit of each nunber Answer: 201 inal answer nuni: you want to try another one? y or to repeat) n 123 nun2:456 Answer: 579 ope you are nore confortable vith additions now! If not. don't hesitate t you want to try another one?Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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