Question: I dont know what i am doing wrong thats the flowchart and this is my code please tell me what i am doing wrong Start

I dont know what i am doing wrong

I dont know what i am doing wrong thats the flowchart and

thats the flowchart and this is my code please tell me what i am doing wrong

this is my code please tell me what i am doing wrong

Start Ask: "Would you like to flip a coin? Enter 0 for no." Get user input for int'choice' variable True choice == 0 - False Generate a random number of 1 or 2. Save it in an int variable called 'num' Display "You got heads!" True num = 1 False Display "You got tails! True num == 2 False Display "Goodbye!" Stop import java.util.*; 1 public class RandomNumbers {1 => public static void main(String[] args) {1 int choice, num; Scanner input= new Scanner (System.in); System.out.println("Whould you like to flip.coin.enter?.enter.o. for.no"); 1 choice=input.nextInt(); if (choice==0){1 >> int random. = (int)Math.random() * (2-1+1)+(1); num=random; 1 else if (num==1) {1 System.out.println("You got heads"); System.out.println("Goodbye!"); OA else if (num==2). {1 System.out.println("You got tails!"); System.out.println("Goodbye"); 1 else {1 System.out.println("Goodbye"); 1 } 1. }1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!