CPE 101:
Fundamentals of Computer Science 1


Spring 2003
(Sections 02 & 03 only)
Program # 1
Pgm1a due by 9 p.m. Friday, Pgm1b due by 9 p.m., Sunday, at the end of Week # 2. DON'T FORGET TO USE THE handin INSTRUCTIONS linked below, my account is "csturner" and does NOT include "cpe101" or a section number. The handin instructions given on the main csc/cpe 101 webpage has you use your course and section number, but that will not work for this class.


-->
Some Notes

Writing and compiling Java programs will be covered in lab during week #1. Using the "handin" process that you must use to submit this assignment will be covered in the first lab session of week #2: all course participants must have obtained their Central Unix account by the start of our lab during the second week.

Here again is a link to an explanation of the handin process you must use to submit your programming assignments to me.

Start with either your assignment template, that you created in Lab 1, or download another copy of my Template1 and re-enter all your own personal information. Then, for each program described below, make a copy with the appropriate changes. For example, for the first part below, you'd save it as SimpleMath.java and, when prompted to make the other necessary changes, you should do all of the following:

  1. Change the ClassName on line 2 from template1 to SimpleMath
  2. Change the Assignment description on line 3 to Program 1.1, A Simple Math Program
  3. Change the class name on line 48 from template1 to SimpleMath

Then, when you start the second program below, start with the template again, and make the changes necessary for it. You'll find reminders about these steps throughout this assignment, and only this one, but you should follow a similar process for every program you write for this course.


handin to the Pgm1a folder

The first program is due by 9 p.m. Friday. FOR THIS ONE PROGRAMMING PART (and ONLY this programming part, Pgm1a) you are allowed to work with a partner if you wish, but you MUST note that on your program documentation, including the nature of the help given and the name of the partner.

The challenge here is to successfully:


A Simple Math Program

First, practice writing some simple Java applications using arithmetic expressions.

Make sure you save this program when you are done. Continue with the next part of this lab. When you get to the end, you'll find instructions on how to hand in this source code file for grading.


handin to the Pgm1b folder

The remaining program is due by 9 p.m. Sunday. You may, of course, submit the last program at the same time as you submit the first one (using the appropriate handin folder for each set), but I'm splitting this assignment into two parts because I want everyone to get started using handin during the week (rather than waiting until the weekend, when less support is available for anyone having difficulty...).

The challenges here are to successfully:


Rolling Dice

For our last program, we will develop a very simple, text-based "dice roller" game. Each time you play this game, a pair of six-sided dice are rolled (but write your program such that those numbers can be easily changed in future versions; i.e., use variables with meaningful names for both the number of die pieces and number of sides on each one). Your program is to print out a message indicating the face that appeared (randomly, of course) on each individual die, and the total number of points for the roll.

While you won't be given directions on exactly how to write design this, as you were for the first part of this assignment, all of the following are required for this program:


Submitting Your Work

For this and all future programming assignments, you will submit your source code files (and, unless explicitly told otherwise, only those .java files) via the Central Unix Handin facility. It is recommended that you first try submitting a file or two to the Test folder, to familiarize yourself with the process (although work submitted there will NOT be graded). Once you think you understand the process, then submit these files as noted:

Please Note: Only programs that we can compile successfully in our lab environment will be graded. (Compiling in your, possibly different, environment is not adequate. They must compile in the CSc Lab.) Programs that do compile, but contain errors, may be eligible for partial credit if and only if you make it clear that you are aware of the program's limitations by documenting all problems you know about and the things you have tried, unsuccessfully, to fix them. You may document this in one of two ways:

Copyright © 2000 by Carol Scheftic. All rights reserved. Used by permission.
Requests to reuse information from this page should be directed to Carol Scheftic.
Page created 2 April 2001; updates include (programs remain the same, but the due-dates have been modified) on 4 April 2003