Question

In: Computer Science

7) Write a program to open an input dialog box and read a string value. Write...

7) Write a program to open an input dialog box and read a string value. Write the string back to
the user using a message box.

USING MIPS ASSEMBLY LANGUAGE

Solutions

Expert Solution

# Code:

.data
   # prompt message for user
   prompt: .asciiz "Please write a string: "
   # space to store user response
   userResponse: .space 100
.text
   .globl main
main:
   # Getting user input in dialog box
   la $a0, prompt # loads address of the prompt message
   la $a1, userResponse # loads address of the space
   li $a2, 100 # the limit of user response
   li $v0, 54   # syscall code for InputDialogBox
   syscall
  
   # Printing the string back on message box
   la $a0, userResponse # address of string to be displayed
   li $a1, 1   # type of message 1 means "Informational message"
   li $v0, 55   # syscall code for messageBox
   syscall
  
   # Exit the program
   li $v0, 10
   syscall

OUTPUT:

# Input Box

# Output box


Related Solutions

Please write a java program (using dialog box statements for user input) that has the following...
Please write a java program (using dialog box statements for user input) that has the following methods in it: (preferably in order)   a method to read in the name of a University and pass it back a method to read in the number of students enrolled and pass it back a method to calculate the tuition as 20000 times the number of students and pass it back a method print the name of the University, the number of students enrolled,...
For input you can either a console Scanner or a dialog box (a modal dialog) and...
For input you can either a console Scanner or a dialog box (a modal dialog) and the static method showInputDialog() of the JOptionPane class which is within the javax.swing package like this String name= newJOptionPane.showInputDialog(” Please enter your data:”). Then convert the String object to a number using Integer.parseInt() or Double.parseDouble() ---- Write a java the ”Letter grade” program that inputs several test scores from user and displays for each the corresponding letter grade using a scale 90 – 80...
For input you can either a console Scanner or a dialog box (a modal dialog) and...
For input you can either a console Scanner or a dialog box (a modal dialog) and the static method showInputDialog() of the JOptionPane class which is within the javax.swing package like this String name= newJOptionPane.showInputDialog(” Please enter your data:”). Then convert the String object to a number using Integer.parseInt() or Double.parseDouble() --- Write a java ”Statistics program” to calculate the mean, variance and standard deviation for a given set of numbers. The user in entering the data interactively. The size...
For input you can either a console Scanner or a dialog box (a modal dialog) and...
For input you can either a console Scanner or a dialog box (a modal dialog) and the static method showInputDialog() of the JOptionPane class which is within the javax.swing package like this String name= newJOptionPane.showInputDialog(” Please enter your data:”). Then convert the String object to a number using Integer.parseInt() or Double.parseDouble() ----- . If an amount of A dollars is borrowed at an interest rate (expressed as a decimal) r for y years, and n is the number of annual...
For input you can either a console Scanner or a dialog box (a modal dialog) and...
For input you can either a console Scanner or a dialog box (a modal dialog) and the static method showInputDialog() of the JOptionPane class which is within the javax.swing package like this String name= newJOptionPane.showInputDialog(” Please enter your data:”). Then convert the String object to a number using Integer.parseInt() or Double.parseDouble() ----- Write a Java program to calculate the first n ( the user enters the integer n) rows of the Pascal triangle. On demand display the first n rows...
Write a C++ Program Write a program that prompts the user to input a string. The...
Write a C++ Program Write a program that prompts the user to input a string. The program then uses the function substr to remove all the vowels from the string. For example, if str=”There”, then after removing all the vowels, str=”Thr”. After removing all the vowels, output the string. Your program must contain a function to remove all the vowels and a function to determine whether a character is a vowel. You must insert the following comments at the beginning...
Write a program that prompts the user to input a string. The program then uses the...
Write a program that prompts the user to input a string. The program then uses the function substr to remove all the vowels from the string. For example, if str=”There”, then after removing all the vowels, str=”Thr”. After removing all the vowels, output the string. Your program must contain a function to remove all the vowels and a function to determine whether a character is a vowel. You must insert the following comments at the beginning of your program and...
In Python Write a function to read a Sudoku board from an input string. The input...
In Python Write a function to read a Sudoku board from an input string. The input string must be exactly 81 characters long (plus the terminating null that marks the end of the string) and contains digits and dots (the `.` character represents an unmarked position). The input contains all 9 rows packed together. For example, a Sudoku board that looks like this: ``` ..7 ... ... 6.4 ... ..3 ... .54 ..2 ... .4. ... 9.. ... ..5 385...
Write a C program that will read a character string and then encrypt the string based...
Write a C program that will read a character string and then encrypt the string based on one of the 3 different encryption methods. The type of encryption is to be selected by the user. Encryption method 1: Swapping by position. Characters in the array are swapped with the opposite characters based on their position in the string. Example: Input string – apple. Encrypted string – elppa Method: The first character ‘a’ and the last character ‘e’ – swap their...
Write a Python program which prompts the user to input a string. Then, print the string...
Write a Python program which prompts the user to input a string. Then, print the string in reverse to the terminal Sample output Please enter a word: "zeus" The reverse of zeus is suez Hint: There are several ways to accomplish this. Recall that a string is an itterable object and therefore can be used with a for loop
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT