CS 150, Spring 2018
Programming Assignment - P1
Let's Get Started!
Due - January 30th, 2018 at 6:00pm
Late - January 31st, 2018 at 8:00am
Objectives of this Assignment
- Write a Java program with console output, and
- learn how to submit your Java program using Checkin tab on the course web site, also
- to understand how preliminary testing works and see if you can follow directions!
Instructions
Create a Java program called P1 with a class named P1, which after created should contain a file named P1.java in the src folder. All of the Java code you write should be contained in the main method and an example of the code structure is shown below. 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 by selecting the option
public static void main(String[] args)
under the header "which method stubs would you like to create?". Unselect the other two options at this time.
- Copy the comment block shown below and personalize it if you have not set up a default comment header.
All variables and code should reside in the main method!
- On the first line of output, print the string "Welcome to CS150!".
- 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 followed by a space, 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 "CS150 - Interactive Programming in Java".
- On the sixth line of output, print the due date of this assignment in the format shown below.
- 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 exclamation mark.
- Must be between 50 and 70 characters total, including white space.
Program Structure
// Assignment: P1 Assignment
// Author: Russ Wakefield
// Date: 01/20/2018
// Class: CS150
// Email: Russ.Wakefield@colostate.edu
public class P1 {
public static void main(String[] args) {
// Print statements go here
} // end main
} // end class P1
Sample output
Your program should print seven lines, and should match the output format 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 your program to be incorrect. 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.
Welcome to CS150!
Java Programming can be fun.
Wakefield, Russ
Computer Science
CS150 - Interactive Programming in Java
1/30/2018
I am in this class because I want to learn computer programming!
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.8.
- Make sure your code runs on machines in the CSB 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.
- 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)
- test7: checks that seventh line starts with a capital letter. (10 points)
- test8: checks that seventh line ends with a 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)
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).
Submit P1.java to Checkin.
© 2018 CS150 Colorado State University. All Rights Reserved.