Module main()
Declare Real euros[1]
Declare Real dollars[1]
Call getDollars(dollars)
Call setEuros(dollars[0], euros)
Call showEuros(euros[0])
End Module
Module getDollars(Real dollars[])
Display "Enter the amount of dollars:"
Input dollars[0]
En
Sharene Siddiqui
CISP 300; T 7pm 10:10pm
Chapter 2 Homework
1. An algorithm is a step-by-step procedure to solve a problem.
3.
a) An information-processing system is a series of planned actions and operations upon data to
achieve a desired result.
b) Sour
Sharene Siddiqui
CISP 300, T 7pm-10:10pm
1. First, analyze the current system. Next, define the new system requirements. Then, design the new
system. Then, develop the new system. After which, you implement the new system. Last, you
evaluate the new syste
You can choose to submit either A2 (worth 150 points), AD2 (worth
180), or both (worth 180) for first assignment you will get a score for
assignment 1 either 150 points base or 180 points base.
A2
Please use java.awt.Graphics, javax.swing.JApplet and java
-Which of the following statements is false? In use today are more than a trillion
general-purpose computers and trillions more Java-enabled cellphones,
smartphones and other handheld devices.
-Which of the following is most closely associated with Moore'
You can choose to submit either A3 (worth 150 points), AD3 (worth
180), or both (worth 180) for first assignment you will get a score for
assignment 1 either 150 points base or 180 points base.
A3
Computers are playing an increasing role in education. Wri
HOMEWORK #2
Homework Problem 1:
Pseudocode:
Declare Integer secondsHeard
Declare Real speedOfsoundpersecond
Declare Real distanceLightingtraveled
Display " How many seconds passed from the time the lighting was seen till the thunder was heard? "
Input sec
Circular, doubly linked list
Create a circular, doubly linked list from a file (input.txt), containing a list of names. The number of
names is unknown.
Prompt the user for the number of nodes to delete and then delete accordingly from the list.
Assumption
Populate a queue with a list of integers (both positive and negative) from a file (input.txt). Write an
algorithm that deletes all negative integers without changing the order of the remaining elements.
Duplicates are allowed.
Do not use a counter to keep
This is a continuation from the previous group assignment. You can just add to your previous group
assignment. Evaluate the postfix expression that has been placed in the queue from the previous group
assignment and display the result.
Precondition:
The
Stack
stack new nodes can be added and removed only at the top
similar to a pile of dishes
last-in/first-out (LIFO)
Bottom of stack indicated by a link member to null
constrained version of a linked list
push
pop
adds a new node to the top of the stac
Expression evaluation
Postfix also known as Reverse Polish Notation (or RPN), is a notational system where the
operation/function follows the arguments. For example, "1 2 add" would be postfix notation for adding
the numbers 1 and 2.
Programming languages
Circular list
Deleting and inserting (Have to worry about out of bounds)
1) Rear and Front start at -1 (Array is empty)
2) Inserts are done at the rear(rear+), deletes are done at the front(front+)
a. If front or rear is outside the bounds, it has to be s
The height of a node is the length of the longest downward path to a leaf from that node. The height of
the root is the height of the tree.
The depth of a node is the length of the path to its root (i.e., its root path). This is commonly needed in
the man
Two linked lists
Write a program that reads a list of students (first names only) from a file. It is possible for the names to be in unsorted
order in the file but they have to be placed in sorted order within the linked list.
The program should use a dou
voidArrayTest()
cfw_
intscores[100];
/operateontheelementsofthescoresarray.
scores[0]=1;
scores[1]=2;
scores[2]=3;
The key point isthat the entire array is allocated as one block of memory.
Once the array is set up, access to any element is convenient an
(Using two queues)
Current level
A
Next level
B C
B C
D E F G
D E FG
H
H
Enqueue root on CurrentLevel
While currentLevel
Display currentlevel
Dequeue currentLevel
Enqueue left nextLevel
Enqueue right nextLevel
If currentlevel=NULL
Currentlevel=nextLevel
N
Depth First traversal
There are three types of depth-first traversal: pre-order, in-order and post-order. For a binary tree,
they are defined as operations recursively at each node, starting with the root node as follows:
Pre-order
1. Visit the root.
2. T
Tower of Hanoi
The Tower of Hanoi (also called the Tower of Brahma or Lucas' Tower,[1] and sometimes
pluralized) is a mathematical game or puzzle. It consists of three rods, and a number of disks of
different sizes which can slide onto any rod. The puzzle
Doubly linked list
Create a doubly linked list from a file (input.txt). The number of items is unknown.
(Delete from head) Prompt the user for a node number. Starting from the head, moving forward, go to
the node and delete it.
(Delete from tail) Prompt t
Split
Create a linked list called myList from an input file (inputSplit.txt) that contains an even number
of first names. The number of items in the file is unknown.
Create a split function that divides the newly created linked list into two equal sublist
Insert at the leaf. The inserted node will have a height of 0.
Since inserting occurred by traversing from the root all the way to a leaf node,
recursively, we have to go back until we end up back at the root. As we go back,
rebalance will be called on th