CpSc 210, Section 1
Assignment #1
January 24, 2003
The purpose of this assignment is to allow you to build a program
using the tools found in the first five chapters of Java Elements.
In addition, you will become familiar with the style standards
used in this course and submission requirements.
Submission of this program will be by "milestones." You will be
assigned partial completion of the program at various dates.
Milestone 1: Using the code that has been sent to you by email,
implement the printLine and getStringMoney methods. Your program
is expected to compile and print line 1 of the form.
private static void printLine ( int lineNumber, String description,
float floatAmount )
// post: print line lineNumber of form 1040EZ and then skips a line
{
}
private static String getStringMoney ( float floatAmount )
// post: returns a String representation of floatAmount
// in the form xxx.yy such as 0.00 or 3059.76 ---
{
// return something of type String or else won't compile
return "";
}
Milestone 2: Fill out the form through line 5. But, you now find
that you need to know whether the filer is single or married and whether
or not the spouse can be claimed by another person. So, add
parameters at the end of the parameter list of the computeAndPrintTax method
as shown.
public static void computeAndPrintTax
( float salary,
int dependents,
float withheld,
boolean claimedByOther,
float taxableInterestEarned,
float unemploymentCompensation,
boolean single,
boolean spouseClaimedByOther
)
Don't forget to add these parameters to your calling parameters in the main
method. Also, it is messy to compute line 5 in the computeAndPrintTax
method, so call another method to do the calculation and return a float
value. Name this method "computeLine5".
Milestone 3: Complete code for Form 1040 EZ.
Due dates:
Milestone 1 is due Tuesday, January 28, at 11:59 p.m.
Milestone 2 is due Wednesday, February 5, at 11:59 p.m. Submit to Section 1, Assignment 2.
Milestone 3 is due Monday, February 10, at 11:59 p.m. Submit to Section 1, Assignment 3.
Grading Rubric:
Milestone 1: Compiles without error (10 pts.), formats salary as requsted (10 pts.), and
pleasing format of line 1 (5 pts.).
Milestone 2:
Compiles withour error (5 pts.). No further credit if code does not compile. Milestone 1 works as specified (10 pts.). Line 5 calculation (10 pts.). Form printed through line 5 in pleasing format (5 pts.)
Code must be correct. Elegance of code matters, also.
Other requirements:
The first operation of your main program must be to print "CPSC 210", your name, the assignment number, and a brief description of the assignment.
Follow the style standards to be found on your instructor's
web page for CPSC 210.
Submit your program using the handin command as Assignment #8. There is a link to
the handin description on the CPSC 210 lab page (www.cs.clemson.edu/~lab210).