Computer Science 202
Introduction to Programming
Fall 2012, The College of Saint Rose
In this lab assignment, you will practice writing and calling methods in Java.
You may work alone or with a partner on this lab.
Getting Started
You will be adding a few method defintions and calls to a starter program. So you will need to download and extract that starter program from this link. Once you have it extracted to an appropriate folder, you should be able to open it in BlueJ.
Lab Procedure
Follow these steps to complete your lab.
Bonus Opportunity
For up to 10 points of lab bonus points, write the Java program described in Gaddis Programming Challenge question 14 on page 294. Note that to do this, you will first need to complete Programming Challenge 13.
Style and Documentation Reminders
Before you submit your programs, make sure they conform to our guidelines for style and documentation.
In particular, you should have a comment at the top of each class that describes your program and has your name (and that of your partner if you are working with someone), the course number and section (02 for 11:15, E1 for 4:10). You should have comments throughout your programs describing your variables and any non-obvious Java statements or groups of statements.
All identifiers (class names and variable names) should be meaningful and conform to Java's naming conventions.
Your code should be nicely formatted, with new lines after any
{
or }
, and indented as done in class examples.
Submitting Your Work
Before 11:59 PM, Wednesday, December 5, 2012, submit your Java program to Blackboard for grading. Please upload only your Java source file Geometry.java - the one with the .java file extension, not the .class, .ctxt, package.bluej or README files).
Should you choose to implement the bonus program, you should also upload your Java file for that program with your submission.
Grading
This assignment is worth 20 points, which are distributed as follows:
> Feature | Value | Score |
printMenu method header | 2 | |
printMenu method call | 1 | |
calcRectArea method correctness | 2 | |
calcRectArea method call | 2 | |
correct rectangle areas displayed | 1 | |
calcRectPerimeter method correctness | 2 | |
calcRectPerimeter method call | 2 | |
correct rectangle perimeters displayed | 1 | |
calcTriPerimeter method correctness | 2 | |
calcTriPerimeter method call | 2 | |
correct triangle perimeters displayed | 1 | |
Naming conventions | 1 | |
Formatting | 1 | |
Bonus program | up to 10 | |
Total | 20 | |