Question: This should be done in java and should read from a text file input PROBLEM: Given a number less than 1050, answer various questions about
PROBLEM: Given a number less than 1050, answer various questions about the number. INPUT: There will 5 lines of input. Each will contain a positive integer less than 1050 OUTPUT: For each line of input, answer the corresponding question below For Input Line #1, how many digits are in the number? For Input Line #2, what is the sum of all of the digits in the number? For Input Line #3, what is the sum of the digits at the odd locations (the leftmost digit is Location #1)? For Input Line #4, how many times does the digit 4 appear? For Input Line #5, what is the middle digit? (If the length of the number, N, is even, find the N/2 number (again, the leftmost digit is the 1st one) 2. 3. 4. 5. SAMPLE INPUT (http://www.datafiles.acsl.org/2019/contestl/jr-sample-input.txt) 1325678945 987654 456160 143295823976154 123456 SAMPLE OUTPUT: 1. 10 2. 39 3. 16
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
