ENGR131 – Homework 3: Loops Revisions are in red Due at 11:59 PM on Tuesday September 25, 2007. Submit all .java files as required by your TA. Grading: Problem 1 (30 pts). Problem 2 (70 pts). General (10 pts). Instructions: The main focus of this assignment is the use of “for” and “while” statements. You will also gain experience using the Math.random() method. Write a separate program (.java file) for each problem. Note that both problems require console input and/or output (I/O). 1. Write a program that deals five random cards for a Poker game. Use a “for” loop because you know the exact number of iterations (five) in advance. You only need to display the numerical value of each card (1 – 13). Use console output (print). You may choose any output format you wish, but the following is one example: 2 6 5 1 13 2. Write a program to practice playing Blackjack. To keep things simple, the user does not compete against the dealer, and the cards have fixed values (1 – 10 ). Be sure to use console
This is the end of the preview.
access the rest of the document.
Input/output, 10 pts, sentinel value, 30 pts, new card