Question
Building on the flowchart from Lab #2, draw a flowchart and write the corresponding SC machine language program that that will read a sequence of
Building on the flowchart from Lab #2, draw a flowchart and write the corresponding SC machine language program that that will read a sequence of positive numbers (1 to 999) from the input cards. After reading in the numbers, the program will output the largest of those numbers.
This program will use a negative number as the last card read. This sentinel value will not be part of the data processed. If the input cards are 23, 65, 47, 15, and -999, then the output should be 65. The -999 is the sentinel value that indicates the end of the data has been reached. The program and the data must be contiguous in memory.
The data for this program may be immediately before or immediately after the program. Test the program a number of times with a different sequence of data and a different number of numbers.
Three test runs to be turn in (in this order) should be made as follows: a. the largest value as the first item input (use any 5 different numbers) b. the largest value included between the first and last data items (use any 8 different numbers) c. the largest value as the last data item input before the sentinel value (use any 4 different numbers) You will need a variable to store the maximum number and the program must initialize it. The program can create a 0 and store it in that memory location, or the first number input (valid data) can initialize the maximum number. Ensure that your flowchart format comply with the requirements for Simple Computer assignments.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started