CS 160, Spring 2013
Programming Assignment P1
Let's Get Started!
Programming due Tuesday, Sep. 3 at noon; late deadline Sep. 3 at 10 p.m.
This assignment has four objectives:
- to write a Java program with console output,
- to learn how to submit your Java program using Checkin tab on the course web site,
- to understand how preliminary testing works, and
- to see if you can follow directions!
Write a Java program in a file called P1.java with class name P1, an
example of the code structure is shown below. All of the Java code you
write should be contained in the main method. For this assignment,
you must follow the directions below exactly:
- Create a project in Eclipse called P1.
- Create a class in the project called P1.
- Let Eclipse create a main method in P1.java.
- Copy the comment block shown below and personalize it.
- On the first line of output, print the string "Hello, World!".
- On the second line of output, print your last name, a comma, and your first name.
- On the third line of output, print your major or "Undeclared".
- On the fourth line of output, print the name of this class "CS160".
- On the fifth line of output, print the due date of this assignment in the format shown.
- On the sixth line, print a sentence that explains why you are taking this class.
- Some additional directions for the sixth line, as follows:
- Must start with a capital letter.
- Must end with a period or exclamation point.
- Must be between 40 and 80 characters total, including white space.
Program Structure
// P1 Assignment
// Author: Chris Wilcox
// Date: 1/15/2013
// Class: CS160
// Email: wilcox@cs.colostate.edu
public class P1 {
public static void main(String[] args) {
// Print statements go here
}
}
Sample output
Your program should print six lines, and should match the output shown below, except
as described here. You must print exactly the string Hello, World! on the first line.
Spelling errors, incorrect capitalization, extra or missing white space and any other difference
will cause a failure. The second line will have your name instead of mine. The third line will
not be checked, but must be present. The fourth line must have exactly the string CS160.
The fifth line must have exactly what is shown below. The sixth line must follow the specification
given above. See the grading criteria below for additional information.
Hello, World!
Wilcox, Chris
Computer Science
CS160
9/3/2013
I am taking this class because I expect it to be awesome!
Specifications
Your program must meet the following specifications:
- Work on your own, as always.
- The name of the source code file must be exactly P1.java.
- Name the file exactly - upper and lower case matters!
- Comments at the top as shown above.
- Assignments should be implemented using Eclipse.
- Assignments should be implemented using Java 1.5 or 1.6 or 1.7.
- Make sure your code runs on machines in the COMCS 120 lab.
- Submit your program to the Checkin tab as you were shown in the recitation.
- Read the syllabus for the late policy.
- We will be checking programs for plagiarism, so please don't copy from anyone else.
Grading Criteria
- 100 points for perfect submission.
- 0 points for no submission, will not compile, submitted class file, etc.
- Preliminary Tests
- testCompile: checks that program compiles. (10 points)
- testComment: checks the comment block at top of program. (10 points)
- test1: checks first line of output. (10 points)
- test2: checks second line of output. (5 points)
- test3: checks third line of output. (5 points)
- test4: checks fourth line of output. (10 points)
- test5: checks fifth line of output. (10 points)
- Final Tests
- test6: checks that sixth line starts with a capital letter. (10 points)
- test7: checks that sixth line ends with a period or exclamation mark. (10 points)
- test8: checks that sixth line has between 40 and 80 characters. (10 points)
- test9: checks that program has exactly six lines of output. (10 points)
- Preliminary testing only checks the first through fifth lines
- Final grading checks the remaining criteria, and includes the preliminary tests.
Submit your program to the Checkin tab on the course website, as you were shown in
the recitation, and read the syllabus for the late policy (if necessary).
© 2013 CS160 Colorado State University. All Rights Reserved.