-
-
Save MarGul/a45b7abf502acac5bbdf108f3557c9fc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Lab4 { | |
public static void main(String[] args){ | |
Scanner input = new Scanner(System.in); | |
System.out.println("Would you like to see an X or O?"); | |
String shape = input.next(); | |
Integer size; | |
while (!shape.equals("x")) { | |
if(shape.equals("o")) { | |
break; | |
} | |
System.out.println("Invalid, try again"); | |
shape = input.next(); | |
} | |
System.out.println("Enter the size"); | |
size = input.nextInt(); | |
if(shape.equals("x")) { | |
System.out.println("Print an X with size: " + size); | |
} | |
if(shape.equals("o")) { | |
System.out.println("Print an O with size: " + size); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment