Search for question
Question

Write a MIPS program that asks the user for a string of 30 ASCII characters or less. Store the input in an array called buffer. If the user does not enter any characters (only presses the enter key), then the program terminates with the error message: "No input. Run again.". Do not test the case when the user enters more than 30 characters. We will assume that they never do that. The program will then ask the user for an integer number greater than 0. If the user enters a number less than or equal to zero or just presses enter, the program terminates with the error message: "Wrong input. Run again". We will assume the user will always enter numbers. If the number is greater than zero, the program then shifts the characters in the string by the number entered by the user. Do this shift by copying the characters into a second array called buffer2. It then displays those shifted characters to the user adding a square bracket before and after the output. Make your program's output display as shown here: Input a string 30 characters or less: My name is Bob. Input an integer greater than 0:4 Shifted string = [ame is Bob.My ]

Fig: 1