Homework Files

Path to the file server Lamont to download files for labs and homeworks and upload your labs and homeworks: \\lamont.cs.uwyo.edu\courses\cosc1010

Homework Grading Criteria

  • Programs that are uploaded late will not be accepted. The time of the last modification of an uploaded program is considered the upload time. Hard copies that are submitted late will not be accepted.
  • Programs that don't compile lose 50%.
  • Programs that produce incorrect output will lose 25%. (i.e. test your program, convince yourself that it works properly before turning it in.)
  • Read the code style guide (under Useful Links). Points will be taken off for improper style. This includes sloppy tabulation, variable names that don't fit their usage, method names that don't fit their usage, extra unused code, and poor or absent commenting.
  • Print your hard-copy with WordPad or BlueJ. Turn the hardcopy in at the beginning of lecture on the due date.
  • Do not turn in a hard-copy that is different from the program that you place on Lamont.
  • Put your name, username, and lab section number in a comment at the top of your program and at the top of the hard-copy you turn in. If you received help from anyone, you must state this in your comment and include the name of the person who helped you. Example:
       John Doe (jdoe@uwyo.edu)
       I received help from Jane Smith (jsmit@uwyo.edu)
       Lab section 12
  • Your file structure on Lamont should be exactly as follows:
    • Inside of your folder there should be 3 folders (only 3). They should be named "Labs", "Homework", and "Exams".
    • Inside of the "Labs" folder there should be one (only one) folder for each lab. They should be named as follows: "Lab1", "Lab2", "Lab3", etc. Inside of each of these there should be a single BlueJ project and nothing else.
    • Inside of your "Homework" folder there should be one (only one) folder for each homework. They should be named as follows: "Homework1", "Homework2", "Homework3", etc. Inside of each of these folders there should be a single BlueJ project and nothing else.

Homework Assignments

Homework 6 (Due Thursday, October 29):

From the downloads\Homework folder on Lamont copy deckOfCards. Open the project with BlueJ.

The DeckOfCards project makes use of the Card class, the Deck class, the Hand class and the FiveCardStud class.

Your job is to write the FiveCardStud class.

THE CARD CLASS, DECK CLASS AND THE HAND CLASS ARE ALREADY WRITTEN FOR YOU, DON'T CHANGE THEM.

  1. Read the comments in the source code of the FiveCardStud class and finish writing the class according to those instructions.

  2. Make sure your finished deckOfCards project is in your Homework6 folder on Lamont and turn in a hard-copy in class on Thursday.

The example below shows the output from calling the FiveCardStud constructor with 4 players, calling the deal method, and then calling the showCards method.

Homework 7 (Due Tuesday, November 10):

Your job is to write a program to solve "easy" Sudoku puzzles. A problem is "easy" if, at all times, there is at least one location in the grid that has all but one of the nine digits occurring in the same row, column, or box. Additional information on Sudoku can be found at www.sudoku.com.

From the downloads\Homework folder on Lamont copy sudoku. Open the project with BlueJ.

The sudoku project has a single class, Sudoku, which has methods to create, solve and print a Sudoku game.

Finish writing the Sudoku class. Do not modify the constructors or the solve method.

  1. Read the comments in the source code of the Sudoku class and finish writing the class according to those instructions. Do not change the method headers.

  2. Upload the project to Lamont when you are done and bring a printout of Sudoku to class on Tuesday.

The first example below shows the output from calling the print method with the unsolved puzzle, and the second example shows the output from the print method after calling the solve method.





Additional "easy sudoku puzzels: Easy Sudoku Puzzles
Homework 8 (Due Thursday, November 19):

From the downloads\Homework folder on Lamont, copy the salesReport project and paste the copy in your Homework8 folder. Open the project with BlueJ.

The salesReport project allows an employee to enter a simple daily sales report and prints out the results. The employee must enter his username and password (both are just Strings entered with showInputDialog.) After verifying the username and password, the program allows the employee to enter his sales details for the day. Sales details include the product name, product ID#, price, and quantity sold. When the salesperson is finished entering data, the program calculates the total cash value of the salesperson's sales for the day and prints out the report.

  1. Read the comments in the source code of the salesReport project and finish writing the classes according to those instructions. Make sure your final sales report printout is neat.
  2. Upload your finished salesReport project to your Homework8 folder on Lamont. Turn in a hard-copy in class on Thursday.
  3. The example below shows the output from calling the salesReport main method, entering a false employee and password.







  4. The example below shows the output from calling the SalesReport main method, entering the name "Abe", password "aaa", and entering 2 products.



























Homework 9 (Due Thursday, December 3):

From the downloads\Homework folder on Lamont, copy the ValidateCreditCardNumbers project and paste the copy in your Homework9 folder. Open the project with BlueJ.

The ValidateCreditCardNumbers project reads a list of credit card numbers from a text file and uses the Luhn check to determine if the card numbers are valid. An explanation of the validation algorithm can be found in the document Credit Card Validation.docx.

  1. Read the comments in the source code of the ValidateCreditCardNumbers project and finish writing the classes according to those instructions.
  2. Upload your finished ValidateCreditCardNumbers project to your Homework9 folder on Lamont. Turn in a hard-copy in class on Thursday.
  3. The example below shows the output from calling the ValidateCreditCardNumbers main method.