Question: Write a MARIE assembly language program that calculates and displays the perimeter or the area of a rectangle, given the length of each side, depending

Write a MARIE assembly language program that calculates and displays the perimeter or the area of a rectangle, given the length of each side, depending on the users input.

The user should be prompted to enter the length of each of the sides as decimal values; once these values have been read by the program, provide the user with the option to select which calculation to perform on the rectangle. This prompt is expecting the user to input an ASKII character.

The application should accept a character corresponding to one of the actions: P for Perimeter or A for Area. If the ASKII letter is not A or P, the program outputs -1 to the console. The output should be the result of your calculation (or -1). For example, if the input is:

 4 (for one side) 5 (for the other side) A (for calculation type) 

Your program should print:

20

Your program should be preceded by a comment block with your name, the course and section numbers, the project name, the program purpose, along with a description of the input and a description of the output. Be sure to include appropriate comments throughout your code, choose meaningful identifiers, and use indentation as shown in your textbook and in class. Your filename should be RectangleOperations.mas.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!