Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write assembly code using Visual Studio.x64 2019 version. Please submit your solution within 40 minutes max Write an MASM program that starts by reading a

Write assembly code using Visual Studio.x64 2019 version. Please submit your solution within 40 minutes max
image text in transcribed
image text in transcribed
Write an MASM program that starts by reading a number of students N between 1 and 10 . If N is invalid, the program displays an error message and terminates. If N is valid (between 1 and 10 ), the program continues and attempts to read N student scores (integers each between 0 and 100 ), stores them in an array SCORES and calculates their average AVG (AVG = quotient of sum/N). While reading the scores, if any of them is invalid then the program stops reading, displays an error message, and terminates. If all scores are valid, then the program displays the N scores each followed by a grade FAIL if the score is less than AVG or PASS otherwise. In this case (if all input is valid), the program also displays at the end the value of the A average VG. Your program must define and use only the following two. procedures and a main procedure. Each procedure must work exactly as described in the following. - Procedure ReadAndAverage: It reads the number of students N (should be an integer between 1 and 10 ). If N is invalid, the procedure stops and returns 1 in the AL register (invalid input). If N is valid, the procedure attempts to read N scores (each should be an integer between 0 and 100), stores them in an array SCORES, and calculates their average AVG (AVG = quotient of sum/N ). While reading the scores, if any of them is invalid (not between 0 and 100 ), then the procedure stops reading and returns 1 in the AI register (invalid input). Otherwise, the procedure returns 0 in the AL register (valid input). - DisplayResults: This procedure displays the list of N scores each followed by a grade which is FAIL the score is less than the average AVG, or PASS otherwise. It also displays the value of the average AVC The format of the output should be the same as in the sample runs shown on the back page. Additional Notes: - You can find on the back page a description of the needed Irvine 32 library procedures. - Name your program file LABTESTxxxxx.asm, where xxxxx is your ID, and submit it on Moodle Run 1: (invalid number of students) tik ciWindowisystem 32 lamd exe Enter the number of students N (between 1 and 1 ): 2 Error: invalid input. The program is terminated. Press any key to continue rum o: (vaun input) ETI ClWindowslsystem 32/cm icexe Enter the number of students N (between 1 and 1e): 5 Enter the N student scores (each between e and 10): student scores and grades are: average is: 63 ss any key to continue

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 2 Lncs 8056

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013th Edition

3642401724, 978-3642401725

More Books

Students also viewed these Databases questions