lab10 go brrr, pt2

This commit is contained in:
2022-10-06 16:46:00 -05:00
parent f298dfd268
commit 52ce289927
11 changed files with 2054 additions and 1 deletions

View File

@@ -0,0 +1,37 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template
*/
package inclassoct6th;
import java.util.Scanner;
/**
*
* @author caleb
*/
public class InClassOct6th {
/**
* @param args the command line arguments
*/
public static void main(String[] args)
{
// Create a scanner
Scanner input = new Scanner(System.in);
//Define args
int number1 = 5, number2 = 17;
System.out.print("What is " + number1 + " + " + number2 + "? ");
int answer = input.nextInt();
while (number1 + number2 != answer)
{
System.out.println("Wrong answer, try again. What is " + number1 + " + " + number2 + "?");
answer = input.nextInt();
}
System.out.println("You got it!");
}
}

View File

@@ -0,0 +1,25 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package inclassoct6th;
import java.util.Scanner;
/**
*
* @author caleb
*/
public class Menu {
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
int usersChoice;
do {
System.out.println("type 1, 2, or 3: ");
System.out.println("type 0 to quit.");
usersChoice = input.nextInt();
} while (usersChoice != 0);
}
}