CS 160, Spring 2015
Programming Assignment P1
Let's Get Started!
Programming due Tuesday, Jan. 27 at 6:00pm; late deadline Jan. 27 at 11:59pm.
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 "Computer Science is great!".
- On the second line of output, print the string "Java Programming can be fun.".
- On the third line of output, print your last name, a comma, and your first name.
- On the fourth line of output, print your major or "Undeclared".
- On the fifth line of output, print the name of this class "CS160 Foundations in Programming".
- On the sixth line of output, print the due date of this assignment in the format shown below (for example 9/21/2001).
- On the seventh line, print a sentence that explains why you are taking this class.
- Some additional directions for the seventh line, as follows:
- Must start with a capital letter.
- Must end with a period or exclamation point.
- Must be between 50 and 70 characters total, including white space.
Program Structure
// P1 Assignment
// Author: Chris Wilcox
// Date: 1/1/2015
// 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 seven lines, and should match the output shown below, except
as described here. You must print exactly the strings shown on the first and second lines.
Spelling errors, incorrect capitalization, extra or missing white space and any other difference
will cause a failure. The third line will have your name instead of mine. The fourth line will
not be checked, but must be present. The fifth and sixth lines must have exactly the strings shown.
The seventh line must follow the specification given above. See the grading criteria below for
additional information.
Computer Science is great!
Java Programming can be fun.
Wilcox, Chris
Computer Science
CS160 Foundations in Programming
1/27/2015
I am in this class because I really like to program.
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. (5 points)
- test2: checks second line of output. (5 points)
- test3: checks third line of output. (5 points)
- test4: checks fourth line of output. (5 points)
- test5: checks fifth line of output. (10 points)
- test6: checks sixth line of output. (10 points)
- Final Tests
- test7: checks that seventh line starts with a capital letter. (10 points)
- test8: checks that seventh line ends with a period or exclamation mark. (10 points)
- test9: checks that seventh line has between 50 and 70 characters. (10 points)
- test10: checks that program has exactly seven lines of output. (10 points)
- Preliminary testing only checks the first through sixth 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).
© 2015 CS160 Colorado State University. All Rights Reserved.