I have put together several resources for the purpose of helping to ensure you have everything you need to be successful in P2:

- A command sheet for
P1. For
information about command sheets and why we use them visit
`http://josephus.hsutx.edu/classes/all/commandsheets/`. - A command sheet for P2.
- A series of practice exercises outlined below. The theory is that if you are able to independently complete these exercises using the techniques described then you should be ready to do well in P2.

- Start with a bare-bones, but working program (e.g., a "hello world"
program).
- As much as possible rely on your memory, the command sheet, the
official Java documentation, and previous exercises. If you find
yourself needing other resources then you likely need to spend
more time working on the concept at hand or on previous concepts.
- Write only one or two lines of code and then compile and test. Before
running the program you should always have in mind a prediction of what
the program will do. Be observant.
- If you are stuck and need to get help, limit your questions to this type of question: "I thought these lines of code should to X, but instead they are doing Y. Explain what that is the case." REMEMBER: The goal is not to finish these exercises. Instead the goal is to learn what the exercises are trying to teach you.

`http://josephus.hsutx.edu/classes/p1/homework/hw02`. Concepts: Simple input and output.`http://josephus.hsutx.edu/classes/p1/homework/hw03`. Concepts: Floating point arithmetic. NOTE: If you are going to use the weights in our syllabus you'd modify the program to input 3 exam scores, a homework score, and a lab day score.`http://josephus.hsutx.edu/classes/p1/homework/hw04`. Concepts: Integer arithmetic, modulus/remainder. HINT: If the user enters 64 cents then you can do 64/25 (which is 2) to determine the number of quarters and then`64%25`

(which is 14) to tell you how much is left after taking out all of the quarters. Etc.`http://josephus.hsutx.edu/classes/p1/homework/hw05`. Concepts: If statements. NOTE: Pay attention to < vs <= to make sure you cover the ranges properly. Also, there are a variety of ways to do this. Consider nesting if statements in else blocks to simplify your solution.`http://josephus.hsutx.edu/classes/p1/homework/hw06`. Concepts: Calculations and if-statements. There are lots of ways to get the formulas wrong so be sure you can solve the problem by hand correctly. Have a friend or teacher check your work.`http://josephus.hsutx.edu/classes/p1/homework/hw07`. Concepts: Boolean expressions.`http://josephus.hsutx.edu/classes/p1/homework/hw08`. Concepts: Loop for user validation. NOTE: The calculations and output should not be inside of the loop. The loop's only job is to obtain valid input. Once the input is obtained you should exit the loop and proceed to the next part of the program.`http://josephus.hsutx.edu/classes/p1/homework/hw09`. Concepts: Loop a fixed number of times.`http://josephus.hsutx.edu/classes/p1/homework/hw10`. Concepts: Nested loops. NOTE: This program has lots of small places you might get off the rails. This might be a good time to review the suggested technique and make sure you are following it.`http://josephus.hsutx.edu/classes/p1/homework/hw11`. Concepts: More loop practice including a loop that uses as sentinel value as a marker at the end of a series of inputs.`http://josephus.hsutx.edu/classes/p1/homework/hw12`. Concepts: How`Scanner`works.`http://josephus.hsutx.edu/classes/p1/homework/hw13`. Concepts: Methods and parameters.`http://josephus.hsutx.edu/classes/p1/homework/hw14`. Concepts: Practice with methods. This is a rewrite of an earlier exercise but organizes the solution into methods.`http://josephus.hsutx.edu/classes/p1/homework/hw15`. Concepts: Practice with methods. This is yet another rewrite of an earlier exercise (but organizes the solution into methods). It also asks you to use try-catch to allow entering a number without crashing the program. So, you'll want to write a method called`getNumber`that takes three parameters as follows:public static double getNumber(String prompt, double low, double high) { Scanner kb= new Scanner(System.in); double val= 0.0; try { System.out.println(prompt); val= kb.nextDouble(); System.out.println("You entered "+val); } catch (Exception e) { System.out.println("Wrong number"); } return val; }

Your completed method will do quite a bit more than this, but this provides a starting point.`http://josephus.hsutx.edu/classes/p1/homework/hw16`. Concepts: Arrays.`http://josephus.hsutx.edu/classes/p1/homework/hw17`. Concepts: Working with arrays (and methods).`http://josephus.hsutx.edu/classes/p1/homework/hw18`. Concepts: Top-down design and pseudocode. If you haven't written pseudocode before think of it a a simple programming language that doesn't concern itself with picky syntax rules.

`http://josephus.hsutx.edu/classes/p1/homework/hw19`. Concepts: Using arrays, loops, if statements, input/output, etc.`http://josephus.hsutx.edu/classes/p1/homework/hw20`. Concepts: Extending a game from 2-player to multi-player.`http://josephus.hsutx.edu/classes/p1/homework/hw21`. Concepts: Using simple, non-OOP classes.

tsergeant@hsutx.edu