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 24 May 2017 My Price 9.00

chose the weapon

How can I revise it? to make it right?

Please only an expert!

 

This is sample output=========================================Game 1:Choose your weapon? rI chose the weapon: PYou lose!Game 2:Choose your weapon? sI chose the weapon: PYou win!Game 3:Choose your weapon? pI chose the weapon: SYou lose!Do you want to play again? nThis is my code.====================================================import java.util.*;public class Step {public static void main(String[] args) {//call the method introduction();//call the method playManyGamesScanner console=new Scanner(System.in);introduction();playManyGames(console);}public static int getGames(Scanner console){//this method asks the player number of times he/she is//going to play//save the result in the variable called games and//return the result to the calling methodSystem.out.println("What is your name?");String name=console.next();System.out.println();System.out.println("Best out of how many games do you want to play "+name+"?");int games=console.nextInt();while(games%2==0){System.out.println("Invalid number of games. Type a positive odd number!");games=console.nextInt();}return games;}public static void playManyGames(Scanner console) {/*this method actually plays the game. In this method youwill call the method called getGames and playGame. getGamesmethod returns the number of times that player wants toplay and this will be your loop control variable. In thismethod you need to keep track of how many times the

Attachments:

Answers

(11)
Status NEW Posted 24 May 2017 03:05 AM My Price 9.00

-----------

Not Rated(0)