Question: Java program PART ONE- Write a simple input validation loop. Instruct the user to enter a certain value. If they correctly enter the value, give
Java program



PART ONE- Write a simple input validation loop. Instruct the user to enter a certain value. If they correctly enter the value, give them a praise message. If they incorrectly enter it, use your input validation loop to make sure they enter it correctly. Use a while loop for this, which is the typical loop of choice for input validation Here's some sample output: Enter the number 10: 15 ERROR: only enter 10: 16 ERROR: only enter 10: -9 ERROR: only enter 10: 10 Thanks for being solid. PART TWO- Write a program in which an accountant enters a monthly budget amount as well as the number of transactions to enter into the system. Use a for-loop to enter the transactions. Your program will then output if the accountant is over budget or on/under budget. Format your output similar to that shown below Monthly budget? ->5000 Number of transactions to record?-> 6 Please enter transaction: #1 --> 32.80 #2 --> 652.90 #3 --> 1115.55 #4 --> 328.94 #5 --> 2100.00 #6 --> 940.60 Budget: 5000 Total spending: 5170.79 Over budget PART THREE Write a program to help a teacher calculate test averages. Have the teacher enter test scores (use doubles) and use the sentinal value of -99 to indicate that the input is complete. Then calculate the number of tests and the average Format your output similar to that shown belovw Enter grade, -99 to quit: 62 Enter next grade, -99 to quit: 98 Enter next grade, -99 to quit: 87.5 Enter next grade, -99 to quit: 99.5 Enter next grade, -99 to quit: 100 Enter next grade, -99 to quit: 75.5 Enter next grade, -99 to quit: 84.5 Enter next grade, -99 to quit: -99 Number of tests: 7 Average: 86.714.3 Have a good day PART FOURsss Write a program that simply asks the user to enter two floats, and your code adds them together and displays the sum. The user is then asked if they want to repeat the program. Use an outer do-while loop for the program repeating Input validation: only allow Yly and N as the user's response for continuing the program. Use the code from the recent announcement to simplify your code Format your output similar to that shown below Enter two numbers and I'll add them: 52.3 98.6 52.3 + 98.6 = 150.9 Repeat program? Y/N: y Enter two numbers and I'll add them: 54.2 112.25 54.2 112.25 166.45 Repeat program? Y/N: N PART FIVE Write a program outputs the numbers 1-99 in rows of 15...except that any multiple of 4 is skipped. Make sure to use leading zeroes in your output formatting flags. Hints: use a separate output counter, incrementing that counter inside the for-loop, and output a newline when that output counter % 15 is O. Also remember that the "continue" statement will cause the current iteration of a loop to immediately stop, and the loop then goes straight to its next iteration. Format your output like this below 01 02 03 05 06 07 09 10 11 13 14 15 17 18 19 21 22 23 25 26 27 29 30 31 33 34 35 37 38 39 41 42 43 45 46 47 49 50 51 53 54 55 57 58 59 61 62 63 65 66 67 69 70 71 73 74 75 77 78 79 81 82 83 85 86 87 89 90 91 93 94 95 97 98 99
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
