+1 (315) 557-6473 

Create a Program to Implement Menu Driven Program in Java Assignment Solution.


Instructions

Objective
Great job on taking on the challenge to complete a JAVA homework! Writing a program to implement a menu-driven program in Java is an excellent opportunity to strengthen your coding skills. By working on this task, you'll gain valuable experience in Java programming and get a deeper understanding of menu-driven applications. Remember to break down the problem into smaller steps, plan your approach, and use your creativity to design an efficient and user-friendly menu system. Embrace the learning process, stay determined, and don't hesitate to seek help or explore online resources if needed.

Requirements and Specifications

program to implement menu driven program in java
program to implement menu driven program in java 1
program to implement menu driven program in java 2
program to implement menu driven program in java 3
program to implement menu driven program in java 4
program to implement menu driven program in java 5
program to implement menu driven program in java 6

Source Code

/*

ALGORITHM:

Begin

Declare finalist1, finalist2, finalist3 as Integer

finalist1 = Random number between 1 and 10

finalist2 = Random number between 1 and 10

While finalist2 Is finalist1

finalist2 = Random number between 1 and 10

End While

finalist3 = Random number between 1 and 10

While finalist3 Is finalist1 Or finalist3 Is finalist2

finalist3 = Random number between 1 and 10

End While

Write finalist1

Write finalist2

Write finalist3

End

*/

import java.util.Random;

public class Ch4PP8Prizes_YourName {

// Entry point of the program

public static void main(String[] args) {

Random random = new Random();

// Choose the first finalist

int finalist1 = random.nextInt(11) + 1;

// Choose the second finalist

int finalist2 = random.nextInt(11) + 1;

while (finalist2 == finalist1) {

finalist2 = random.nextInt(11) + 1;

}

// Choose the third finalist

int finalist3 = random.nextInt(11) + 1;

while(finalist3 == finalist1 || finalist3 == finalist2) {

finalist3 = random.nextInt(11) + 1;

}

System.out.println("Finalist 1: " + finalist1);

System.out.println("Finalist 2: " + finalist2);

System.out.println("Finalist 3: " + finalist3); }

}