
Business Application: What's the Cost of My Mortgage? The loan department of your bank still uses...
Business Application: What's the Cost of My Mortgage? The loan department of your bank still uses silly tables to determine what the monthly payment of a mortgage loan is going to be. The consumer association wants you to design a program...
Posted
yesterday

General Application: Your Age in Days Your problem is to write a program that will read in a...
General Application: Your Age in Days Your problem is to write a program that will read in a person’s birth date as well as the current date, compute and display the person’s age in days. The program will have to be interactive, to...
Posted
11 hours ago

A Bouncing Ball While waiting for your date to show up, you idly bounced a tennis ball on the...
A Bouncing Ball While waiting for your date to show up, you idly bounced a tennis ball on the sidewalk. This gave you the idea to develop a program to compute and display some data on the bounces a ball will make when dropped from a given...
Posted
20 hours ago

Computing a Customer's Change Your cousin just opened a small store and does not have the funds to..
Computing a Customer's Change Your cousin just opened a small store and does not have the funds to buy one of those sophisticated cash registers that compute the change to return to a customer. Since he still possesses his old personal...
Posted
14 hours ago

Other Tree Traversals Using the following recursive algorithms, traverse the tree of Figure 9.17. 1.
Other Tree Traversals Using the following recursive algorithms, traverse the tree of Figure 9.17. 1. A Guessing Game You are on vacation at home and planning to enjoy your free time. Alas! your parents ask you to take care of your little...
Posted
18 hours ago

Insert Sort Create a sorting algorithm which enters new values into an array by moving existing...
Insert Sort Create a sorting algorithm which enters new values into an array by moving existing values to make space for the new value 1....
Posted
yesterday

More Queues The given diagrams show two more implementations of a queue, using arrays. The first...
More Queues The given diagrams show two more implementations of a queue, using arrays. The first queue Q1 always has its Head at position one of the array, and on ExitQ all values are moved up. The second queue Q2 moves “snake wise”...
Posted
13 hours ago

Quick Queue Create a queue and its operations EnterQ and ExitQ, using the already created Stack and.
Quick Queue Create a queue and its operations EnterQ and ExitQ, using the already created Stack and its operations. 1. Double Stacks Two stacks can be implemented by a single...
Posted
yesterday

SlowSort Given an array A of N integers (not necessarily different) ranging from 0 to 1000, create.
SlowSort Given an array A of N integers (not necessarily different) ranging from 0 to 1000, create an algorithm to sort the values by checking (in increased order) if each of the 1000 integers is in the array and if so, by outputting the...
Posted
15 hours ago

Median: MidArray The middle or median value of an array of an odd number of values, N, is that value
Median: MidArray The middle or median value of an array of an odd number of values, N, is that value which has as many values less than it as are greater than it. Create an algorithm to find this Mid value. Do it in a least two other ways....
Posted
16 hours ago

Speedy Sort of Binary Values Given an array B of N binary values (0s and 1s only), create an...
Speedy Sort of Binary Values Given an array B of N binary values (0s and 1s only), create an algorithm to sort this array using the least number of passes. Do this four different ways corresponding to the four methods of sorting.
Posted
21 hours ago

Bar Plot Create an algorithm that draws an histogram (bar plot) where values are plotted in...
Bar Plot Create an algorithm that draws an histogram (bar plot) where values are plotted in proportion to some values (given in an array). Do this 1. Weighted Forgiving Average...
Posted
yesterday

Play Record Create a record describing a card game, such as Bridge or Poker, and indicate various...
Play Record Create a record describing a card game, such as Bridge or Poker, and indicate various actions which could be performed on such an item. 1. Convolution Trace the...
Posted
yesterday

University Record Create a record of a university. It is described by a name, enrollment, age, ZIP..
University Record Create a record of a university. It is described by a name, enrollment, age, ZIP code, and phone number (having three parts: Area code, Prefix, and Suffix). The university is also classified as being Private or Non private....
Posted
yesterday

Normalize Frequencies Two dice are rolled N times, with outcomes D1 and D2 noted and put into a...
Normalize Frequencies Two dice are rolled N times, with outcomes D1 and D2 noted and put into a table F[D1, D2] of frequencies of occurrence. Create an algorithm to convert (normalize) this table of frequencies F into a table of probabilities...
Posted
11 hours ago

TicTacWin The game of Tictactoe (or Xs and Os, or naughts and crosses) is played on a table as A
TicTacWin The game of Tictactoe (or Xs and Os, or naughts and crosses) is played on a table as A game is won if there are three identical symbols in a row, in a column, or along a diagonal. Show two different algorithms to detect a win....
Posted
22 hours ago

