Question: How do I design 3 algorithms , and provide both a flow chart and pseudo code for the algorithms. Algorithm descriptions: Given an integer parameter

How do I design 3 algorithms, and provide both a flow chart and pseudo code for the algorithms.

Algorithm descriptions:

Given an integer parameter named current_number and two constant global variables: final static int MIN_NUMBER = 1; final static int MAX_NUMBER = 8;

Create an algorithm named forward, that will advance ONE value through a sequence of numbers 1, 2, 3 ... MAX_NUMBER. In other words, when passed a value of 3 in the parameter current_number, it simply returns a 4.

However, when MAX_NUMBER is reached the algorithm should wrap around back and return MIN_NUMBER. The algorithm will NEVER return a value larger than MAX_NUMBER.

Create an algorithm named backward, that will move through a sequence of numbers ... 3, 2, MIN_NUMBER. In other words, when passed a value of 6 in the parameter current_number, it simply returns a 5.

When MIN_NUMBER is reached the algorithm should STOP and return the value MIN_NUMBER. This algorithm will NEVER wrap around.

Create an algorithm named createFileName, that takes a number as input, current_number, and builds and returns a String like "pictureX.gif", where X is the value in the input parameter.

This should fit on 1 sheet of paper. Place the 3 flowcharts (one per method) on one side of the paper and the matching pseudo code next to it or on the other side.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!