Question
Write an Assembly language program that will consist of a number of methods. The first of our helper methods will read and store an array
Write an Assembly language program that will consist of a number of methods. The first of our helper methods will read and store an array of 10 records representing students; each record consists of a name of type string of up to 40 characters, age of type integer, and an ID of type integer. The second of our helper methods prints the array of records created by the first method in a readable format (a single line for each student). The third helper method will swap any two records, and then prints the entire array. The program must ask the user to enter the record numbers. (You may assume the records are numbered from 1 to 10. For example, if the user enters 4 and 7, then the program swaps record 4 with record 7.) The main method (where your program should start), will then use these methods to create our array of records, print the records for our user to see, and then provide a menu for them to swap records or exit. The program should continue to show the user the menu until they choose to exit from the program. A run of your program may look like the following (user input is shown in bold):
Enter in the name, age and ID for 10 students please:
Chad Will
28
463
Flynn Rider
23
937
Patches OHoolihan
65
845
Dan Smith
32
481
Florence Machine
25
019
Donald Duck
40
783
Jane Smith
39
967
Ron McDonald
52
293
Amy Pond
38
111
Greg Finkley
43
549
Record 1: Chad Will 28 463
Record 2: Flynn Rider 23 937
Record 3: Patches OHoolihan 65 845
Record 4: Dan Smith 32 481
Record 5: Florence Machine 25 019
Record 6: Donald Duck 40 783
Record 7: Jane Smith 39 967
Record 8: Ron McDonald 52 293
Record 9: Amy Pond 38 111
Record 10: Greg Finkley 43 549
Menu:
1) Swap two records.
2) Exit
Please choose one of the above options: 1
Which record do you select first? 3
Which record do you want to swap it with? 10
Record 1: Chad Will 28 463
Record 2: Flynn Rider 23 937
Record 3: Greg Finkley 43 549
Record 4: Dan Smith 32 481
Record 5: Florence Machine 25 019
Record 6: Donald Duck 40 783
Record 7: Jane Smith 39 967
Record 8: Ron McDonald 52 293
Record 9: Amy Pond 38 111
Record 10: Patches OHoolihan 65 845
Menu:
1) Swap two records.
2) Exit
Please choose one of the above options: 2
Please use the SPIM emulator for MIPS processes.
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