Question: Code using MASM615 COMPILER . Generate 45 random 3 digit numbers and stored them in MAJOR_ARRAY. While generating the numbers, keep in mind the following
Code using MASM615 COMPILER.
- Generate 45 random 3 digit numbers and stored them in MAJOR_ARRAY. While generating the numbers, keep in mind the following restrictions.
- Each generated number shall contain only 3 digits which are distinct. For example 123, 256, 789 etc. the number should not contain digits more or less than 3 and no digit is repeated as well.
- The program must generate 5 numbers from each set given below.
- 100 to 199
- 200 to 299
- 300 to 399
- 400 to 499
- 500 to 599
- 600 to 699
- 700 to 799
- 800 to 800
- 900 to 999
- Each set must contain 5 numbers that are present in array.
- All numbers should be generated continuously using one loop having range between 100 and 999.
- Create a function named as SEPARATION that separates numbers from the MAJOR_ARRAY into the above mentioned 9 sets and store them in separately declared small arrays named as ARRAY_1 and so on up to 9.
- When you implement separation then, ARRAY_1 contains 5 numbers between 100 and 199. Similarly ARRAY_2 contains 5 numbers between 200 and 299 and so on. Hence the last array which ARRAY_9 contains 5 numbers between 900 and 999.
- Create a function named as SORTING that sorts all 9 arrays in ascending order using bubble sort.
- Create a function named as MERGING_ARRAYS that will merge all nine small arrays into one array named as MAJOR_SORTED_ARRAY.
- While merging keep track that all data remain sorted but this time it is sorted in descending order.
- Create a function named as DISPLAY that will print all the arrays created.
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