1. Transpose Create an algorithm to transpose a rectangular array (i.e., to convert all values A[I,.
1. Transpose Create an algorithm to transpose a rectangular array (i.e., to convert all values A[I, J] to A[J, I]). This essentially “rotates” the array values about a diagonal. 2. MiniMax Given an array of M rows and N columns, construct...
Posted
15 hours ago

FlipNFlop Trace the algorithm given below when operating on the given table. Then verbally...
FlipNFlop Trace the algorithm given below when operating on the given table. Then verbally indicate its behavior in general.
Posted
19 hours ago

Scale Time Given a table indicating the time T[I, J] to travel between points I and J in hours,...
Scale Time Given a table indicating the time T[I, J] to travel between points I and J in hours, create an algorithm to convert this time to minutes. 1. MoreCharge Recall the...
Posted
17 hours ago

A La Mode The mode M of an array A of N values is the value which occurs most often. Show two...
A La Mode The mode M of an array A of N values is the value which occurs most often. Show two general algorithms to determine the mode. Anticipate exceptional cases and handle...
Posted
yesterday

HiloGrade Create an algorithm that computes an average of grades, and then indicates for each grade
HiloGrade Create an algorithm that computes an average of grades, and then indicates for each grade whether it is above, at, or below the average. 1....
Posted
20 hours ago

Weed Create an algorithm to “weed out” or eliminate duplicate entries from an array V, creating a...
Weed Create an algorithm to “weed out” or eliminate duplicate entries from an array V, creating a second array W. 1....
Posted
yesterday

Reverse Create an algorithm to reverse the values in an array A (with and without using recursion)..
Reverse Create an algorithm to reverse the values in an array A (with and without using recursion). 1. Normalize Create an...
Posted
20 hours ago

Upright Bar Plot Create an algorithm to draw an upright bar plot as shown, having M bars and a...
Upright Bar Plot Create an algorithm to draw an upright bar plot as shown, having M bars and a maximum of N height. Here M = 5 and N = 8
Posted
19 hours ago

Side Bar Plot Create an algorithm (topdown) to draw a bar plot as follows, given any number of bars
Side Bar Plot Create an algorithm (topdown) to draw a bar plot as follows, given any number of bars N with values in array A for any given thickness of bars T, and space between bars S. Here N = 4, T = 2, and S = 2.
Posted
yesterday

Mystery What does the following algorithm do?
Mystery What does the following algorithm do?
Posted
yesterday

Recursive Power Create a recursive subprogram to compute the Nth (positive) power of X. 1. Rem (or..
Recursive Power Create a recursive subprogram to compute the Nth (positive) power of X. 1. Rem (or Mod) Create a recursive program for Rem(A, B), which computes the remainder after A...
Posted
14 hours ago

NonDivide Passing Indicate the output of the following program if the input values are 1, 2, 3 in..
NonDivide Passing Indicate the output of the following program if the input values are 1, 2, 3 in that order Indicate the output if the subprogram call (in the main program) were changed in each of the following ways: ...
Posted
yesterday

Divide Again For the previously defined Divide subprogram and the following Main Program, indicate..
Divide Again For the previously defined Divide subprogram and the following Main Program, indicate the output of the following subprogram calls: a. Divide(D, C, B, A) b. Divide(A, B, A, B) c. Divide(A, A, B, B) d. Divide(B ´ C, A –...
Posted
yesterday

Bind Dates 1. Create a binding table and contour diagram for any of the above Dates programs. 2....
Bind Dates 1. Create a binding table and contour diagram for any of the above Dates programs. 2. Range Create an algorithm that reads in three values A, B, C and outputs the range R, which is the...
Posted
yesterday

Dates Use some of the previous algorithms (Leap, Days) and create: a. Valid, an algorithm to test...
Dates Use some of the previous algorithms (Leap, Days) and create: a. Valid, an algorithm to test whether a given date Year, Month, Day is a valid date. b. UnDate, an algorithm to convert a Julian date Julian,Year back into the Gregorian form...
Posted
23 hours ago

Double All What is output by the following program when it passes parameters by reference?
Double All What is output by the following program when it passes parameters by reference?
Posted
13 hours ago

Easter is on the “first Sunday following the first full moon that occurs on or after March 21”. The.
Easter is on the “first Sunday following the first full moon that occurs on or after March 21”. The “calendar moon” used for finding Easter is defined as the Nth of March where N = 44  E. If N . To advance N to a...
Posted
16 hours ago

Data of Easter The algorithm to determine the data of Easter for any given year could involve a...
Data of Easter The algorithm to determine the data of Easter for any given year could involve a number of Div and Mod actions. Create a subprogram to determine the data of Easter according to the following algorithm for an input parameter Y,...
Posted
yesterday

DivideAndConquer Use the previously defined Divide subprogram to: a. convert pints to gallons,...
DivideAndConquer Use the previously defined Divide subprogram to: a. convert pints to gallons, quarts and pints. b. convert a decimal number to binary. c. determine whether a year is a leap year. d. convert 24hour (military) time to civil...
Posted
yesterday

Deep Nests Given the nested blocks shown in the following diagram, indicate which blocks may be...
Deep Nests Given the nested blocks shown in the following diagram, indicate which blocks may be called by each block. If a variable X is declared in E only, which blocks can access it? If a variable Y is declared in B, D and F, but is...
Posted
yesterday

Trace Subs Draw a dataflow diagram corresponding to the given interconnection of the subprograms...
Trace Subs Draw a dataflow diagram corresponding to the given interconnection of the subprograms below. Trace this program for A = 0 and B = 1. Draw a tree showing the calling of subprograms and indicate the order that the subprograms are...
Posted
23 hours ago

Divide Again Create an algorithm to Divide using a subprogram which multiplies. It may not be...
Divide Again Create an algorithm to Divide using a subprogram which multiplies. It may not be efficient, but it shows another way of doing something.
Posted
yesterday

Translate Convert the following conditions into Logical statements (using ANDs, ORs and NOTs). a....
Translate Convert the following conditions into Logical statements (using ANDs, ORs and NOTs). a. Neither A nor B. b. Either A or else B. c. Exactly two of the three variables A, B, C are True. d. An odd number of the three variables A,...
Posted
yesterday

XORcise Prove (or disprove) the following cancellation property for the usual OR and the...
XORcise Prove (or disprove) the following cancellation property for the usual OR and the exclusiveor, XOR. a. If (A OR B) = (A OR C) ...
Posted
yesterday

When In Rome... One method for converting an Arabic number into a Roman number is to separately...
When In Rome... One method for converting an Arabic number into a Roman number is to separately convert each digit (the units, tens, hundreds, and thousands positions) as shown: 1 ...
Posted
14 hours ago

Logical Less If False is defined as less than True, draw a truth table for the operation P also a...
Logical Less If False is defined as less than True, draw a truth table for the operation P also a table for P Q. 1. Binconvert Create an algorithm to convert a sequence of...
Posted
16 hours ago

Logical Swap? Prove (or disprove) the fact that the following two algorithms swap the values of the.
Logical Swap? Prove (or disprove) the fact that the following two algorithms swap the values of the logical variables, P and Q. a. Set P to NOT(P OR...
Posted
12 hours ago

Thanks Create a general algorithm which outputs “THANK YOU” for a total of N times (where N is...
Thanks Create a general algorithm which outputs “THANK YOU” for a total of N times (where N is input). This greeting is printed three times per line (possibly less on the last line). There is a blank line after every group of twelve...
Posted
yesterday

Down Timer Create a timer to count down from a given number of hours, minutes and seconds to zero...
Down Timer Create a timer to count down from a given number of hours, minutes and seconds to zero. At intervals of five seconds, it outputs the time (remaining to zero). 1. Pythagorean Triplets Construct an algorithm to produce all integers x,...
Posted
23 hours ago

Expo The exponential function Expo(x) can be computed from the first N terms of this series: a....
Expo The exponential function Expo(x) can be computed from the first N terms of this series: a. Create an algorithm to compute this, assuming that Fact and Power are available as subalgorithms. b. Create another algorithm that does not call...
Posted
17 hours ago

Disproof Show that the following two pieces of algorithm are not equivalent.
Disproof Show that the following two pieces of algorithm are not equivalent.
Posted
yesterday

Once More What action is performed by the following algorithm?
Once More What action is performed by the following algorithm?
Posted
12 hours ago

Unbiased Mean In some sports, a number of judges each ranks performance on a scale from 1 to 10. To.
Unbiased Mean In some sports, a number of judges each ranks performance on a scale from 1 to 10. To adjust for biases, both the highest and lowest values are eliminated before computing the average. Create an algorithm to compute such an...
Posted
12 hours ago

Speed Create an algorithm to analyze the speed during a trip of N stops. At each stop, the distance.
Speed Create an algorithm to analyze the speed during a trip of N stops. At each stop, the distance D and time T from the previous stop are recorded. These pairs of values are then input to a program which computes each velocity (V = D/T) and...
Posted
12 hours ago