Post Lab 1
Due Monday, Sept 8 by 4:00pm
For this assignment you need to print a table with a list
of information about music sales.
For each piece of music, there will be a column for the artist, the
title of the song or CD, the number of CDs sold in stores, the number of
downloads, and the total sales. The output must be in the
format below.
/////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
== Music Sales Summary ==
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////////
Artist Title CDs Sold Downloads Total
------ ----- -------- --------- -----
Big Bopper "Chantilly Lace" 3905 23978 27883
Joey "What's Up?" 140 355 495
The requirements for your program are as
follows:
- You must print the border on the top as illustrated (using the slash and
backslash characters).
- You must use tab characters to get your columns aligned
(the columns must be aligned but the spacing does not need to be exactly as
above)
- You must use the + operator for both addition and string concatenation.
- The titles must be inside quotation marks.
- Make up your own information for the table (use short titles
so you won't have too much trouble formatting the output)! The ones
shown are just for illustration purposes. You need at least 5 entries
in the table.
- Document your program by putting comments at the beginning and
before the main method as we did in lab. These should include:
- Comments at the beginning include the
name of the author of the program (that is you!) using the @author tag,
a brief description
of the purpose of the program, and the date the program is due.
- Comments before the main method that includes the @param tag and
a brief description of what the main method does (for now this is
very repetitive - what you put here can be almost the same as what
you put for the purpose of the class).
Begin by planning out your program. Think carefully about
what your program will look like, what commands will you need, and
how you will achieve the proper formatting. When you are ready to start
typing, you will need to create a java file in your lab1 package directory:
- Launch Eclipse.
- Highlight the lab1 package in the Labs project in the workbench.
- Open the File menu, expand the new option and
select Class.
- Name the class. (remember to properly capitalize the class name)
- Check the option to include the main stub.
- Click Finish.
HAND IN: A printout of your program and email an electronic
copy to your professor
(ingram@roanoke.edu) with a subject of cs120 postlab1.