Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Having an issue figuring out how to make this compile correctly. package DebugIF; import java.util.Scanner; public class DebugIF { public static void main(String[] args) {

Having an issue figuring out how to make this compile correctly.

package DebugIF;

import java.util.Scanner;

public class DebugIF {

public static void main(String[] args) { System.out.println("Today we find the solutions"); Scanner input = new Scanner(System.in); System.out.print("Enter three integers: "); int firstChoice = input.nextInt(); int secondChoice = input.nextInt(); int thirdChoice = input.nextInt(); if (firstChoice == 0); System.out.println("State of choices: " + "no choices made yet"); if (secondChoice == 0) System.out.println("State of choices: " + "user made first choice (" + firstChoice + ") " + "number of choices = 1"); else if (thirdChoice == 0) System.out.println("State of choices: " + "user made first choice (" + firstChoice + ") " + "user made second choice (" + secondChoice + ") " + "number of choices = 2"); System.out.println("State of choices: " + "user made first choice (" + firstChoice + ") " + "user made second choice (" + secondChoice + ") " + "user made third choice (" + thirdChoice + ") " + "number of choices = 3"); } }

These are the outputs required for this project to work, it seems I get further behind trying to fix the issues.

Inputs for the program:

0 0 0

2 0 0

1 4 0

7 5 7

Successful out put displayed:

Today we find the solutions Enter three integers: 0 0 0 State of choices: no choices made yet BUILD SUCCESSFUL

Today we find the solutions Enter three integers: 2 0 0 State of choices: user made first choice (2) number of choices = 1 BUILD SUCCESSFUL

Today we find the solutions Enter three integers: 1 4 0 State of choices: user made first choice (1) user made second choice (4) number of choices = 2 BUILD SUCCESSFUL

Today we find the solutions Enter three integers: 7 5 7 State of choices: user made first choice (7) user made second choice (5) user made third choice (7) number of choices = 3 BUILD SUCCESSFUL

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions

Question

Discuss all branches of science

Answered: 1 week ago

Question

=+ Who do you think is right? Why?

Answered: 1 week ago