ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 02 May 2017 My Price 8.00

package osu.cse1223

Can someone please help me with my errors to this program... I don't understand how to fix it. Thanks

 

 

package osu.cse1223;
import java.util.Scanner;
public class Project05 {
public static void main(String args) {
// TODO Auto-generated method stub
/*
* Project05.java
* This is a Guess-the-Number game that the user plays against the
computer. *
* @author Nick Pannell
* @version 20170211
*/
Scanner keyboard1 = new Scanner(System.in);
System.out.print("Enter a guess between 1 and 100: ");
int userSelection = keyboard1.nextInt();
int count = 0;
int compSelection = (int) (Math.random() * 100); while (userSelection != compSelection){
if(userSelection>100){
System.out.println("Your guess is our of
range. Pick a number between 1 and 100.");
System.out.print("Enter a guess between 1
and 100: ");
int userSelection = keyboard1.nextInt();
count ++;
} else if (userSelection > compSelection){
System.out.println("Your guess was too high.
Try again.");
System.out.print("Enter a guess between 1
and 100: ");
int userSelection = keyboard1.nextInt();
count ++;
} else {
System.out.println("Your guess was too low.
Try again.");
System.out.print("Enter a guess between 1
and 100: ");
int userSelection = keyboard1.nextInt();
count ++;
}
}
System.out.println("I had chosen " + compSelection + "
as the target number.");
System.out.println("You guessed it in " + count + "
tries.");
if (count =1){
System.out.println("That
} else if (count <= 4){
System.out.println("That
} else if (count <= 6){
System.out.println("That
} else if (count<= 7){
System.out.println("That
} else if (count <= 9){
System.out.println("That
} else { was lucky!");
was amazing!");
was good.");
was OK.");
was not very good."); } } } System.out.println("This just isn't your game.");

Answers

(11)
Status NEW Posted 02 May 2017 08:05 AM My Price 8.00

-----------

Not Rated(0)