Question: Part 1 . Preliminary Work ( 5 0 points ) 1 . Find Number of Occurrences. ( 5 0 points ) This program involves practice
Part Preliminary Work points
Find Number of Occurrences. points
This program involves practice of writing subprograms and dynamic array creation. The subprograms to be written are: CreateArray, InitializeArray, and FindFreq. See the following for their definitions. You may have additional subprograms as needed.
A Main program invokes CreateArray.
The subprogram CreateArray performs the following. It
Asks the user to enter the size of the array to be created then allocates storage using syscall
Calls another subprogram: InitializeArray to initialize the array content with positive integers by using a simple user interface.
After initialization it prints the contents of the array if you like you may write a subprogram for this
Returns array address and array size to Main in $ mathrmv and $ mathrmv registers
B Main invokes FindFreq.
The subprogram FindFreq performs the following. It
Receives the array address, array size, and address of FreqTable from Main in argument $a registers and finds number of times the numbers to appear in the array and stores this frequency information into FreqTable.
FreqTable word
# Defined in data segment and assume that it is only accessible by Main its address will be passed to FindFreq
# FreqTable text st word contains the number times the number appears in the array
# FreqTable text th word contains the number times the number appears in the array
# FreqTable text th word contains the number times any number other than to appears in the array
For example, if the array created by the user contains ; appears twice and any number other than to appears twice.
C Main prints FreqTable with a proper format. If you prefer you may write a subprogram for this.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
