Introduction to Programming
Be able to name and describe the major components of the computer systems in terms of the
hardware system and the software systems.
This lesson provides an introduction to computer systems with respect
Write a class called Cashier that directs a cashier how to cash goods and give change to customers. The
typical cashier operations are as follows:
(a) Clear the cash register machine.
(b) Enter the name and the price of each item in the cash registering m
<?xml version="1.0" encoding="UTF-8"?>
<!-* GENERATED FROM project.xml - DO NOT EDIT
EDIT ./build.xml INSTEAD
For the purpose of easier reading the script
is divided into following sections:
Study Guide for COP 2250 Final Exam
A UML diagram uses the symbol to indicate that a member is private.
A + is a boolean variable that signals when some condition exists in the program.
A constructor is a method that +
A group of related classes is call
Study Guide for COP 2250 Final Exam
What is a constructor?
When defining classes, how do you define the attributes? How about the setters & getters?
If you need a variable to keep track of the sum of things, what is that variable called?
What is the scope
Chp. 4 Program Challenge
Pseudo code for program that will calculate and display users earning.
Create a variable to hold the number of days worked.
Create a variable to hold the amount of pennies earned.
Create a variable to hold the final total pay.
Chp. 5 Program Challenge
Pseudo code for program that plays Rock, Paper, Scissors game between computer and user.
Create Random import statement to generate random number.
Create Scanner import statement to read keyboard input.
Add a method to assign rock
Chp. 6 Program Challenge
Pseudo code for program that creates car based on user input and simulates acceleration and
1. Create Scanner import statement to read keyboard input.
2. Write a class named Car.
a. Add a field named yearModel (an
After answering this assignment you will be able to:
(a) Distinguish between instance variables and class variables
(b) Distinguish between instance methods and class methods
(c) Know how to call class methods and how to call instance methods
(d) Format n
Implement a class called Employee. An employee has a name and gets a salary. Every pay period each
employee gets an additional amount in bonus.
Include a constructor that accepts the name and salary of an employee. Provide a mutator method that
Introduction to Computers
Joslyn A. Smith
March 9, 2010
What is a Computer?
An electronic device that has the capability of performing the following tasks:
Responds to input.
Processes the input according to the instructions it gets.
Purpose of exercise: To understand and implement the control structure - Looping.
One method for finding an approximate solution of an equation f(x) = 0 is Newton's method.
This method consists of taking an initial approximation x1 to be the solution, and
The management of a certain chain of supermarkets would like to know on a comparative basis the
performance of its supermarkets in each city. The data in the following table shows the amount of profit for
all of the supermarkets in each city.
On completion of this chapter, you will be able to:
Distinguish between low-level and high level programming languages.
Differentiate between an assembler, an interpreter, and a compiler.
Differentiate among the five different genera
The while statement
The do/while statement
The for Statement
To understand iteration as means of controlling program flow
To know the three forms of iterations:
Refer to Example 1, motor car.
Write a class called MotorCar. Include:
a) Fields make, model, maximum speed, and tank capacity.
b) A constructor that initializes these fields.
c) Accessor methods that return the value of each variable.
d) Mutator methods
The if Construct
The if . else Construct
The switch Statement
The while Construct
The do . while Construct
The for Construct
To understand what control
Data Types Reference Types
To understand what reference types are
The need to study reference types
To understand Java standard packages
To differentiate between Java defined types and user defined types
To have a deeper understanding of th
Data Types and Operations On Data
To understand what data types are
The need to study data types
To differentiate between primitive types and reference types
To know the data range and storage requirements for each type
To know the conditio
Lottery class = domain class
2 arrays in it, which are global varibales (definied at top of lottery class): lotteryNumbers &
In constructor of Lottery Class, you are to instantiate Random class and generate 5 random
numbers between 1 and