diff --git a/.idea/.idea/misc.xml b/.idea/.idea/misc.xml new file mode 100644 index 0000000..4c1c37a --- /dev/null +++ b/.idea/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/.idea/modules.xml b/.idea/.idea/modules.xml new file mode 100644 index 0000000..2c4f6ec --- /dev/null +++ b/.idea/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea/vcs.xml b/.idea/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/.idea/workspace.xml b/.idea/.idea/workspace.xml new file mode 100644 index 0000000..06312c0 --- /dev/null +++ b/.idea/.idea/workspace.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519274821765 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/SkylarGalloway/Problem 1/.idea/.name b/.idea/SkylarGalloway/Problem 1/.idea/.name new file mode 100644 index 0000000..06d296a --- /dev/null +++ b/.idea/SkylarGalloway/Problem 1/.idea/.name @@ -0,0 +1 @@ +Problem_One \ No newline at end of file diff --git a/.idea/SkylarGalloway/Problem 1/.idea/misc.xml b/.idea/SkylarGalloway/Problem 1/.idea/misc.xml new file mode 100644 index 0000000..0548357 --- /dev/null +++ b/.idea/SkylarGalloway/Problem 1/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/SkylarGalloway/Problem 1/.idea/modules.xml b/.idea/SkylarGalloway/Problem 1/.idea/modules.xml new file mode 100644 index 0000000..3b4d7cc --- /dev/null +++ b/.idea/SkylarGalloway/Problem 1/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/SkylarGalloway/Problem 1/.idea/workspace.xml b/.idea/SkylarGalloway/Problem 1/.idea/workspace.xml new file mode 100644 index 0000000..abb19c3 --- /dev/null +++ b/.idea/SkylarGalloway/Problem 1/.idea/workspace.xml @@ -0,0 +1,303 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519274821765 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/SkylarGalloway/Problem 1/FiveOutput.txt b/.idea/SkylarGalloway/Problem 1/FiveOutput.txt new file mode 100644 index 0000000..a4ff8f5 --- /dev/null +++ b/.idea/SkylarGalloway/Problem 1/FiveOutput.txt @@ -0,0 +1,4 @@ +Boston_Walking_Dead_Zombie_Run +Man_BunRun +No_Concrete_Run_In_Mud + diff --git a/.idea/SkylarGalloway/Problem 1/Problem_One.iml b/.idea/SkylarGalloway/Problem 1/Problem_One.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/.idea/SkylarGalloway/Problem 1/Problem_One.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/SkylarGalloway/Problem 1/fiveInput.txt b/.idea/SkylarGalloway/Problem 1/fiveInput.txt new file mode 100644 index 0000000..9076097 --- /dev/null +++ b/.idea/SkylarGalloway/Problem 1/fiveInput.txt @@ -0,0 +1,10 @@ +Input files +5 +# of keywords to match +2 + +Boston_Walking_Dead_Zombie_Run +300_SparTan_Run +Man_BunRun +No_Concrete_Run_In_Mud +BunRun_Spartan_Mud_Run diff --git a/.idea/SkylarGalloway/Problem 1/out/production/Problem_One/findFIle.class b/.idea/SkylarGalloway/Problem 1/out/production/Problem_One/findFIle.class new file mode 100644 index 0000000..2e646bb Binary files /dev/null and b/.idea/SkylarGalloway/Problem 1/out/production/Problem_One/findFIle.class differ diff --git a/.idea/SkylarGalloway/Problem 1/problem1.md b/.idea/SkylarGalloway/Problem 1/problem1.md new file mode 100644 index 0000000..bb6eb4b --- /dev/null +++ b/.idea/SkylarGalloway/Problem 1/problem1.md @@ -0,0 +1,43 @@ +# Problem 1 + +You have a friend who has a lot of files where each one contains the results from a race. These files do not have a standard naming system. +However you do know the names of the races, and also that each race puts it's name in the file name for it's results. + +The races your friend is interested in are: +* BunRun +* Zombie +* Boston +* Spartan +* Mud + +There happen to have an index file of all the file names. Your friend is willing totype these names in on the command line to your program. + +They are asking you to find all file names that contain exactly one of the names of the races, and print them to the screen so they can find them. + +Here is a small version of the index file (Note the number on the first line that says how many files there are to consider): + +~~~ +4 +2014_Mud-run_for_fun.xml +Spartan_run_in_the_Mud.doc +Boston-Marathon_2019 +Bun_Run_In_The_Sun.pdf +~~~ + +Result for these file names: + +~~~ +2014_Mud-run_for_fun.xml +Boston-Marathon_2019 +~~~ + +## What to have in your answer: +* A file that has your program in it that can be compiled. It should be named: .java +* A seperate file with at least 5 test possible file names that you create. +* A seperate file with the answers to the test cases you created (list the file name on one line and then the answer on the following line.) + + +## Bonus: +1. Get your program to give an option to print either the file names that contain exactly one of the race names, or any/multiple of the race names, based upon input from the user (to decide which they want to do.) +2. Your friend has found an additional batch of files that are in folders. Look for the race names, ignoring any characters before the last '/' in the file name: +races/summer/north/Zombie_run_for_your_life.docx diff --git a/.idea/SkylarGalloway/Problem 1/src/findFIle.java b/.idea/SkylarGalloway/Problem 1/src/findFIle.java new file mode 100644 index 0000000..8ce6daf --- /dev/null +++ b/.idea/SkylarGalloway/Problem 1/src/findFIle.java @@ -0,0 +1,87 @@ +/* +My Test +Boston_Walking_Dead_Zombie_Run +300_SparTan_Run +Man_BunRun +No_Concrete_Run_In_Mud +BunRun_Spartan_Mud_Run + +Professor Ifland + +*/ + +import java.util.Scanner; +public class findFIle { + public static void main(String[]args){ + Scanner numFiles = new Scanner(System.in); //input number of files + System.out.println("Enter number of files: "); + int num = numFiles.nextInt(); + + Scanner numfiles = new Scanner(System.in); //input number of files + System.out.println("How Many Keywords Matches: "); + int nUm = numfiles.nextInt(); + + Scanner fiLe = new Scanner(System.in); // input file names + //String[] userFile = new String[num]; Array for files + for (int i=0; i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519421913529 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/SkylarGalloway/Problem 2/Problem_Two/.idea/.name b/.idea/SkylarGalloway/Problem 2/Problem_Two/.idea/.name new file mode 100644 index 0000000..bfe6706 --- /dev/null +++ b/.idea/SkylarGalloway/Problem 2/Problem_Two/.idea/.name @@ -0,0 +1 @@ +grouping \ No newline at end of file diff --git a/.idea/SkylarGalloway/Problem 2/Problem_Two/.idea/dictionaries/Skylar.xml b/.idea/SkylarGalloway/Problem 2/Problem_Two/.idea/dictionaries/Skylar.xml new file mode 100644 index 0000000..27e93bd --- /dev/null +++ b/.idea/SkylarGalloway/Problem 2/Problem_Two/.idea/dictionaries/Skylar.xml @@ -0,0 +1,7 @@ + + + + intialize + + + \ No newline at end of file diff --git a/.idea/SkylarGalloway/Problem 2/Problem_Two/.idea/misc.xml b/.idea/SkylarGalloway/Problem 2/Problem_Two/.idea/misc.xml new file mode 100644 index 0000000..0548357 --- /dev/null +++ b/.idea/SkylarGalloway/Problem 2/Problem_Two/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/SkylarGalloway/Problem 2/Problem_Two/.idea/modules.xml b/.idea/SkylarGalloway/Problem 2/Problem_Two/.idea/modules.xml new file mode 100644 index 0000000..9524bbe --- /dev/null +++ b/.idea/SkylarGalloway/Problem 2/Problem_Two/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/SkylarGalloway/Problem 2/Problem_Two/.idea/workspace.xml b/.idea/SkylarGalloway/Problem 2/Problem_Two/.idea/workspace.xml new file mode 100644 index 0000000..445d41e --- /dev/null +++ b/.idea/SkylarGalloway/Problem 2/Problem_Two/.idea/workspace.xml @@ -0,0 +1,462 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519690749602 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/SkylarGalloway/Problem 3/Problem 3.iml b/.idea/SkylarGalloway/Problem 3/Problem 3.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/.idea/SkylarGalloway/Problem 3/Problem 3.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/SkylarGalloway/Problem 3/out/production/Problem 3/userName.class b/.idea/SkylarGalloway/Problem 3/out/production/Problem 3/userName.class new file mode 100644 index 0000000..de313e6 Binary files /dev/null and b/.idea/SkylarGalloway/Problem 3/out/production/Problem 3/userName.class differ diff --git a/.idea/SkylarGalloway/Problem 3/src/userName.java b/.idea/SkylarGalloway/Problem 3/src/userName.java new file mode 100644 index 0000000..eb5de20 --- /dev/null +++ b/.idea/SkylarGalloway/Problem 3/src/userName.java @@ -0,0 +1,78 @@ +import java.util.Scanner; + +public class userName { + public static void main(String[]args){ + char username[] = new char[8]; + Scanner numUsers = new Scanner(System.in); //input number of files + System.out.println("Enter number of names: "); + int num = numUsers.nextInt(); + + Scanner naMe = new Scanner(System.in); // input file names + for (int i=0; i=8){ + for(int ii =1; iilastName.charAt(jj)){ + for(int iii=ii; iii<8; iii++){ + username[iii]=lastName.charAt(jj);//It is stuck in an infinite loop goes through this completely + //but prints out sggggggg infinte amount of time. Will not go through each char + } + String userName = new String (username); + System.out.println(userName); + + } + else{ + //for(int x=ii; x<8; x++) { + if (ii<8) { + username[ii] = firstName.charAt(ii); + } + else { + String userName = new String(username); + //System.out.println(userName); + System.out.println(userName); + + } + //} + + } + } + + } + } + else { + System.out.println(firstName+lastName); + } + + //char userBuild; //This is to add character wanted from name into new character array + //userBuild= firstName.charAt(1); + + + + + } + + + + + + } + + + } +} diff --git a/.idea/SkylarGalloway/Problem 3/testinput.txt b/.idea/SkylarGalloway/Problem 3/testinput.txt new file mode 100644 index 0000000..e69de29 diff --git a/.idea/SkylarGalloway/Problem 3/testoutput.txt b/.idea/SkylarGalloway/Problem 3/testoutput.txt new file mode 100644 index 0000000..e69de29 diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..4c1c37a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..2c4f6ec --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/problem1.md b/.idea/problem1.md new file mode 100644 index 0000000..bb6eb4b --- /dev/null +++ b/.idea/problem1.md @@ -0,0 +1,43 @@ +# Problem 1 + +You have a friend who has a lot of files where each one contains the results from a race. These files do not have a standard naming system. +However you do know the names of the races, and also that each race puts it's name in the file name for it's results. + +The races your friend is interested in are: +* BunRun +* Zombie +* Boston +* Spartan +* Mud + +There happen to have an index file of all the file names. Your friend is willing totype these names in on the command line to your program. + +They are asking you to find all file names that contain exactly one of the names of the races, and print them to the screen so they can find them. + +Here is a small version of the index file (Note the number on the first line that says how many files there are to consider): + +~~~ +4 +2014_Mud-run_for_fun.xml +Spartan_run_in_the_Mud.doc +Boston-Marathon_2019 +Bun_Run_In_The_Sun.pdf +~~~ + +Result for these file names: + +~~~ +2014_Mud-run_for_fun.xml +Boston-Marathon_2019 +~~~ + +## What to have in your answer: +* A file that has your program in it that can be compiled. It should be named: .java +* A seperate file with at least 5 test possible file names that you create. +* A seperate file with the answers to the test cases you created (list the file name on one line and then the answer on the following line.) + + +## Bonus: +1. Get your program to give an option to print either the file names that contain exactly one of the race names, or any/multiple of the race names, based upon input from the user (to decide which they want to do.) +2. Your friend has found an additional batch of files that are in folders. Look for the race names, ignoring any characters before the last '/' in the file name: +races/summer/north/Zombie_run_for_your_life.docx diff --git a/problem2.md b/.idea/problem2.md similarity index 100% rename from problem2.md rename to .idea/problem2.md diff --git a/problem3.md b/.idea/problem3.md similarity index 100% rename from problem3.md rename to .idea/problem3.md diff --git a/.idea/src/.classpath b/.idea/src/.classpath new file mode 100644 index 0000000..233be1d --- /dev/null +++ b/.idea/src/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/.idea/src/.gitignore b/.idea/src/.gitignore new file mode 100644 index 0000000..127c57c --- /dev/null +++ b/.idea/src/.gitignore @@ -0,0 +1 @@ +/search4file.class diff --git a/.idea/src/.project b/.idea/src/.project new file mode 100644 index 0000000..0f6f6a7 --- /dev/null +++ b/.idea/src/.project @@ -0,0 +1,17 @@ + + + src + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/.idea/src/search4file.java b/.idea/src/search4file.java new file mode 100644 index 0000000..a5642ef --- /dev/null +++ b/.idea/src/search4file.java @@ -0,0 +1,3 @@ +public class search4file { + +} diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..06312c0 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1518053793507 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Alex Kerr HW1/code/Lab2.iml b/Alex Kerr HW1/code/Lab2.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Alex Kerr HW1/code/Lab2.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Alex Kerr HW1/code/out/production/Lab2/Calculator.class b/Alex Kerr HW1/code/out/production/Lab2/Calculator.class new file mode 100644 index 0000000..da41268 Binary files /dev/null and b/Alex Kerr HW1/code/out/production/Lab2/Calculator.class differ diff --git a/Alex Kerr HW1/code/out/production/Lab2/GuessingGame.class b/Alex Kerr HW1/code/out/production/Lab2/GuessingGame.class new file mode 100644 index 0000000..875e4d5 Binary files /dev/null and b/Alex Kerr HW1/code/out/production/Lab2/GuessingGame.class differ diff --git a/Alex Kerr HW1/code/out/production/Lab2/JeffCode.class b/Alex Kerr HW1/code/out/production/Lab2/JeffCode.class new file mode 100644 index 0000000..264a7c7 Binary files /dev/null and b/Alex Kerr HW1/code/out/production/Lab2/JeffCode.class differ diff --git a/Alex Kerr HW1/code/out/production/Lab2/Problem1.class b/Alex Kerr HW1/code/out/production/Lab2/Problem1.class new file mode 100644 index 0000000..3e7b94a Binary files /dev/null and b/Alex Kerr HW1/code/out/production/Lab2/Problem1.class differ diff --git a/Alex Kerr HW1/code/out/production/Lab2/Problem2.class b/Alex Kerr HW1/code/out/production/Lab2/Problem2.class new file mode 100644 index 0000000..d7b4f53 Binary files /dev/null and b/Alex Kerr HW1/code/out/production/Lab2/Problem2.class differ diff --git a/Alex Kerr HW1/code/out/production/Lab2/Problem3.class b/Alex Kerr HW1/code/out/production/Lab2/Problem3.class new file mode 100644 index 0000000..8ad8953 Binary files /dev/null and b/Alex Kerr HW1/code/out/production/Lab2/Problem3.class differ diff --git a/Alex Kerr HW1/code/out/production/Lab2/Testing.class b/Alex Kerr HW1/code/out/production/Lab2/Testing.class new file mode 100644 index 0000000..9d95add Binary files /dev/null and b/Alex Kerr HW1/code/out/production/Lab2/Testing.class differ diff --git a/Alex Kerr HW1/code/src/Problem1.java b/Alex Kerr HW1/code/src/Problem1.java new file mode 100644 index 0000000..989eab7 --- /dev/null +++ b/Alex Kerr HW1/code/src/Problem1.java @@ -0,0 +1,86 @@ +import java.io.IOException; +import java.util.Scanner; + +/* I helped Dustin and skyler after was done with my code and they were just starting + because they had no clue where to start.*/ +/* i also talked to the guy behind me, i dont know his name though, before class on monday the 19th just trying to help his program to run because it was stuck because in his while loop he +he wasnt changing his test varible at all*/ + +public class Problem1 +{ + public static void main(String[] args) throws IOException + { + + int BunRun = 0; + int Zombie = 0; + int Boston = 0; + int Spartan = 0; + int Mud = 0; + + Scanner input = new Scanner(System.in); + System.out.println("how many file names are you going to enter? "); + Integer killNumber = Integer.parseInt(input.nextLine()); + for(int toKill = 0; toKill < killNumber; toKill++) + { +//i just talked to dustin and he now has a test that looks like mine, i did not just let him copy mine or show him mine at all, but he + // came up on the stuff on his own but with a little help + System.out.println("Please enter the next file name you want to test."); + String fileName = input.nextLine(); + if(fileName.contains("BunRun") && ! fileName.contains("Zombie") && !fileName.contains("Boston") && !fileName.contains("Spartan") && !fileName.contains("Mud")) + { + BunRun++; + System.out.println("yes this file: " + fileName + " was a BunRun run."); + } + else if(fileName.contains("Zombie") && ! fileName.contains("BunRun") && !fileName.contains("Boston") && !fileName.contains("Spartan") && !fileName.contains("Mud")) + { + Zombie++; + System.out.println("yes this file: " + fileName + " was a Zombie run."); + } + else if(fileName.contains("Boston") && ! fileName.contains("BunRun") && !fileName.contains("Zombie") && !fileName.contains("Spartan") && !fileName.contains("Mud")) + { + Boston++; + System.out.println("yes this file: " + fileName + " was a Boston run."); + } + else if(fileName.contains("Spartan") && ! fileName.contains("BunRun") && !fileName.contains("Boston") && !fileName.contains("Zombie") && !fileName.contains("Mud")) + { + Spartan++; + System.out.println("yes this file: " + fileName + " was a Spartan run."); + } + else if(fileName.contains("Mud") && ! fileName.contains("BunRun") && !fileName.contains("Boston") && !fileName.contains("Spartan") && !fileName.contains("Zombie")) + { + Mud++; + System.out.println("yes this file: " + fileName + " was a Mud run."); + } + /*else if(fileName.contains("done")) + { + toKill++; + System.out.println("There was a total number of these runs."); + System.out.println("BunRun: " + BunRun); + System.out.println("Zombie: " + Zombie); + System.out.println("Boston: " + Boston); + System.out.println("Spartan: " + Spartan); + System.out.println("Mud: " + Mud); + }*/ + else + { + System.out.println("ERROR, file name did not contain any of these runs. Please try again"); + } + + + } + System.out.println("There was a total number of these runs."); + System.out.println("BunRun: " + BunRun); + System.out.println("Zombie: " + Zombie); + System.out.println("Boston: " + Boston); + System.out.println("Spartan: " + Spartan); + System.out.println("Mud: " + Mud); + + + + + + + + + } +} diff --git a/Alex Kerr HW1/code/src/Problem2.java b/Alex Kerr HW1/code/src/Problem2.java new file mode 100644 index 0000000..f54c054 --- /dev/null +++ b/Alex Kerr HW1/code/src/Problem2.java @@ -0,0 +1,97 @@ +import java.io.IOException; +import java.util.Arrays; +import java.util.Scanner; + +public class Problem2 { + public static void main(String[] args) throws IOException { + + Scanner input = new Scanner(System.in); + System.out.println("what so you want the group max size to be?"); + int groupSize = input.nextInt(); + int toKill = 0; + int fullGroups = 0; + int leftOver = 0; + int error = 0; + + /* System.out.println("how many groups are you going to enter? "); + int length = input.nextInt(); */ + int[] numbers = data(); + /* + System.out.println("Please enter your data, special note if you enter a "); + System.out.println("group number that is greater 3 there will be an error, and i"); + System.out.println("make you restart. thank you now start"); + System.out.println("Please end your data set with a 0 to let me know your done :)"); */ + while( toKill < 1) + { + for(int i = 0; toKill < 1;) + { + if(numbers[i] > groupSize) + { + toKill++; + System.out.println("ERROR, sorry you entered a number greater then " + groupSize + ". Please try again"); + error++; + } + if(numbers[i] == 0) + { + toKill++; + } + if(numbers[i] == groupSize) + { + fullGroups++; + } + if (numbers[i] < groupSize) + { + leftOver = leftOver + numbers[i]; + } + i++; + + + } + toKill++; + } + if(error < 1) + { + System.out.println("You have " + fullGroups + " number of full groups of three in the class."); + System.out.println("There are " + leftOver + " left over students in the class."); + int possibleGroups = leftOver / groupSize; + int leftOutStudents = leftOver % groupSize; + System.out.println("You could possibly make " + possibleGroups + " more groups with the left over students"); + System.out.println("You would till have " + leftOutStudents + " of left out students"); + } + + } + + private static int[] data() { + int kill = 0; + System.out.println("input data"); + Scanner input = new Scanner(System.in); + int length = 1; + int num = 0; + int[] array1 = new int[length]; + array1[length -1] = input.nextInt(); + while(kill < 1 ) + { + if(array1[length - 1] != 0) + { + length++; + int[] array2 = new int[length]; + //make for loop copy content of 1 to 2, plus new input + for(int i = 0; i< length -1; i++) + { + array2[i] = array1[i]; + } + array2[length -1] = input.nextInt(); + array1 = array2; + //System.out.println(length); + //System.out.println(Arrays.toString(array1)); + //System.out.println(Arrays.toString(array2)); + } + if(array1[length -1] == 0) + { + kill++; + } + } + return array1; + } + +} diff --git a/Alex Kerr HW1/code/src/Problem3.java b/Alex Kerr HW1/code/src/Problem3.java new file mode 100644 index 0000000..230eb83 --- /dev/null +++ b/Alex Kerr HW1/code/src/Problem3.java @@ -0,0 +1,117 @@ +import javax.swing.plaf.basic.BasicInternalFrameTitlePane; +import java.io.IOException; +import java.util.Arrays; +import java.util.Scanner; + +public class Problem3 { + + public static void main(String[] args) throws IOException + { + + String[] names = data(); + String[] userNames = new String[names.length]; + String[] firstNames = new String[names.length]; + String[] lastNames = new String[names.length]; + String first = ""; + String last = ""; +// I made the variables above and for loop below to cut up the inputs into +// first names and last names + for(int i =0; i Character.toLowerCase(lastNameLetter)) + { + user = user + y.subSequence(c,y.length() + a - user.length()); + userNames[i] = user; + a = a + 9; + break; + } + else if(Character.toLowerCase(firstNameLetter) == Character.toLowerCase(lastNameLetter)) + { + user = user + firstNameLetter; + userNames[i] = user; + b++; + } + + } + } + + System.out.println(Arrays.toString(userNames)); + } + //This function deals with the input of data and makes input into an array + // of first and last names. and returns the array + private static String[] data() { + int kill =0; + System.out.println("how many names are you going to enter"); + Scanner input = new Scanner(System.in); + Integer killNumber = Integer.parseInt(input.nextLine()); + int length = 1; + int num = 0; + System.out.println("enter the names:"); + String[] array1 = new String[length]; + array1[length - 1] = input.nextLine(); + while (kill < 1) { + if (array1[length - 1] != "") { + length++; + String[] array2 = new String[length]; + //make for loop copy content of 1 to 2, plus new input + for (int i = 0; i < length - 1; i++) { + array2[i] = array1[i]; + } + array2[length - 1] = input.nextLine(); + array1 = array2; + //System.out.println(length); + //System.out.println(Arrays.toString(array1)); + //System.out.println(Arrays.toString(array2)); + } + if (length== killNumber) { + kill++; + } + } + return array1; + } +} diff --git a/Alex Kerr HW1/problem1/aswers to test files/answers to test files.txt b/Alex Kerr HW1/problem1/aswers to test files/answers to test files.txt new file mode 100644 index 0000000..bab5301 --- /dev/null +++ b/Alex Kerr HW1/problem1/aswers to test files/answers to test files.txt @@ -0,0 +1,10 @@ +2018_BunRun_run_first_place_gold +Zombie_run_ill_record_2011 +Mud_Spartan_runs_2017_fun +Boston_maration_omaha_notepad_1_bc +Bun_Run_Run_Bun_3000_last_place + +answers: +2018_BunRun_run_first_place_gold +Zombie_run_ill_record_2011 +Boston_maration_omaha_notepad_1_bc \ No newline at end of file diff --git a/Alex Kerr HW1/problem1/test files/test files.txt b/Alex Kerr HW1/problem1/test files/test files.txt new file mode 100644 index 0000000..e0f0b68 --- /dev/null +++ b/Alex Kerr HW1/problem1/test files/test files.txt @@ -0,0 +1,5 @@ +2018_BunRun_run_first_place_gold +Zombie_run_ill_record_2011 +Mud_Spartan_runs_2017_fun +Boston_maration_omaha_notepad_1_bc +Bun_Run_Run_Bun_3000_last_place \ No newline at end of file diff --git a/Alex Kerr HW1/problem2/answers to tests/answers to tests.txt b/Alex Kerr HW1/problem2/answers to tests/answers to tests.txt new file mode 100644 index 0000000..f310394 --- /dev/null +++ b/Alex Kerr HW1/problem2/answers to tests/answers to tests.txt @@ -0,0 +1,49 @@ +5 +4 4 3 5 5 2 4 5 2 3 +2 +3 4 4 +2 +4 0 + +3 full groups +41 left over +8 more possible groups +1 left out + + +3 +2 +3 2 1 2 3 2 1 2 3 0 + +3 full groups +12 left over +4 more possible groups +0 left out + + +2 +1 2 1 2 1 2 1 2 1 2 1 1 1 1 0 + +5 full groups +9 left over +4 more possible groups +1 left out + + + +7 +1 2 3 4 5 6 7 7 6 5 4 3 2 1 0 + +2 full groups +42 left over +6 more possible groups +0 left over + +14 +7 7 7 7 7 14 13 18 0 + +error, no group over 14 + + + + diff --git a/Alex Kerr HW1/problem2/tests examples/test examples.txt b/Alex Kerr HW1/problem2/tests examples/test examples.txt new file mode 100644 index 0000000..1dbaf2e --- /dev/null +++ b/Alex Kerr HW1/problem2/tests examples/test examples.txt @@ -0,0 +1,25 @@ +5 +4 4 3 5 5 2 4 5 2 3 +2 +3 4 4 +2 +4 0 + + +3 +2 +3 2 1 2 3 2 1 2 3 0 + +2 +1 2 1 2 1 2 1 2 1 2 1 1 1 1 0 + + +7 +1 2 3 4 5 6 7 7 6 5 4 3 2 1 0 + +14 +7 7 7 7 7 14 13 18 0 + + + + diff --git a/Alex Kerr HW1/problem3/answers to tests/answers to tests.txt b/Alex Kerr HW1/problem3/answers to tests/answers to tests.txt new file mode 100644 index 0000000..90103e1 --- /dev/null +++ b/Alex Kerr HW1/problem3/answers to tests/answers to tests.txt @@ -0,0 +1,38 @@ +3 +Alex Kerr +Dustin Monroe +Skyler Galloway + +AlexKerr, DMonroe, SGalloway + +3 +darth maul +Creighton Schoning +jaba hut + +damaul, creighschoning, jabahut + +3 +jakob hall +austin hall +steven kerr + +jahall, ahall, skerr + +3 +obiwan kenobi +boba fett +han solo + +obikenobi, bobafett, hansolo + +4 +Adam Kerr +Samantha Kerr +Debborh Kerr +Billy Jo + +adamkerr, sakerr, debbkerr, billyjo + + + diff --git a/Alex Kerr HW1/problem3/test examples/test examples.txt b/Alex Kerr HW1/problem3/test examples/test examples.txt new file mode 100644 index 0000000..04d8f04 --- /dev/null +++ b/Alex Kerr HW1/problem3/test examples/test examples.txt @@ -0,0 +1,27 @@ +3 +Alex Kerr +Dustin Monroe +Skyler Galloway + +2 +Jeff Ifland +Creighton Schoning + +5 +Luke skywalker +Anakin Skywalker +kylo Ren +leia organa +padme amidala + +3 +obiwan kenobi +boba fett +han solo + +4 +captain phasma +ahsoka tano +general grievous +clone trooper + diff --git a/HW1.iml b/HW1.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/HW1.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Helped Code .txt b/Helped Code .txt new file mode 100644 index 0000000..0aaeeca --- /dev/null +++ b/Helped Code .txt @@ -0,0 +1,70 @@ +import.java.util.Scanner; + +public class fileScanner { + public static void main(String args[]) { + + Scanner reader = new Scanner(System.in); // Reading from System.in +System.out.println("Enter a number: "); +int n = reader.nextInt(); // Scans the next token of the input as an int. +//once finished +reader.close(); + + // start + int number, steps = 0; + + // read a number + Scanner input = new Scanner (System.in); + number = input.nextInt(); + boolean = numberNotEqualToOne = (number != 1) + + + // if number == 1 print the number of steps + while (numberNotEqualToOne ) + { + + if (number == 1) + { + numberNotEqualToOne = false; + + System.out.pringln( "It took " + steps + " steps to get to 1 for the number " + number); + + } + + // else + else + { + steps = steps + 1 + int tempNumber = 1; + boolean isDivisibleBy2 = false; + + + // this while loop if the number is divisible by 2 + while ( tempNumber * 2 != number && tempnumber < number) + { + tempNumber = tempNumber + 1; + if (tempNumber * 2 == number) + { + isDivisibleBy2 = true; + } + } + + // if the number is a multiple of 2 + if ( isDivisibleBy2 ) + { + //divide the number by 2 + number = number/2; + + } + + // else + else + { + //multiply number by 3 and add 1 + number = number * 3 + 1; + } + } + + // loop up to the first if + + } +} diff --git a/Jackson Maschman/LabHW1/.idea/misc.xml b/Jackson Maschman/LabHW1/.idea/misc.xml new file mode 100644 index 0000000..0548357 --- /dev/null +++ b/Jackson Maschman/LabHW1/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Jackson Maschman/LabHW1/.idea/modules.xml b/Jackson Maschman/LabHW1/.idea/modules.xml new file mode 100644 index 0000000..55e8a03 --- /dev/null +++ b/Jackson Maschman/LabHW1/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Jackson Maschman/LabHW1/.idea/workspace.xml b/Jackson Maschman/LabHW1/.idea/workspace.xml new file mode 100644 index 0000000..c07a58a --- /dev/null +++ b/Jackson Maschman/LabHW1/.idea/workspace.xml @@ -0,0 +1,427 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519095882511 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Jared Pohlmann/HW1/HW1 Problem 2/HW1 Problem 2.iml b/Jared Pohlmann/HW1/HW1 Problem 2/HW1 Problem 2.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Jared Pohlmann/HW1/HW1 Problem 2/HW1 Problem 2.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Jared Pohlmann/HW1/HW1 Problem 2/out/production/HW1 Problem 2/JaredPohlmann.class b/Jared Pohlmann/HW1/HW1 Problem 2/out/production/HW1 Problem 2/JaredPohlmann.class new file mode 100644 index 0000000..46fa788 Binary files /dev/null and b/Jared Pohlmann/HW1/HW1 Problem 2/out/production/HW1 Problem 2/JaredPohlmann.class differ diff --git a/Jared Pohlmann/HW1/HW1 Problem 2/src/JaredPohlmann.java b/Jared Pohlmann/HW1/HW1 Problem 2/src/JaredPohlmann.java new file mode 100644 index 0000000..537fb9f --- /dev/null +++ b/Jared Pohlmann/HW1/HW1 Problem 2/src/JaredPohlmann.java @@ -0,0 +1,45 @@ +import java.util.Scanner; +import java.lang.*; +import java.util.*; +public class JaredPohlmann { + + + public static void main(String[] args) { + Scanner scan = new Scanner(System.in); + int scanInt = scan.nextInt(); + int numberOfGroups = 0; + int[] array = new int[100]; + int numberOf2 = 0; + int numberOf1 = 0; + int StudentsNoGroup = 0; + int arrayIndex = 0; + + for (int k = 0; scanInt>0 ; k++) { + array[k] = scanInt; + arrayIndex+=1; + scanInt = scan.nextInt(); + + + } + for (int j = 0; j < arrayIndex; j++) { + if (array[j] == 3) { + numberOfGroups += 1; + } else if (array[j] == 2) { + numberOf2 += 1; + } else { + numberOf1 += 1; + } + } + if (numberOf2 - numberOf1 > 0) { + StudentsNoGroup += 2 * (numberOf2 - numberOf1); + } else { + StudentsNoGroup += numberOf1 - numberOf2; + } + if (numberOf2 < numberOf1) { + numberOfGroups += numberOf2; + } else { + numberOfGroups += numberOf1; + } + System.out.println(numberOfGroups + " full groups can be formed, and " + StudentsNoGroup + " students will still need a group." ); + } +} diff --git a/Jared Pohlmann/HW1/HW1 Problem 3/.idea/misc.xml b/Jared Pohlmann/HW1/HW1 Problem 3/.idea/misc.xml new file mode 100644 index 0000000..a70362b --- /dev/null +++ b/Jared Pohlmann/HW1/HW1 Problem 3/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Jared Pohlmann/HW1/HW1 Problem 3/.idea/modules.xml b/Jared Pohlmann/HW1/HW1 Problem 3/.idea/modules.xml new file mode 100644 index 0000000..f75c691 --- /dev/null +++ b/Jared Pohlmann/HW1/HW1 Problem 3/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Jared Pohlmann/HW1/HW1 Problem 3/.idea/workspace.xml b/Jared Pohlmann/HW1/HW1 Problem 3/.idea/workspace.xml new file mode 100644 index 0000000..3e1ba73 --- /dev/null +++ b/Jared Pohlmann/HW1/HW1 Problem 3/.idea/workspace.xml @@ -0,0 +1,323 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519262653237 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + file://$PROJECT_DIR$/src/JaredPohlmann.java + 45 + + + + file://$PROJECT_DIR$/src/JaredPohlmann.java + 46 + + + + file://$PROJECT_DIR$/src/JaredPohlmann.java + 47 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Jared Pohlmann/HW1/HW1 Problem 3/HW1 Problem 3.iml b/Jared Pohlmann/HW1/HW1 Problem 3/HW1 Problem 3.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Jared Pohlmann/HW1/HW1 Problem 3/HW1 Problem 3.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Jared Pohlmann/HW1/HW1 Problem 3/out/production/HW1 Problem 3/JaredPohlmann.class b/Jared Pohlmann/HW1/HW1 Problem 3/out/production/HW1 Problem 3/JaredPohlmann.class new file mode 100644 index 0000000..b47eda1 Binary files /dev/null and b/Jared Pohlmann/HW1/HW1 Problem 3/out/production/HW1 Problem 3/JaredPohlmann.class differ diff --git a/Jared Pohlmann/HW1/HW1 Problem 3/src/JaredPohlmann.java b/Jared Pohlmann/HW1/HW1 Problem 3/src/JaredPohlmann.java new file mode 100644 index 0000000..6b69125 --- /dev/null +++ b/Jared Pohlmann/HW1/HW1 Problem 3/src/JaredPohlmann.java @@ -0,0 +1,52 @@ +import java.util.Scanner; +import java.lang.*; + +public class JaredPohlmann { + public static void main(String[] args) { + System.out.println("How many user names need to be created?"); + Scanner scan = new Scanner(System.in); + int inputNum = Integer.parseInt(scan.nextLine()); + String name = scan.next(); + name=name.toLowerCase(); + char[] firstName= new char[8]; + char[] lastName= new char[8]; + char[] userNames= new char [8]; + char[] firstNameHold; + char [] lastNameHold; + + while (inputNum > 0) { + firstNameHold = name.toCharArray(); + for(int m=0; mlastName[0]|| firstName[j]== 0){ + for (int i = 0; i < j; i++){ + userNames[i]=firstName[i]; + } + for(int z = 0; z<8-j && z< lastNameHold.length; z++){ + userNames[z+j]=lastName[z]; + } + break outerloop; + } + + + } + System.out.println(userNames); + inputNum--; + name = scan.next(); + name =name.toLowerCase(); + firstName= new char[8]; + lastName= new char[8]; + userNames= new char [8]; + + } + } +} diff --git a/Jared Pohlmann/HW1/Test Cases b/Jared Pohlmann/HW1/Test Cases new file mode 100644 index 0000000..b002565 --- /dev/null +++ b/Jared Pohlmann/HW1/Test Cases @@ -0,0 +1,8 @@ +Test Cases +Problem 1: Select the number of inputs. I want to make sure 5 lines work. +I input BunRun, Mud1234, zombee, murk, and 2019Spartan. + + +Problem 2: I made a list of integers 1 2 3 3 2 1 1 0. I also made the same sequence vertically. I repeated this step for the sequences 1 1 0, 1 1 0, 3 3 3 3 0, and 3 3 3 0. + +Problem 3: I decided to select 5 usernames. I used Jared Pohlmann, Ashton Oak, aaa bbb, tttt jjjj, and Jeff Ifland. diff --git a/Jared Pohlmann/HW1/Test Cases Answered b/Jared Pohlmann/HW1/Test Cases Answered new file mode 100644 index 0000000..1ad9ebc --- /dev/null +++ b/Jared Pohlmann/HW1/Test Cases Answered @@ -0,0 +1,12 @@ +Test Cases Answered + +Problem 1: When run, my test cases proved to work where BunRun, Mud1234, and 2019Spartan were shown. Zombee and murk did not work since it is not on the list as expected. + +Problem 2: For the first sequence I got 4 groups with 1 person left out. This was expected and it worked verticallly as well. The next case I got 0 groups with 2 left over as expected. Then the next I got 0 groups with 1 left over. Then 4 groups with 0 left over. Finaly I got 3 groups with 0 left over. + +Problem 3: For my name I got japohlma. This is what I expected. + +Ashton Oak= aoak +aaa bbb= aaabbb +tttt jjjj = tjjjj +jeff ifland = jeffifla \ No newline at end of file diff --git a/Jeff V submit files Folder/Problem 1 Code.txt b/Jeff V submit files Folder/Problem 1 Code.txt new file mode 100644 index 0000000..4c067f0 --- /dev/null +++ b/Jeff V submit files Folder/Problem 1 Code.txt @@ -0,0 +1,57 @@ +import.java.util.Scanner; + +public class fileScanner { + public static void main(String args[]) { + + + int numberOfFiles; + String fileName; + + Scanner input = new Scanner(System.in); + numberOfFiles = input.nextInt(); + + input.nextLine(); // get rid of remaining line after the number + + //loop through a list of files + for(int i = 0; i < numberOfFiles; i = i + 1) + { + int numberOfStingsFound = 0; + + fileName = input.nextLine(); + //test how many of the strings are in the file name + + if (fileName.contains("Mud")) + { + numberOfStingsFound = numberOfStingsFound + 1; + } + if (fileName.contains("BunRun")) + { + numberOfStingsFound = numberOfStingsFound + 1; + } + if (fileName.contains("Zombie")) + { + numberOfStingsFound = numberOfStingsFound + 1; + } + if (fileName.contains("Boston")) + { + numberOfStingsFound = numberOfStingsFound + 1; + } + if (fileName.contains("Spartan")) + { + numberOfStingsFound = numberOfStingsFound + 1; + + } + + + // if exactly one of them is + { + if (numberOfStingsFound == 1) + { + System.out.println(fileName); + } + //print out the strings + } + } + + } +} \ No newline at end of file diff --git a/Jeff V submit files Folder/Problem 1 Input.txt b/Jeff V submit files Folder/Problem 1 Input.txt new file mode 100644 index 0000000..cd14c8b --- /dev/null +++ b/Jeff V submit files Folder/Problem 1 Input.txt @@ -0,0 +1,5 @@ +4 +BunRun_is_Fun +Spartan_Mud_Marathon +Boston_runtime_environment +ZombieTime_is_now \ No newline at end of file diff --git a/Jeff V submit files Folder/Problem 1 Output.txt b/Jeff V submit files Folder/Problem 1 Output.txt new file mode 100644 index 0000000..ea8ded5 --- /dev/null +++ b/Jeff V submit files Folder/Problem 1 Output.txt @@ -0,0 +1,3 @@ +BunRun_is_Fun +Boston_runtime_environment +ZombieTime_is_now \ No newline at end of file diff --git a/Jeff V submit files Folder/Problem 2 Code.txt b/Jeff V submit files Folder/Problem 2 Code.txt new file mode 100644 index 0000000..0ce89f1 --- /dev/null +++ b/Jeff V submit files Folder/Problem 2 Code.txt @@ -0,0 +1,66 @@ +import java.util.Scanner; + +public class Problem2 { + public static void main(String args[]) { + //Piia helped me out by recommending against using arrays and using number totals instead + int workingNumber; + int numberOf2s = 0; + int numberOf1s = 0; + int numberOfGroups = 0; + //pull the stuff from the teacher + Scanner input = new Scanner(System.in); + workingNumber = input.nextInt(); + + //this while sorts all the groups + while (workingNumber != 0 ) + { + if (workingNumber == 3) { + numberOfGroups++; + } + + else if ( workingNumber == 1 ){ + numberOf1s++; + } + + else if ( workingNumber == 2 ) { + numberOf2s++; + } + + else if (workingNumber >= 4) { + System.out.print("Someone made a group too big"); + } + workingNumber = input.nextInt(); + } + + if (numberOf1s > numberOf2s) { + numberOfGroups = numberOfGroups + numberOf2s; + numberOf1s = numberOf1s - numberOf2s; + numberOf2s = 0; + } + else if (numberOf1s < numberOf2s){ + numberOfGroups = numberOfGroups + numberOf1s; + numberOf2s = numberOf2s - numberOf1s; + numberOf1s = numberOf1s - numberOf1s; //NUMBER OF OOOOOONNNNEEESSSSSSSS!!!!!!!! + } + + if (numberOf1s / 3 >= 1){ + numberOfGroups = numberOfGroups + (numberOf1s / 3); + numberOf1s = numberOf1s - numberOf1s / 3; + } + + System.out.println( numberOfGroups + " full groups can be formed, and " + (numberOf2s * 2 + numberOf1s) + " students will still need a group, excluding" + + " the group thats too big." ); + //number of threes added to the number of groups + + //how many 1s and 2s are there? + + + //is the number of 1's more than 3? combine them + + + // are there pairable 1s and 2s + + + + } +} diff --git a/Jeff V submit files Folder/Problem 2 Input.txt b/Jeff V submit files Folder/Problem 2 Input.txt new file mode 100644 index 0000000..6f4e0d8 --- /dev/null +++ b/Jeff V submit files Folder/Problem 2 Input.txt @@ -0,0 +1 @@ +2 2 2 1 3 1 2 3 3 1 2 4 2 0 \ No newline at end of file diff --git a/Jeff V submit files Folder/Problem 2 Output.txt b/Jeff V submit files Folder/Problem 2 Output.txt new file mode 100644 index 0000000..115f367 --- /dev/null +++ b/Jeff V submit files Folder/Problem 2 Output.txt @@ -0,0 +1,2 @@ +Someone made a group that's too big. 6 full groups can be formed, and 6 students will still need a group, excluding +the too big group. \ No newline at end of file diff --git a/Jeff V submit files Folder/Problem 3 Code.txt b/Jeff V submit files Folder/Problem 3 Code.txt new file mode 100644 index 0000000..8badd01 --- /dev/null +++ b/Jeff V submit files Folder/Problem 3 Code.txt @@ -0,0 +1,40 @@ +import java.util.Scanner; + +public class Problem3 { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + + int numberOfNames = sc.nextInt(); + + + for (int i = 0; i < numberOfNames; i++) { + String firstName = sc.next(); + firstName = firstName.toLowerCase(); + String userName = ""; + int firstNameLength = firstName.length(); + String lastName = sc.next(); + lastName = lastName.toLowerCase(); + int lastNameLength = lastName.length(); + boolean onLastName = false; + + int lastNameLetter = 0; + + for (int a = 0; a < 8 ; a++) { + + + if (a < firstNameLength && firstName.charAt(a) <= lastName.charAt(0) && !onLastName) + { + userName = userName + firstName.charAt(a); + } + else if (lastNameLetter < lastNameLength) + { + userName = userName + lastName.charAt(lastNameLetter); + onLastName = true; + lastNameLetter++; + } + } + System.out.println(userName); + } + } +} diff --git a/Jeff V submit files Folder/Problem 3 Input.txt b/Jeff V submit files Folder/Problem 3 Input.txt new file mode 100644 index 0000000..49d1e06 --- /dev/null +++ b/Jeff V submit files Folder/Problem 3 Input.txt @@ -0,0 +1,5 @@ +4 +aabbccdd abcdefghi +aaabbbcccddd abcdef +dcba ddccbbaa +ddccbbbbAAAAAAAAAAAAHHHHHHHH! \ No newline at end of file diff --git a/Jeff V submit files Folder/Problem 3 Output.txt b/Jeff V submit files Folder/Problem 3 Output.txt new file mode 100644 index 0000000..96527af --- /dev/null +++ b/Jeff V submit files Folder/Problem 3 Output.txt @@ -0,0 +1,4 @@ +aaabcdef +aaaabcde +dcddccbb +zddccbbb \ No newline at end of file diff --git a/SkylarGalloway/.idea/workspace.xml b/SkylarGalloway/.idea/workspace.xml new file mode 100644 index 0000000..fbc8620 --- /dev/null +++ b/SkylarGalloway/.idea/workspace.xml @@ -0,0 +1,267 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519438160044 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No facets are configured + + + + + + + + + + + + + + + 1.8 + + + + + + + + Problem_Two + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SkylarGalloway/Problem 2/Problem_Two/Problem_Two.iml b/SkylarGalloway/Problem 2/Problem_Two/Problem_Two.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/SkylarGalloway/Problem 2/Problem_Two/Problem_Two.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/SkylarGalloway/Problem 2/Problem_Two/out/production/Problem_Two/.idea/misc.xml b/SkylarGalloway/Problem 2/Problem_Two/out/production/Problem_Two/.idea/misc.xml new file mode 100644 index 0000000..99ae653 --- /dev/null +++ b/SkylarGalloway/Problem 2/Problem_Two/out/production/Problem_Two/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SkylarGalloway/Problem 2/Problem_Two/out/production/Problem_Two/.idea/modules.xml b/SkylarGalloway/Problem 2/Problem_Two/out/production/Problem_Two/.idea/modules.xml new file mode 100644 index 0000000..f669a0e --- /dev/null +++ b/SkylarGalloway/Problem 2/Problem_Two/out/production/Problem_Two/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/SkylarGalloway/Problem 2/Problem_Two/out/production/Problem_Two/.idea/src.iml b/SkylarGalloway/Problem 2/Problem_Two/out/production/Problem_Two/.idea/src.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/SkylarGalloway/Problem 2/Problem_Two/out/production/Problem_Two/.idea/src.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/SkylarGalloway/Problem 2/Problem_Two/out/production/Problem_Two/.idea/workspace.xml b/SkylarGalloway/Problem 2/Problem_Two/out/production/Problem_Two/.idea/workspace.xml new file mode 100644 index 0000000..340e94d --- /dev/null +++ b/SkylarGalloway/Problem 2/Problem_Two/out/production/Problem_Two/.idea/workspace.xml @@ -0,0 +1,257 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519863472067 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SkylarGalloway/Problem 2/Problem_Two/src/bonusGrouping.java b/SkylarGalloway/Problem 2/Problem_Two/src/bonusGrouping.java new file mode 100644 index 0000000..e1ed469 --- /dev/null +++ b/SkylarGalloway/Problem 2/Problem_Two/src/bonusGrouping.java @@ -0,0 +1,50 @@ +//Alex Kerr helped explain a way to achieve the bonus +/*Input for bonus code +max number in group: 4 +1 2 3 4 0 +max number in group: 5 +5 5 5 5 4 0 +max number in group: 3 +1 1 1 1 1 1 1 1 1 1 0 + +max number in group: 7 +1 2 3 2 3 4 4 7 0 + +max number in group: 9 +1 2 3 4 5 6 7 9 0 + +max number in group:5 +1 2 3 4 4 5 0*/ +import java.util.Scanner; + +public class bonusGrouping { + public static void main(String[]args){ + Scanner num = new Scanner(System.in); //input number of files + System.out.println("Max group size: "); + int nUm = num.nextInt(); + + int givenData=1; + int sumGivendata=0; + Scanner groupData = new Scanner(System.in); + for (int i = 0; givenData>0; i++){ + System.out.println("Enter number of people in group"); + givenData = groupData.nextInt(); + sumGivendata+= givenData; + + System.out.println(sumGivendata+" this is sum"); + + + } + + int groupNum = sumGivendata/nUm; + int leftover=sumGivendata %nUm; //Dustin Monroe gave me the code to compute the remainder + if(leftover==0){ + System.out.println(groupNum + " full groups can be formed, and no students will still need a group"); + + } + else{ + System.out.println(groupNum + " full groups can be formed, and " +leftover +" students will still need a group"); + } + } + +} diff --git a/SkylarGalloway/Problem 2/Problem_Two/src/grouping.java b/SkylarGalloway/Problem 2/Problem_Two/src/grouping.java new file mode 100644 index 0000000..4735835 --- /dev/null +++ b/SkylarGalloway/Problem 2/Problem_Two/src/grouping.java @@ -0,0 +1,82 @@ +/*Input for nonbonus code: + +1 2 2 2 0 +3 3 3 3 3 3 1 0 +3 2 2 2 1 0 +1 1 1 2 0 +1 3 3 3 3 0 +1 1 1 3 0 +*/ +import java.util.Scanner; +public class grouping { + public static void main(String[]args){ + int numOne=0; + int numTwo =0; + int numThree=0 ; + int givenData=1; + Scanner groupData = new Scanner(System.in); + for (int i = 0; givenData>0; i++) {//do not know how to start for loop and to end at 0 + System.out.println("Enter number of people in group"); + givenData = groupData.nextInt(); + if (givenData == 1) { + numOne = numOne + 1; + } else if (givenData == 2) { + numTwo = numTwo + 1; + } else if(givenData==3) { + numThree = numThree + 1; + } + // System.out.println("one is "+numOne + " two is "+numTwo+" three is "+numThree); + } + //int group1 = numOne-1;//this is done to nullify the fact that I had to use givenData =1 to intialize the for loop + // System.out.println("one is "+group1); NOT NEEDED + + int fullGroups= 0; + int leftOver =0; + int oneLeftover=0; + int oneGroups = 0; // used to combine groups of (1 1 1) if need be + int onesTrueleftover=0; // used to combine groups of (1 1 1) if need be + + if(numOne==numTwo){ + fullGroups = numOne; + } + else if(numOne>numTwo){ + fullGroups = numTwo; + oneLeftover = numOne-numTwo; // used to combine groups of (1 1 1) if need be + //oneLeftover=leftOver; + } + else{ + fullGroups = numOne; + leftOver = 2*(numTwo-numOne); + } + if(oneLeftover>2){ // used to combine groups of (1 1 1) if need be + oneGroups = oneLeftover/3; // used to combine groups of (1 1 1) if need be + onesTrueleftover=oneLeftover %3; // used to combine groups of (1 1 1) if need be + } + else{ // used to combine groups of (1 1 1) if need be + onesTrueleftover=oneLeftover; + } + + int totalGroup=numThree+fullGroups+oneGroups; + int trueLeftovers= leftOver+onesTrueleftover; + if(leftOver==0) { + if (trueLeftovers == 0){ + System.out.println(totalGroup + " full groups can be formed, and no students will still need a group"); + } + else{ + System.out.println(totalGroup + " full groups can be formed, and " +trueLeftovers+ " students will still need a group"); + + } + } + else{ + System.out.println(totalGroup + " full groups can be formed, and " + trueLeftovers+ " students will still need a group"); + //System.out.println(numOne+" =group one "+ numTwo+" group two"); + System.out.println(oneGroups+" = group one formed that many "+ onesTrueleftover+" = there are this many leftover "+ trueLeftovers +" this is the leftover taking into account 1 1 1 " + + leftOver + "= his runs through original leftover" ); + + + } + + } + + +} diff --git a/SkylarGalloway/Problem 2/Test output.txt b/SkylarGalloway/Problem 2/Test output.txt new file mode 100644 index 0000000..03ce443 --- /dev/null +++ b/SkylarGalloway/Problem 2/Test output.txt @@ -0,0 +1,17 @@ +Output Non bonus +1 full groups can be formed, and 4 students will still need a group + +6 full groups can be formed, and 1 students will still need a group + +2 full groups can be formed, and 4 students will still need a group + +1 full groups can be formed, and 2 students will still need a group + +4 full groups can be formed, and 1 students will still need a group + +for input 1 1 1 3 0 + 1 full groups can be formed, and 3 students will still need a group +This is an issue because there can be 2 full groups formed ***. + +2 full groups can be formed, and no students will still need a group + ***fixed this issue \ No newline at end of file diff --git a/SkylarGalloway/Problem 2/test input.txt b/SkylarGalloway/Problem 2/test input.txt new file mode 100644 index 0000000..71945bc --- /dev/null +++ b/SkylarGalloway/Problem 2/test input.txt @@ -0,0 +1,25 @@ +Input for nonbonus code: + +1 2 2 2 0 +3 3 3 3 3 3 1 0 +3 2 2 2 1 0 +1 1 1 2 0 +1 3 3 3 3 0 +1 1 1 3 0 + +Input for bonus code +max number in group: 4 +1 2 3 4 0 +max number in group: 5 +5 5 5 5 4 0 +max number in group: 3 +1 1 1 1 1 1 1 1 1 1 0 + +max number in group: 7 +1 2 3 2 3 4 4 7 0 + +max number in group: 9 +1 2 3 4 5 6 7 9 0 + +max number in group:5 +1 2 3 4 4 5 0 \ No newline at end of file diff --git a/SkylarGalloway/Problem 3/.idea/misc.xml b/SkylarGalloway/Problem 3/.idea/misc.xml new file mode 100644 index 0000000..0548357 --- /dev/null +++ b/SkylarGalloway/Problem 3/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/SkylarGalloway/Problem 3/.idea/modules.xml b/SkylarGalloway/Problem 3/.idea/modules.xml new file mode 100644 index 0000000..34621e3 --- /dev/null +++ b/SkylarGalloway/Problem 3/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/SkylarGalloway/Problem 3/.idea/workspace.xml b/SkylarGalloway/Problem 3/.idea/workspace.xml new file mode 100644 index 0000000..fecdfd2 --- /dev/null +++ b/SkylarGalloway/Problem 3/.idea/workspace.xml @@ -0,0 +1,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519707833283 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No facets are configured + + + + + + + + + + + + + + + 1.8 + + + + + + + + Problem 1 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Yesenia/Problem 1/Problem 1.iml b/Yesenia/Problem 1/Problem 1.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Yesenia/Problem 1/Problem 1.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Yesenia/Problem 1/src/Problem1.java b/Yesenia/Problem 1/src/Problem1.java new file mode 100644 index 0000000..2f0a082 --- /dev/null +++ b/Yesenia/Problem 1/src/Problem1.java @@ -0,0 +1,59 @@ +//This ran at one point but now it won't open as a java file (at least on my computer) we had this problem before// + +import java.util.Scanner; + +public class Problem1 { + public static void main(String args[]) { + + int AmountOfFiles; + String fileName; + + Scanner input = new Scanner(System.in); + AmountOfFiles = input.nextInt(); + + input.nextLine(); // get rid of remaining line after the number + +//loop through a list of files + for(int i = 0; i < AmountOfFiles; i = i + 1) + { + int StringsFound = 0; + + fileName = input.nextLine(); +//test how many of the strings are in the file name + + if (fileName.contains("Spartan")) + { + StringsFound = StringsFound + 1; + } + if (fileName.contains("BunRun")) + { + StringsFound = StringsFound + 1; + } + if (fileName.contains("Boston")) + { + StringsFound = StringsFound + 1; + } + if (fileName.contains("Zombie")) + { + StringsFound = StringsFound + 1; + } + if (fileName.contains("Mud")) + { + StringsFound = StringsFound + 1; + + } + + +// if exactly one of them is + { + if (StringsFound == 1) + { + System.out.println(fileName); + } +//print out the strings + } + } + + } +} +// I WORKED ON THIS WITH ALEX, SHANE, AND JACOB \ No newline at end of file diff --git a/Yesenia/Problem 1_test files.txt b/Yesenia/Problem 1_test files.txt new file mode 100644 index 0000000..6a72a62 --- /dev/null +++ b/Yesenia/Problem 1_test files.txt @@ -0,0 +1,8 @@ +Test Files::: + +5 +2017_MUd_race.exc +Zombie-will-kill.pdf +BunRun_is_better_than_Spartan.doc +This_is_SpArtA.jpeg + diff --git a/Yesenia/Problem 2/.idea/misc.xml b/Yesenia/Problem 2/.idea/misc.xml new file mode 100644 index 0000000..0548357 --- /dev/null +++ b/Yesenia/Problem 2/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Yesenia/Problem 2/.idea/modules.xml b/Yesenia/Problem 2/.idea/modules.xml new file mode 100644 index 0000000..4b7dd62 --- /dev/null +++ b/Yesenia/Problem 2/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Yesenia/Problem 2/.idea/workspace.xml b/Yesenia/Problem 2/.idea/workspace.xml new file mode 100644 index 0000000..de88c64 --- /dev/null +++ b/Yesenia/Problem 2/.idea/workspace.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519708275720 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Yesenia/Problem 3/Problem 3.iml b/Yesenia/Problem 3/Problem 3.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Yesenia/Problem 3/Problem 3.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Yesenia/Problem 3/src/Problem3.java b/Yesenia/Problem 3/src/Problem3.java new file mode 100644 index 0000000..06fea7d --- /dev/null +++ b/Yesenia/Problem 3/src/Problem3.java @@ -0,0 +1,55 @@ +import java.util.Scanner; + +public class Problem3 { + public static void main(String args[]) { + String names = ""; + Scanner input = new Scanner(System.in); + int NumberOfNames = 0; + NumberOfNames = Integer.parseInt(input.nextLine()); + + for(int i = 0; i < NumberOfNames; i++) + { + names = input.nextLine(); + String first = names.substring(0,names.indexOf(" ")); + String last = names.substring(names.indexOf(" ") + 1, names.length()); + + if(first.length() + last.length() <= 8) + { + System.out.println(first + last); + } + else if(names.length() > 8) + { + String ans = "" + first.charAt(0); + int x = 0; + int y = 1; + for(int j = 1; j<= 7; j++) { + if (j>= last.length()|| j>=first.length()) + { + if(ans.length() < 8) + { + //I get the rest of this problem but I dont know how to add the rest of the last name to the + //user name when i run out of letters in the first name + } + break; + } + else if(Character.toLowerCase(first.charAt(y)) <= Character.toLowerCase(last.charAt(x))) + { + String add = "" + first.charAt(y); + ans = ans.concat(add); + y = y + 1; + + } + else if(Character.toLowerCase(first.charAt(y)) >= Character.toLowerCase(last.charAt(x))) + { + String add = "" + last.charAt(x); + ans = ans.concat(add); + x = x + 1; + } + } + System.out.println(ans); + } + + } + } +} +//I WORKED ON THIS WITH SHANE, JACOB, ALEX \ No newline at end of file diff --git a/bkeller/Problem1/.idea/misc.xml b/bkeller/Problem1/.idea/misc.xml new file mode 100644 index 0000000..4c1c37a --- /dev/null +++ b/bkeller/Problem1/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/bkeller/Problem1/.idea/modules.xml b/bkeller/Problem1/.idea/modules.xml new file mode 100644 index 0000000..b27bc32 --- /dev/null +++ b/bkeller/Problem1/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/bkeller/Problem1/.idea/workspace.xml b/bkeller/Problem1/.idea/workspace.xml new file mode 100644 index 0000000..2fe5910 --- /dev/null +++ b/bkeller/Problem1/.idea/workspace.xml @@ -0,0 +1,379 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519698467848 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No facets are configured + + + + + + + + + + + + + + + 1.8 + + + + + + + + Problem2 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bkeller/Problem2/Problem2/Problem2.iml b/bkeller/Problem2/Problem2/Problem2.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/bkeller/Problem2/Problem2/Problem2.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/bkeller/Problem2/Problem2/out/production/Problem2/Problem2.class b/bkeller/Problem2/Problem2/out/production/Problem2/Problem2.class new file mode 100644 index 0000000..67fecc0 Binary files /dev/null and b/bkeller/Problem2/Problem2/out/production/Problem2/Problem2.class differ diff --git a/bkeller/Problem2/Problem2/src/Problem2.java b/bkeller/Problem2/Problem2/src/Problem2.java new file mode 100644 index 0000000..7615432 --- /dev/null +++ b/bkeller/Problem2/Problem2/src/Problem2.java @@ -0,0 +1,56 @@ +import java.util.Scanner; + +public class Problem2 { + + + public static void main(String[] args) { + int groupsOf3 = 0; + int groupsOf2 = 0; + int groupsOf1 = 0; + int totalGroups = 0; + int unfilledGroups = 0; + String group; + int i = 0; + + + Scanner input = new Scanner(System.in); + + group = input.nextLine(); + + // create space for the running total of the number of groups + while( group.charAt(i) != '0' ) + { + if (group.charAt(i) == '3') { + groupsOf3 = groupsOf3 + 1; + } else if (group.charAt(i) == '2') { + groupsOf2 = groupsOf2 + 1; + } else if (group.charAt(i) == '1') { + groupsOf1 = groupsOf1 + 1; + } + i = i + 1; + } + + + if( groupsOf2 > groupsOf1){ + totalGroups = groupsOf1 + groupsOf3; + unfilledGroups = groupsOf2 - groupsOf1; + unfilledGroups *= 2; + } + + if( groupsOf1 >= groupsOf2){ + totalGroups = groupsOf2 + groupsOf3; + unfilledGroups = groupsOf1 - groupsOf2; + } + System.out.println(totalGroups + " full groups can be formed, and " + unfilledGroups + " students will still need a group."); + // add all groups of three to the running total + + // loop through all remaining integers + + // if the number of groupsOf2 > groupsOf1 + // find all groups of 2 + // match up a 'single' with a groupOf2 + // add this new group to the running total + } +} + + diff --git a/bkeller/Problem3/.idea/misc.xml b/bkeller/Problem3/.idea/misc.xml new file mode 100644 index 0000000..0548357 --- /dev/null +++ b/bkeller/Problem3/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/bkeller/Problem3/.idea/modules.xml b/bkeller/Problem3/.idea/modules.xml new file mode 100644 index 0000000..482b526 --- /dev/null +++ b/bkeller/Problem3/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/bkeller/Problem3/.idea/workspace.xml b/bkeller/Problem3/.idea/workspace.xml new file mode 100644 index 0000000..75c4497 --- /dev/null +++ b/bkeller/Problem3/.idea/workspace.xml @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519588592823 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dburrigh/Problem 2/Problem 2.iml b/dburrigh/Problem 2/Problem 2.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/dburrigh/Problem 2/Problem 2.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/dburrigh/Problem 2/input.txt b/dburrigh/Problem 2/input.txt new file mode 100644 index 0000000..6cf2855 --- /dev/null +++ b/dburrigh/Problem 2/input.txt @@ -0,0 +1,5 @@ +Example 1: +1 2 3 2 3 2 1 0 + +Example 2: +2 3 1 1 1 3 2 0 \ No newline at end of file diff --git a/dburrigh/Problem 2/out/production/Problem 2/Problem2.class b/dburrigh/Problem 2/out/production/Problem 2/Problem2.class new file mode 100644 index 0000000..d9b749a Binary files /dev/null and b/dburrigh/Problem 2/out/production/Problem 2/Problem2.class differ diff --git a/dburrigh/Problem 2/output.txt b/dburrigh/Problem 2/output.txt new file mode 100644 index 0000000..2ac370a --- /dev/null +++ b/dburrigh/Problem 2/output.txt @@ -0,0 +1,5 @@ +Example 1: +groups of 3 = 4, and 2 students will still need a group + +Example 2: +groups of 3 = 3, and 2 students will still need a group \ No newline at end of file diff --git a/dburrigh/Problem 2/src/Problem2.java b/dburrigh/Problem 2/src/Problem2.java new file mode 100644 index 0000000..f3379fe --- /dev/null +++ b/dburrigh/Problem 2/src/Problem2.java @@ -0,0 +1,36 @@ +import java.util.Scanner; + +public class Problem2 { + + public static void main(String[] args) { + String commandLine; + Scanner scan = new Scanner(System.in); + commandLine = scan.nextLine(); + + int count1 = 0; + int count2 = 0; + int count3 = 0; + int i = 0; + while (commandLine.charAt(i) != '0') { + System.out.print(commandLine.charAt(i)+"\n"); + if (commandLine.charAt(i) == '3') { + count3++; + } else if (commandLine.charAt(i) == '2') { + count2++; + } else if (commandLine.charAt(i) == '1'){ + count1++; + } + i++; + } + if(count1<=count2){ + count2-=count1; + count3+=count1; + System.out.println("groups of 3 = " +count3+", and " +2*count2+ " students will still need a group"); + + }else { + count1-=count2; + count3+=count1; + System.out.println("groups of 3 = " +count3+", and " +count1+ " students will still need a group"); + } + } +} diff --git a/dburrigh/Problem 3/.idea/misc.xml b/dburrigh/Problem 3/.idea/misc.xml new file mode 100644 index 0000000..0548357 --- /dev/null +++ b/dburrigh/Problem 3/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/dburrigh/Problem 3/.idea/modules.xml b/dburrigh/Problem 3/.idea/modules.xml new file mode 100644 index 0000000..34621e3 --- /dev/null +++ b/dburrigh/Problem 3/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/dburrigh/Problem 3/.idea/workspace.xml b/dburrigh/Problem 3/.idea/workspace.xml new file mode 100644 index 0000000..f2bd85c --- /dev/null +++ b/dburrigh/Problem 3/.idea/workspace.xml @@ -0,0 +1,363 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519581027123 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dburrigh/problem1/HW1.iml b/dburrigh/problem1/HW1.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/dburrigh/problem1/HW1.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/dburrigh/problem1/IdeaProjects/HW1/.idea/workspace.xml b/dburrigh/problem1/IdeaProjects/HW1/.idea/workspace.xml new file mode 100644 index 0000000..58de74d --- /dev/null +++ b/dburrigh/problem1/IdeaProjects/HW1/.idea/workspace.xml @@ -0,0 +1,254 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519265926077 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jakemarshall16/HW1P1 examples.txt b/jakemarshall16/HW1P1 examples.txt new file mode 100644 index 0000000..18c899c --- /dev/null +++ b/jakemarshall16/HW1P1 examples.txt @@ -0,0 +1,5 @@ +MudBunRun +Zombie_CityParty_PuppyDog +ZombieMudCreature +Yeti_Party1955 +BigParty_Ghoul \ No newline at end of file diff --git a/jakemarshall16/jakemarshall16.iml b/jakemarshall16/jakemarshall16.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/jakemarshall16/jakemarshall16.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/jakemarshall16/out/production/jakemarshall16/HW1_1.class b/jakemarshall16/out/production/jakemarshall16/HW1_1.class new file mode 100644 index 0000000..f54b8f6 Binary files /dev/null and b/jakemarshall16/out/production/jakemarshall16/HW1_1.class differ diff --git a/jakemarshall16/out/production/jakemarshall16/HW1_2.class b/jakemarshall16/out/production/jakemarshall16/HW1_2.class new file mode 100644 index 0000000..ca674b9 Binary files /dev/null and b/jakemarshall16/out/production/jakemarshall16/HW1_2.class differ diff --git a/jakemarshall16/src/HW1_1.java b/jakemarshall16/src/HW1_1.java new file mode 100644 index 0000000..1607a0e --- /dev/null +++ b/jakemarshall16/src/HW1_1.java @@ -0,0 +1,46 @@ +import java.util.Scanner; + +public class HW1_1 { + public static void main(String args[]) { + + + int totalfiles; + String fileName; + Scanner userInput = new Scanner(System.in); + totalfiles = userInput.nextInt(); + userInput.nextLine(); + for(int i = 0; i < totalfiles; i = i + 1) + { + int totalFound = 0; + fileName = userInput.nextLine(); + if (fileName.contains("Mud")) + { + totalFound = totalFound + 1; + } + if (fileName.contains("BunRun")) + { + totalFound = totalFound + 1; + } + if (fileName.contains("Zombie")) + { + totalFound = totalFound + 1; + } + if (fileName.contains("Boston")) + { + totalFound = totalFound + 1; + } + if (fileName.contains("Spartan")) + { + totalFound = totalFound + 1; + + } + { + if (totalFound == 1) + { + System.out.println(fileName); + } + } + } +//Working through this in class was super helpful + } +} diff --git a/jakemarshall16/src/HW1_2.java b/jakemarshall16/src/HW1_2.java new file mode 100644 index 0000000..feebd2f --- /dev/null +++ b/jakemarshall16/src/HW1_2.java @@ -0,0 +1,37 @@ +import java.util.Scanner; + +public class HW1_2 { + public static void main(String args[]) { + int grouptotal; + Scanner userInput = new Scanner(System.in); + grouptotal = userInput.nextInt(); + + int total = 0; + int justright = 0; + int extras = 0; + int classtotal; + + Scanner input = new Scanner(System.in); + + grouptotal = input.nextInt(); + while (total < 1) { + classtotal = input.nextInt(); + if (classtotal == 0) { + total = total + 1; break; + } else if (classtotal == grouptotal) + { + justright = extras + 1; + } else if (classtotal < grouptotal) + { + extras = extras + classtotal; + } else { + System.out.print("Nope"); + } + } + System.out.println("These people are the expendables: " + extras); + System.out.println("This number of people found a group: " + justright); + + //was able to figure this one out with Alex, Yesenia, and Shane + + } +} diff --git a/jakemarshall16/src/HW1_3.java b/jakemarshall16/src/HW1_3.java new file mode 100644 index 0000000..f33417d --- /dev/null +++ b/jakemarshall16/src/HW1_3.java @@ -0,0 +1,40 @@ +import java.util.Scanner; +public class HW1_3 { + public static void main(String args[]) { + Scanner input = new Scanner(System.in); + int nametotal = 0; + nametotal = Integer.parseInt(input.nextLine()); + String whatsurname = ""; + for (int i = 0; i < nametotal; i++) { + whatsurname = input.nextLine(); + String first = whatsurname.substring(0, whatsurname.indexOf(" ")); + String last = whatsurname.substring(whatsurname.indexOf(" ") + 1, whatsurname.length()); + if (first.length() + last.length() <= 8) { + System.out.println(first + last); + } else if (whatsurname.length() > 8) { + String ans = "" + first.charAt(0); + int x = 0; + int y = 1; + for (int j = 1; j <= 7; j++) { + if (j >= last.length() || j >= first.length()) { + if (ans.length() < 8) { + } + break; + } else if (Character.toLowerCase(first.charAt(y)) <= Character.toLowerCase(last.charAt(x))) { + String add = "" + first.charAt(y); + ans = ans.concat(add); + y = y + 1; + } else if (Character.toLowerCase(first.charAt(y)) >= Character.toLowerCase(last.charAt(x))) { + String add = "" + last.charAt(x); + ans = ans.concat(add); + x = x + 1; + } + } + System.out.println(ans); + }//I needed to have an extensive amount of help with this one because I did not full understand + //what the problem was truly asking me. Alex helped me with this one and Shane and Yesenia also helped. + +//I understand the logic behind it but am confused as to how to execute still. + } + } +} \ No newline at end of file diff --git a/jeff/test b/jeff/test new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/jeff/test @@ -0,0 +1 @@ + diff --git a/jhinze/.idea/workspace.xml b/jhinze/.idea/workspace.xml new file mode 100644 index 0000000..7f1d0d0 --- /dev/null +++ b/jhinze/.idea/workspace.xml @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519695236891 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jhinze/Problem1/Input File Names.txt b/jhinze/Problem1/Input File Names.txt new file mode 100644 index 0000000..e69de29 diff --git a/jhinze/Problem1/out/production/jhinze/Problem1.class b/jhinze/Problem1/out/production/jhinze/Problem1.class new file mode 100644 index 0000000..43c0a39 Binary files /dev/null and b/jhinze/Problem1/out/production/jhinze/Problem1.class differ diff --git a/jhinze/Problem1/src/.idea/.name b/jhinze/Problem1/src/.idea/.name new file mode 100644 index 0000000..e7adaee --- /dev/null +++ b/jhinze/Problem1/src/.idea/.name @@ -0,0 +1 @@ +Problem3 \ No newline at end of file diff --git a/jhinze/Problem1/src/.idea/misc.xml b/jhinze/Problem1/src/.idea/misc.xml new file mode 100644 index 0000000..0548357 --- /dev/null +++ b/jhinze/Problem1/src/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/jhinze/Problem1/src/.idea/modules.xml b/jhinze/Problem1/src/.idea/modules.xml new file mode 100644 index 0000000..98d2875 --- /dev/null +++ b/jhinze/Problem1/src/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/jhinze/Problem1/src/.idea/workspace.xml b/jhinze/Problem1/src/.idea/workspace.xml new file mode 100644 index 0000000..42a1777 --- /dev/null +++ b/jhinze/Problem1/src/.idea/workspace.xml @@ -0,0 +1,316 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519868392279 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jhinze/Problem2/Problem2.iml b/jhinze/Problem2/Problem2.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/jhinze/Problem2/Problem2.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/jhinze/Problem2/src/Problem2.java b/jhinze/Problem2/src/Problem2.java new file mode 100644 index 0000000..511770d --- /dev/null +++ b/jhinze/Problem2/src/Problem2.java @@ -0,0 +1,53 @@ +import java.util.Scanner; + +public class Problem2 { + + public static void main(String[] args) + { + Scanner input = new Scanner (System.in); + int numberOfStartingGroups; + numberOfStartingGroups = input.nextInt(); + String count2; + String count1 + String numberOfFinalGroups; + + + // loop through a list of initial groups + + for ( int i =0; i < numberOfStartingGroups; i = i + 1) + { + + if (numberOfStartingGroups.contains("3") ) + { + numberOfFinalGroups = numberOfFinalGroups + 1; + } + if (numberOfStartingGroups.contains ("2")) + { + count2 = count2 + 1; + } + if (numberOfStartingGroups.contains("1")) + { + count1 = count1 + 1 + } + } + + // now we need to compare count1 and count2 + if (count1 = count2) + { + numberOfFinalGroups = numberOfFinalGroups + count1; + } + if (count1 > count2) + { + numberOfFinalGroups = numberOfFinalGroups + count1; + } + if (count1 < count2) + { + numberOfFinalGroups = numberOfFinalGroups + count2; + } + + System.out.println(numberOfFinalGroups); + + } + + +} diff --git a/jhinze/Problem3/.idea/misc.xml b/jhinze/Problem3/.idea/misc.xml new file mode 100644 index 0000000..0548357 --- /dev/null +++ b/jhinze/Problem3/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/jhinze/Problem3/.idea/modules.xml b/jhinze/Problem3/.idea/modules.xml new file mode 100644 index 0000000..482b526 --- /dev/null +++ b/jhinze/Problem3/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/jhinze/Problem3/.idea/workspace.xml b/jhinze/Problem3/.idea/workspace.xml new file mode 100644 index 0000000..2933296 --- /dev/null +++ b/jhinze/Problem3/.idea/workspace.xml @@ -0,0 +1,391 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519694771953 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kbenes2/Fizz Buzz/.idea/misc.xml b/kbenes2/Fizz Buzz/.idea/misc.xml new file mode 100644 index 0000000..0548357 --- /dev/null +++ b/kbenes2/Fizz Buzz/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/kbenes2/Fizz Buzz/.idea/modules.xml b/kbenes2/Fizz Buzz/.idea/modules.xml new file mode 100644 index 0000000..00208c6 --- /dev/null +++ b/kbenes2/Fizz Buzz/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/kbenes2/Fizz Buzz/.idea/workspace.xml b/kbenes2/Fizz Buzz/.idea/workspace.xml new file mode 100644 index 0000000..47a280d --- /dev/null +++ b/kbenes2/Fizz Buzz/.idea/workspace.xml @@ -0,0 +1,342 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519694771953 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kbenes2/Problem 1/Input File Names.txt b/kbenes2/Problem 1/Input File Names.txt new file mode 100644 index 0000000..c111775 --- /dev/null +++ b/kbenes2/Problem 1/Input File Names.txt @@ -0,0 +1,6 @@ +5 +Boston_Marathon_2015 +Bun-Run_for_fun.pdf +Spartan-vs-Zombie_Race.doc +Mud_Run_in_the_sun.xml +2019_Spartan_Race.pdf diff --git a/kbenes2/Problem 1/Output File Names.txt b/kbenes2/Problem 1/Output File Names.txt new file mode 100644 index 0000000..8747ee4 --- /dev/null +++ b/kbenes2/Problem 1/Output File Names.txt @@ -0,0 +1,3 @@ +Boston_Marathon_2015 +Mud_Run_in_the_sun.xml +2019_Spartan_Race.pdf \ No newline at end of file diff --git a/kbenes2/Problem 1/Problem 1.iml b/kbenes2/Problem 1/Problem 1.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/kbenes2/Problem 1/Problem 1.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kbenes2/Problem 1/out/production/Problem 1/Problem1.class b/kbenes2/Problem 1/out/production/Problem 1/Problem1.class new file mode 100644 index 0000000..19861b0 Binary files /dev/null and b/kbenes2/Problem 1/out/production/Problem 1/Problem1.class differ diff --git a/kbenes2/Problem 1/src/Problem1.java b/kbenes2/Problem 1/src/Problem1.java new file mode 100644 index 0000000..e2dba89 --- /dev/null +++ b/kbenes2/Problem 1/src/Problem1.java @@ -0,0 +1,50 @@ +import java.util.Scanner; + +public class Problem1 { + + public static void main(String[] args) { + int numberOfFiles; + String fileName; + + Scanner input = new Scanner(System.in); + numberOfFiles = input.nextInt(); + + input.nextLine(); //get rid of remaining line after the number + + //loop through a list of files + for( int i = 0; i < numberOfFiles; i = i + 1) + { + fileName = input.nextLine(); + + int numberOfStringsFound = 0; + //test how many of the strings are in the file name + if( fileName.contains("Mud")) + { + numberOfStringsFound = numberOfStringsFound + 1; + } + if( fileName.contains("BunRun")) + { + numberOfStringsFound = numberOfStringsFound + 1; + } + if( fileName.contains("Zombie")) + { + numberOfStringsFound = numberOfStringsFound + 1; + } + if( fileName.contains("Boston")) + { + numberOfStringsFound = numberOfStringsFound + 1; + } + if( fileName.contains("Spartan")) + { + numberOfStringsFound = numberOfStringsFound + 1; + } + //if exactly one of them is + if (numberOfStringsFound == 1) + { + //print out the string + System.out.println(fileName); + } + } + } + +} diff --git a/kbenes2/Problem 2/.idea/misc.xml b/kbenes2/Problem 2/.idea/misc.xml new file mode 100644 index 0000000..0548357 --- /dev/null +++ b/kbenes2/Problem 2/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/kbenes2/Problem 2/.idea/modules.xml b/kbenes2/Problem 2/.idea/modules.xml new file mode 100644 index 0000000..4b7dd62 --- /dev/null +++ b/kbenes2/Problem 2/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/kbenes2/Problem 2/.idea/workspace.xml b/kbenes2/Problem 2/.idea/workspace.xml new file mode 100644 index 0000000..d457564 --- /dev/null +++ b/kbenes2/Problem 2/.idea/workspace.xml @@ -0,0 +1,348 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519698586362 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kbenes2/Problem 3/Flow Chart of Problem 3.txt b/kbenes2/Problem 3/Flow Chart of Problem 3.txt new file mode 100644 index 0000000..d97c3c7 --- /dev/null +++ b/kbenes2/Problem 3/Flow Chart of Problem 3.txt @@ -0,0 +1,13 @@ +Look at the first name. + +Use the first letter of the first name. + +Look at the next letter of the first name. +Alphabetically, if that letter comes before the first letter of the last name: + Yes-- print that letter then move to next letter of first name + Loop to "Look at the next letter of the first name" + No-- print the last name only using 7 characters or less. + +Then move on to the next person and start over loop beginning at using the first letter of the first name. + +One of the loops will include looking at the first name and the last name of each person, then moving on to the next person. diff --git a/kbenes2/Problem 3/Input Names.txt b/kbenes2/Problem 3/Input Names.txt new file mode 100644 index 0000000..919ea7d --- /dev/null +++ b/kbenes2/Problem 3/Input Names.txt @@ -0,0 +1,6 @@ +5 +Kristen Benes +Dallas Burright +Jack Hinze +Braly Keller +Andrew Maaske \ No newline at end of file diff --git a/kbenes2/Problem 3/Output Names.txt b/kbenes2/Problem 3/Output Names.txt new file mode 100644 index 0000000..ffe4623 --- /dev/null +++ b/kbenes2/Problem 3/Output Names.txt @@ -0,0 +1,5 @@ +kbenes +daburrig +jachinze +bkeller +amaaske \ No newline at end of file diff --git a/kbenes2/Problem 3/Problem 3.iml b/kbenes2/Problem 3/Problem 3.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/kbenes2/Problem 3/Problem 3.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kbenes2/Problem 3/out/production/Problem 3/Problem3.class b/kbenes2/Problem 3/out/production/Problem 3/Problem3.class new file mode 100644 index 0000000..efbb1a8 Binary files /dev/null and b/kbenes2/Problem 3/out/production/Problem 3/Problem3.class differ diff --git a/kbenes2/Problem 3/src/Problem3.java b/kbenes2/Problem 3/src/Problem3.java new file mode 100644 index 0000000..8a40410 --- /dev/null +++ b/kbenes2/Problem 3/src/Problem3.java @@ -0,0 +1,31 @@ +import java.util.Scanner; + +public class Problem3 { + public static void main(String[] args) { + int numberOfNames; + String userName, personFirstName, personLastName; + + Scanner input = new Scanner(System.in); + numberOfNames = input.nextInt(); + + + for (int i = 0; i < numberOfNames; i = i + 1) { + + userName = ""; + personFirstName = input.next(); + personLastName = input.next(); + System.out.print(personFirstName.toLowerCase().charAt(0)); + int a = 0; + + for ( a = 0; (personLastName.toLowerCase().charAt(0) > personFirstName.toLowerCase().charAt(a + 1)); a = a + 1) { + System.out.print(personFirstName.charAt(a + 1)); + } + + for (int d = 0; d < (personLastName.length()) && d < 7 - a; d = d + 1) + { + System.out.print(personLastName.toLowerCase().charAt(d)); + + } + } + } +} \ No newline at end of file diff --git a/piiamt/IMG_3477.JPG b/piiamt/IMG_3477.JPG new file mode 100644 index 0000000..6fd1074 Binary files /dev/null and b/piiamt/IMG_3477.JPG differ diff --git a/piiamt/IMG_3478.JPG b/piiamt/IMG_3478.JPG new file mode 100644 index 0000000..fa83030 Binary files /dev/null and b/piiamt/IMG_3478.JPG differ diff --git a/piiamt/Problem 1/.idea/workspace.xml b/piiamt/Problem 1/.idea/workspace.xml index 7ada8c1..e16f655 100644 --- a/piiamt/Problem 1/.idea/workspace.xml +++ b/piiamt/Problem 1/.idea/workspace.xml @@ -15,8 +15,8 @@ - - + + @@ -66,21 +66,21 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519261306475 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/piiamt/Problem 2/Problem 2.iml b/piiamt/Problem 2/Problem 2.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/piiamt/Problem 2/Problem 2.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/piiamt/Problem 2/out/production/Problem 2/Problem2.class b/piiamt/Problem 2/out/production/Problem 2/Problem2.class new file mode 100644 index 0000000..18cc122 Binary files /dev/null and b/piiamt/Problem 2/out/production/Problem 2/Problem2.class differ diff --git a/piiamt/Problem 2/src/Problem2.java b/piiamt/Problem 2/src/Problem2.java new file mode 100644 index 0000000..419ff6a --- /dev/null +++ b/piiamt/Problem 2/src/Problem2.java @@ -0,0 +1,36 @@ + +import java.util.Scanner; +public class Problem2 { + public static void main (String[] args){ + Scanner reader = new Scanner(System.in); + System.out.println("Ok, what are the magic numbers gonna be? "); + int number=reader.nextInt(); + int fullGroups=0; + int onesAwaiting=0; + int twosAwaiting=0; + while (number!=0){ + if (number==3){ + fullGroups++; + } + else if (number==2){ + twosAwaiting++; + } + else if (number==1){ + onesAwaiting++; + } + number=reader.nextInt(); + } + + int singles=0; + if (onesAwaiting>=twosAwaiting){ + fullGroups=fullGroups+twosAwaiting; + fullGroups=fullGroups+(onesAwaiting/3); + singles=onesAwaiting-(onesAwaiting/3); + } + else if (twosAwaiting > onesAwaiting) { + fullGroups=fullGroups+onesAwaiting; + singles=(twosAwaiting-onesAwaiting)*2; + } + System.out.println(fullGroups+" full groups can be formed, and "+singles+" students will still need a group."); + } +} diff --git a/piiamt/Problem 3/.idea/.name b/piiamt/Problem 3/.idea/.name new file mode 100644 index 0000000..e7adaee --- /dev/null +++ b/piiamt/Problem 3/.idea/.name @@ -0,0 +1 @@ +Problem3 \ No newline at end of file diff --git a/piiamt/Problem 3/.idea/misc.xml b/piiamt/Problem 3/.idea/misc.xml new file mode 100644 index 0000000..8e8843c --- /dev/null +++ b/piiamt/Problem 3/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/piiamt/Problem 3/.idea/modules.xml b/piiamt/Problem 3/.idea/modules.xml new file mode 100644 index 0000000..34621e3 --- /dev/null +++ b/piiamt/Problem 3/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/piiamt/Problem 3/.idea/workspace.xml b/piiamt/Problem 3/.idea/workspace.xml new file mode 100644 index 0000000..7f0bf5c --- /dev/null +++ b/piiamt/Problem 3/.idea/workspace.xml @@ -0,0 +1,310 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +