Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- String holdsName, userTeamName;
- int sucessOfKick;
- Random penaltyGen = new Random();
- Scanner Scanner = new Scanner(System.in);
- System.out.println ("Hello which player would you like to take the last pentaly for you? This is a VERY important game!");
- System.out.println ("((Input player name))");
- holdsName = Scanner.next();
- System.out.println ("((Input team name))");
- userTeamName = Scanner.next();
- Scanner.close();
- players userPlayer = new players(holdsName, userTeamName);
- System.out.println(userPlayer);
- //----------------------------------------//
- sucessOfKick = penaltyGen.nextInt(10) + 1; //random num between 1 and 10. Will not be zero.
- System.out.println(sucessOfKick);
- if (sucessOfKick <= 4){
- System.out.println("OH! That's too bad for the team as the ball goes wide.");
- }
- else {
- System.out.println("It's in!");
- }
- }
- }
- public class players {
- String playerName;
- String teamName;
- public players (String name, String userTeamName){
- playerName = name;
- teamName = userTeamName;
- }
- public String toString () {
- return "Let's welcome number " + playerName + " from " + teamName + "!";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement