Details of this Paper

Assignment 4 Program 1




Programming Assignment# 4 Program #1 To complete this assignment code the program using RAPTOR and enter the JAVA program attached to this link. Using RAPTOR with Modules and Subprograms RAPTOR?s subprograms are named subcharts. Subcharts are easy to create, easy to use, and act in a manner similar to procedures already available in Raptor. Subcharts can break a RAPTOR program into logical parts which are called as needed by the main program to simplify design, ensure that flowcharts don't grow to unwieldy sizes, and reduce the chance for errors. When you start a RAPTOR program, you?ll see a tab named Main in the upper left corner of the screen. To create a subchart, simply right-click the Main tab and select Add Subchart from the menu. Enter the name of your subchart and a new editing window with this name will appear. Now you can begin to build your subchart. To call a subchart, simply insert a Call symbol at the desired spot in your program, and enter the name of the subchart to be called. A subchart may be called from the Main flowchart or from other subcharts or even from within itself (but use care if you decide to try this ? see Problem 4 below for a recursive problem). One important difference between a RAPTOR subchart and the submodules and functions described in the text is that you cannot pass or return arguments to or from a subchart. As the program runs, when the Call is encountered, control will transfer to the subchart. After all the steps in the subchart are completed, control will automatically return to the next symbol after the Call. Caution! In RAPTOR, all variables are global. This means that, if you create a subchart with;certain variables, they retain their value if they are used in the main program.;PROGRAM;? Input a list of positive numbers (terminated by 0) into an array, find the largest number and smallest number in the array, and output the result.;? Use a subchart to input the numbers and another subchart to find the largest and another subchart to find smallest number.;? The Main program should output the numbers and the largest number.;A4P1 PSEUDOCODE;//PLACE THIS PART OF THE CODE IN A SUBROUTINE;//Loop to read 5 numbers;//assign 1 to counter;//while (counter < 6);//Read value and assign it to a location in the array;// numbers[counter] = value;//Loop back;//END OF SUBROUTINE;//========================================================================;/// Assign the first element in the array to a variable called largest and a variable called minimum;// largest = numbers[1];// minimum = numbers[1];// set counter to 2;// Loop through the array to find the minimum and maximum;//while(counter maximum then maximum = numbers[counter];// if numbers[counter] < minimum then minimum = numbers[counter];//Increment counter by one to go to the next element;//counter = counter + 1;//Loop back;//Print maximum and minimum values


Paper#69507 | Written in 18-Jul-2015

Price : $22