CIS 35A: Introduction to Java Programming

Home | Green Sheet | Lectures | Assignments | FAQ | Grades | Students

Lab #1 (Exercise 2-3)

Modify the Invoice application

Due Date: Tuesday of Week 1
10 points

Before you start, check which team you belong to.

  1. If you downloaded the file, open the file named InvoiceApp.java that's in your computer or USB drive. Save the program as ModifiedInvoiceApp.java. Change the class name to ModifiedInvoiceApp. If you don't have the file, copy and paste the code below:
  2. Modify the code so the applications ends only when the user enters "n" or "N". As it is now, the application ends when the user enters anything other than "y" or "Y". To do this, you need to use a not operator (!) with equalsIgnoreCase method. Compile this class and test this change by entering 0 at the Continue? prompt.
  3. Modify the code so that it provides a discount of 25 percent when the subtotal is greater than or equal to $500. Then test this change.
  4. Modify the code so that it displays the number of invoices, the average invoice amount, and the average discount amount when the user ends the program. Then, test this change.

Include in your program the following comments:

  • Name of program
  • Team's name with all the names of the members (e.g. Team A: John Doe, Jane Smith, etc.)
  • Current Date
  • Computer system and compiler you are using
  • Brief description of the program


Compile and run the Java program.

Take a screen capture by hitting simultaneously the keys Alt and Print Screen (Prt Sc) of the output results (console) and paste it in MS Paint. Save it as a gif file.

When you are ready, upload the java program and the gif file by clicking the link below:

Upload Lab

I cannot grade if I don't get the files and receive your email.