Question: This assignment will be completed in Eclipse on your machine. There are 4 small short programs here to help you practice with looping. They should
This assignment will be completed in Eclipse on your machine. There are 4 small short programs here to help you practice with looping. They should be created separately.
1) Write a program that prints to the screen all the even numbers from 2 to 100 and that starts a new line after every multiple of 20 (20, 40, 60, & 80). Save this file (class) as EvenNums.
2) Write a program that asks the user to type a 1,2,3, or 4. When the user types a 4, the program ends. If the user types 1,2, or 3 the program displays Good job!! and then asks the user for another input. When the user types any other number the application issues an error message and then asks for another input. Save this file (class) as Input123.
3) Write a program that prints every integer value from 1 to 20 along with the squared value of each integer. Save this file (class) as TableofSquares.
4) Write a program that sums the integers from 1 to 50 (1+2+3+..+50). Save this file (class) as Sum50.
Be sure to test your programs with various input values. Make sure your programs are properly documented using comments where needed.
You may read and write from the console window. Make sure your input and output are formatted nicely and easy to read.
You are to submit your source files, called EvenNums.java, Input123.java, TableofSquares.java, and Sum50.java in Moodle by the due date.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
