Assignment #1

Due: Tues, May 27

Objective

Practice with Java input/output and basic coding, including some simple arithmetic calculations.

Task

Create a program (Filename: Sales.java) that will calculate the taxes and totals for a set of home purchases.

General Requirements


Sample run 1: (user input underlined)

Welcome to Sales!!

What was the price of the TV? 895.99
and what was the price of the washer/dryer? 724.50
and what was the price of the refrigerator? 1299.98
and what was the price of the microwave? 300   
What is the local sales tax rate? 7.53

Prices:
   TV           = $ 895.99
   Washer/Dryer = $ 724.5
   Refrigerator = $ 1299.98
   Microwave    = $ 300.0

Your subtotal is $ 3220.47
And at a tax rate of 7.5 percent, this will add $ 242.50 in sales tax
for a grand total of $ 3462.97

Goodbye!!

Sample run 2: (user input underlined)

Welcome to Sales!!

What was the price of the TV? 1599.23
and what was the price of the washer/dryer? 942.79
and what was the price of the refrigerator? 1433.96
and what was the price of the microwave? 250.20
What is the local sales tax rate? 6.85

Prices:
   TV           = $ 1599.23
   Washer/Dryer = $ 942.79
   Refrigerator = $ 1433.96
   Microwave    = $ 250.2

Your subtotal is $ 4226.18
And at a tax rate of 6.9 percent, this will add $ 289.49 in sales tax
for a grand total of $ 4515.67

Goodbye!!

Compiling and testing

Compilation instructions for various environments are on the course web site, under the heading "Compilers and Compiling Help". These include instructions for building projects in both NetBeans and Eclipse, as well as compiling from the command line on your CS account or from the DOS prompt. If you use the CS account, I'd recommend using linprog.cs.fsu.edu.

Make sure to test your program with a variety of different inputs. The Sample Runs above are just that -- examples, only. Never hard-code your programs to work for only one or two test cases. Your program should work and calculate the correct results for any set of valid inputs.

Submitting:

On the Blackboard web page link for this course, there is now a menu item (below CGS 3416 Course Content) called "Assignments". Go here for assignment submission links.

General Advice - always keep an untouched copy of your finished homework files on your computer science account, or e-mail a copy of your finished files (before the due date) to your own FSU e-mail account. This way, these files will have a time-stamp which will show when they were last worked on (a timestamp from the CS servers, or a time stamp on the FSU e-mail) and will serve as a backup in case you ever have problems with submitting files through the web site. My advice is to do this for ALL programs.

For HW #1, submit only the following file:

  Sales.java