CISC 1115
Introduction to Programming Using Java
Lab #1
Introductory Lab
Overview
The purpose of this introductory lab is to:
- Get you acquainted with the lab machines
- Introduce you to the software you will be using
- Give you some practice writing code
- Get you to write some new code
- Get you to enhance your program's output
Getting You Acquainted with The Lab Machines
Room 130 NE was designed specifically with the 1115 student in mind. The machines are Intel based boxes
running Windows. Each of you should stake out a machine and try to use the same machine during each lab.
(This is a suggestion, not a requirement-- while you cannot absolutely rely on these machines to retain
their contents-- the folks maintaining the lab are perfectly within their rights to wipe them clean and reload
them-- that should not happen too often, and this way, you will feel more 'at home' if you use the same machine
each time).
Introducing You to the Software You Will be Using
As we may have mentioned in class, there are several basic software tools used in the development and testing of
software: an editor, a compiler, and some mechanism for executing ('launching' or 'running' the resulting program.
These three components are often combined (integrated) into a single piece of software known as an integrated development
environment (IDE). An IDE, addition to the basic three tools listed above, often provides other facilities, for example
a debugger-- a tool that aids in the tracking down and correction of program errors.
We will be using an IDE to develop our programs, for most, if not all, of the semester. The CIS official 1115 Web page
(accessible from my 1115 page) contains links and detailed installations/usage instructions for several popular (i.e., free)
IDE's used in the development of Java program. I will be using Dr Java in the class and suggest you do so aas well — at least
initially. Of course, feel free to try and/or use any of the others (or all of them — one of the desireable
characteristics of a good computer scientist is the willingness and ability to try new techniques/methodologies/software).
Your lab machines should have all the IDE's available on the desktop.
Lab 1.1 — Get You to Write Some Code
Take the grading program developed in class and compile, then run it (rather than retyping it, copy and paste it--
if you don't know how, turn to your neighbor, and ask-- you'll make a friend in the process).
Sample Test Run
Enter last name: Weiss
Enter first name: Gerald
Enter midterm: 80
Enter final: 90
Weiss, Gerald: 85
This lab is meant to get you acquainted with Dr Java, and involves nothing more than copy/pasting the code presented in class, entering it into
Dr Java, and compiling/execting it.
Lab 1.2 — Get You to Modify an Existing Problem
Modify
Lab 1.1 so that you are now taking the average of three exams.
Sample Test Run
Enter last name: Weiss
Enter first name: Gerald
Enter exam 1: 70
Enter exam 2: 80
Enter exam 3: 90
Weiss, Gerald: 80
Lab 1.3 — Get You to Work on a New Problem
Write a program to accomplish the following:
Picosoft Computer Systems, Inc. finally decides to computerize their payroll system and hires you as the
software developer. The first program to be written calculates weekly pay for their employees. The company's
payroll input sheet contains data for its
four (4) employees: last name, followed by first name, followed
by the employee's hourly rate (all hourly rates are whole dollar amounts), followed by the number of hours worked
by the employee.
You are to calculate the amount earned by each employee (which is the product of the hours worked and the
hourly rate) and print out the data (last name, first name followed by the earnings) for each employee.
Sample Test Run
Enter last name: Weiss
Enter first name: Gerald
Enter rate: 15
Enter hours: 10
Weiss, Gerald: 150
Enter last name: Tenenbaum
Enter first name: Aaron
Enter rate: 12
Enter hours: 3
Tenenbaum, Aaron: 36
Enter last name: Arnow
Enter first name: David
Enter rate: 50
Enter hours: 1
Arnow, David: 50
Enter last name: Whitlock
Enter first name: Paula
Enter rate: 7
Enter hours: 4
Whitlock, Paula: 28
Lab 1.4 — Get You to Enhance Your Program's Output (Approval)
Same as
Lab 1.3, but with more readable output.
Sample Test Run
Enter last name: Weiss
Enter first name: Gerald
Enter rate: 15
Enter hours: 10
--- Gerald Weiss worked for 10 hours at $15 an hour and earned $150
Enter last name: Tenenbaum
Enter first name: Aaron
Enter rate: 12
Enter hours: 3
--- Aaron Tenenbaum worked for 3 hours at $12 an hour and earned $36
Enter last name: Arnow
Enter first name: David
Enter rate: 50
Enter hours: 1
--- David Arnow worked for 1 hours at $50 an hour and earned $50
Enter last name: Whitlock
Enter first name: Paula
Enter rate: 7
Enter hours: 4
--- Paula Whitlock worked for 4 hours at $7 an hour and earned $28
Program output should be more than simply a dump of the results; it should be formatted nicely and accompanied with explanatory verbiage