Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write in java using netbeans Write a java program that reads 2 4-digit integers. The program should decide if any is a multiple of 10

write in java using netbeans

image text in transcribed

Write a java program that reads 2 4-digit integers. The program should decide if any is a multiple of 10 and print out the sum of all digits in the greatest one. The program also decides and prints if such sum is even or odd. If sum is even, then the program prints out Great my friend". Otherwise, the program will display on the screen "The End is yet to come". N.B. The program will print an error message and will keep asking the user to re-enter the integer until it satisfies the criteria. The program should allow the user to repeat as many as he/she wants Output Sample Run Enter an integer (1000~9999): 162 Wrong Input... Reenter an integer between 1000 and 9999: 172 Wrong Input. Reenter an integer between 1000 and 9999: 1672 Enter an integer (100079999): 4589 None is a multiple of 10 The sum of all digits in 4589 is 26 26 is even Great my friend Do you want to repeat? (y) Y Do you want to repeat? [y) y Enter an integer (1000-9999): 9672 Enter an integer (1000-9999): 5580 5580 is a multiple of 10 The sum of all digits in 9673 is 25 25 is odd The End is yet to come Do you want to repeat? (y) N Goodbye

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions

Question

Why did Hostess Brands Inc. go into bankruptcy?

Answered: 1 week ago