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; | |
| /** | |
| * A simple class to run the Chatbot class. | |
| * @author Laurie White | |
| * @version April 2012 | |
| */ | |
| public class DJKhaledDriver | |
| { |
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
| /** | |
| * A program to carry on conversations with a human user. | |
| * This is the initial version that: | |
| * <ul><li> | |
| * Uses indexOf to find strings | |
| * </li><li> | |
| * Handles responding to simple words and phrases | |
| * </li></ul> | |
| * This version uses a nested if to handle default responses. | |
| * @author Laurie White |
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
| public class JaydensDrive { | |
| public static void main(String[] args) { | |
| //STARTING PASSANGERS IN EACH BUS YOU CAN SWITCH TO | |
| String[] passengersA = {"Jayden"}; | |
| String[] passengersB = {"Jayden", "Brother Noah", "Steven"}; | |
| String[] passengersC = {"Jayden", "Adrian", "Fang", "Yaphet"}; | |
| String[] passengersD = {"Jayden", "Dax", "Ashil"}; |
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
| public class jaydensBus { | |
| int seats; //how many seats in bus | |
| int occupied; //how many seats taken | |
| int gas; //gas in bus | |
| int distance; //how far is destination | |
| String destination; //where is destination | |
| String busDriver; //driver's name | |
| String[] passengers;//String for passengers in each bus, only records the starting amount of passengers |
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 GradeProgram_HW { | |
| public static void main(String[] args) {//main | |
| int choice; | |
| Scanner sc = new Scanner(System.in); | |
| int[] grades = new int [20]; | |
| for(int i=0;i<grades.length;i++) { | |
| grades[i]=(int)(Math.random()*(100-60+1)+60); | |
| } |
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 Scrambler_HW { | |
| public static void main(String[] args) {//main | |
| String pA = "Y";//sets play again | |
| while(pA.equalsIgnoreCase("Y")){//play again | |
| System.out.println("How would you like to shuffle the phrase?\n1) Default Scrambles (5)\n2) Specify a number of scrambles\n3) Run some trials"); | |
| Scanner sc = new Scanner(System.in);//scanner |
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 EAuser_HW { | |
| public static void main(String[] args) { | |
| Scanner sc = new Scanner(System.in); | |
| System.out.print("What is your government name? "); | |
| String name = sc.nextLine();//saves name | |
| System.out.print("What is your grad year? "); | |
| String grad = sc.nextLine();//saves year |
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 PasswordGen_HW { | |
| public static void main(String[] args) { | |
| String s = "abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()`~<>,.;’:[]{}/|_+-=?"; | |
| Scanner sc = new Scanner(System.in); | |
| String pA = "Y"; | |
| //booleans for checking | |
| boolean hasLet; | |
| boolean hasNum; |
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 Is_a_Prime_HW { | |
| public static void main(String[] args) { | |
| int choice = 0; | |
| while (choice != 4) { | |
| System.out.println("\nWelcome to my Prime Number Program\n\t1) Prime Number Checker\n\t2)Print Primes 1-100\n\t3)Goldbach's Conjecture Calculator\n\t4) Quit"); | |
| System.out.print("\nChoose an option (1/2/3/4): "); | |
| Scanner sc = new Scanner(System.in); | |
| choice = sc.nextInt(); |
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 _HW_Craps { | |
| public static void main(String[] args) { | |
| Scanner sc = new Scanner(System.in); | |
| String pA = "Y"; | |
| int lose = 0; | |
| int win = 0; |
NewerOlder