Limited time offer

Get 25% off your order

Use the code below at checkout — offer expires soon.

Your promo codeNURSE24
25%
Expires in: 10:00
Claim my 25% discount
LIMITED OFFER Get 25% off — use code BESTW25 | No AI No Plagiarism On-Time Delivery Free Revisions Claim Now

EssayQuest – 24/7 Homework & Research Assistance

Fast, Reliable, and Plagiarism-Free Help for Students in the USA, UK & Australia

EssayQuest – 24/7 Homework & Research Assistance

Fast, Reliable, and Plagiarism-Free Help for Students in the USA, UK & Australia

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.

You must 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:
const int MIN_NUMBER = 1;
const 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  on one side of the paper and the matching pseudo-code next to it or on the other side.

 

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.
Scroll to top