Mathgeek1030
On this page, you find all documents, package deals, and flashcards offered by seller mathgeek1030.
- 4
- 0
- 0
Community
- Followers
- Following
4 items
Program Final 4
Write a Java program that declares an array of size 10, using a constant for the size. Then, using a loop prompt the user to enter 10 floating point values and assign those values to the array. Display the contents using a for loop to go through the array and print out the contents until the end of the array has been reached.
- Answers
- • 2 pages •
Write a Java program that declares an array of size 10, using a constant for the size. Then, using a loop prompt the user to enter 10 floating point values and assign those values to the array. Display the contents using a for loop to go through the array and print out the contents until the end of the array has been reached.
Program Final 3
Write a Java program that makes a simple menu with a loop using a switch structure. (Not an if statement). The menu will handle five cases and a default. You should have an integer variable called weekday, which the user will input. If choice is a one, it should print out: "Today is Monday." If the choice is two, it should print out "Today is Tuesday." and so on up to five for Friday. If any other value is entered print out “Invalid input” and exit the program.
- Answers
- • 2 pages •
Write a Java program that makes a simple menu with a loop using a switch structure. (Not an if statement). The menu will handle five cases and a default. You should have an integer variable called weekday, which the user will input. If choice is a one, it should print out: "Today is Monday." If the choice is two, it should print out "Today is Tuesday." and so on up to five for Friday. If any other value is entered print out “Invalid input” and exit the program.
Program Final 2
Write a Java program that will ask the user to input an integer value between 1 and 100 for a grade. Using if-else statements determine if the value entered by the user should be awarded a grade of an A, B, C, D, or an F, and print out the result.
- Answers
- • 2 pages •
Write a Java program that will ask the user to input an integer value between 1 and 100 for a grade. Using if-else statements determine if the value entered by the user should be awarded a grade of an A, B, C, D, or an F, and print out the result.
Final Program #1
Write a Java program prompts the user to enter in three integers. The program should then calculate the value of the first integer added to the second and print the result. Next, it should calculate the value of the second integer subtracted from the third and print the result. Lastly, it should multiply the first and third integers before adding the value of the second integer and print the result.
- Answers
- • 2 pages •
Write a Java program prompts the user to enter in three integers. The program should then calculate the value of the first integer added to the second and print the result. Next, it should calculate the value of the second integer subtracted from the third and print the result. Lastly, it should multiply the first and third integers before adding the value of the second integer and print the result.