Task 3 [35 marks] Write a MIPS program that does the following (in a correct, user-friendly way): Greets the user, states the purpose of the program Sequentially asks the user to provide integer coefficients A,B,C Calculates discriminant D of quadratic polynomial. (Hint: D = B2 – 4×A×C) Displays the calculated D value Checks (in this order) whether discriminant is: o D = 0? Then, displays: “Quadratic polynomial has a sole root.” o D > 0? Then, displays: “Quadratic polynomial has two roots.” o Otherwise, displays: “Quadratic polynomial has no real roots.” Properly terminates with appropriate closing message. Make sure to show the following items: Source code in a readable, well-formatted (tabulated, commented) way Screenshot of PC SPIM showing the emulator with your code successfully loaded Screenshots of PC SPIM console displaying the results of running your program with the following test inputs: o A = 3; B = 4; C = 5 o A = 2; B = 6; C = 2 o A = 4; B = 8; C = 4
.data
msg1: .asciiz "Enter A: "
msg2: .asciiz "Enter B: "
msg3: .asciiz "Enter C: "
msg4: .asciiz "\nQuadratic polynomial has a sole root.\n"
msg5: .asciiz "\nQuadratic polynomial has two root.\n"
msg6: .asciiz "\nQuadratic polynomial has no real root.\n"
msg7: .asciiz "End of the program"
msg8: .asciiz "\nD = "
.text
main:
#print the msg1
li $v0, 4 #print string syscall value is 4
la $a0, msg1 #copy address of msg1 to $a0
syscall
#read value A
li $v0,5 #read integer syscall value is 5
syscall #read value stored in $v0
move $t0,$v0
#print the msg2
li $v0, 4 #print string syscall value is 4
la $a0, msg2 #copy address of msg2 to $a0
syscall
#read value B
li $v0,5 #read integer syscall value is 5
syscall #read value stored in $v0
move $t1,$v0
#print the msg3
li $v0, 4 #print string syscall value is 4
la $a0, msg3 #copy address of msg3 to $a0
syscall
#read value C
li $v0,5 #read integer syscall value is 5
syscall #read value stored in $v0
move $t2,$v0
mul $t3,$t1,$t1
li $s0,4
mul $t4,$s0,$t0
mul $t4,$t4,$t2
sub $t3,$t3,$t4
#print the msg8
li $v0, 4 #print string syscall value is 4
la $a0, msg8 #copy address of msg8 to $a0
syscall
#print D value
li $v0,1 #print integer syscall value is 1
move $a0,$t3 #copy $t3 to $a0
syscall
beq $t3,$zero,if
bgt $t3,$zero,else
# D < 0
#print the msg6
li $v0, 4 #print string syscall value is 4
la $a0, msg6 #copy address of msg6 to $a0
syscall
#jump tp exit
j exit
# D = 0
if:
#print the msg4
li $v0, 4 #print string syscall value is 4
la $a0, msg4 #copy address of msg4 to $a0
syscall
#jump to exit
j exit
# D > 0
else:
#print the msg5
li $v0, 4 #print string syscall value is 4
la $a0, msg5 #copy address of msg5 to $a0
syscall
exit:
#print the msg7
li $v0, 4 #print string syscall value is 4
la $a0, msg7 #copy address of msg7 to $a0
syscall
#terminate the program
li $v0, 10 #terminate the program syscall value 10
syscall





Hope this helps...!
Task 3 [35 marks] Write a MIPS program that does the following (in a correct, user-friendly...
4-6 on matlab
4. Write a program in a script file that determines the real roots of a quadratic equation ax2+bx+c 0 When the file runs, it asks the user to enter the values of the constants a, b, and c. To calculate the roots of the equation the program calculates the discriminant D, given by: D b2-4ac When D 0, the program displays message "The equation has two roots," and the roots are displayed in the next line. When...
c++ language
TECH 1211 Computer Programming Name Test 2 Hands-On-Program B Spring 2020 Write a program that uses the quadratic formula to solve quadratic equations. Background Given the format for a quadratic equations: aX? +BX+C =0 The coefficient of the X term is the number a. The coefficient of the X term is the number b. The value of c is any non-zero constant. These values can be positive, negative or zero. You can find the solution to this equation...
1. Write and debug a MIPS program that performs the following operations . Prompt for and input three integers "a", "b and "c" using syscalls (3 points) Print all numbers starting from "a" upto "b" (including, but not exceeding "b") at an increment equal to value of"c"(5 points) If ba, then no numbers are printed, and a message is printed to inform it to the user. (3 points) Print the number and average of the generated numbers printed. (3 points)...
Write a C++ program to compute both roots of the quadratic equation when the user provides the three coefficients A, B, and C. Specifically, A. Display “Your Name” B. Display “Project_2 Problem_1” C. Display “This program computes both roots of a quadratic equation” D. Display “given the coefficients A, B, and C” E. Real_1 = 0 F. Real_2 = 0 G. Imag = 0 H. D = 0 I. DD =0 J. Flag = ‘Y’ K. DO a. A =...
Write a python program that does the following. a. It asks the user to enter a 5-digit integer value, n. b. The program reads a value entered by the user. If the value is not in the right range, the program should terminate. c. The program calculates and stores the 5 individual digits of n. d. The program outputs a “bar code” made of 5 lines of stars that represent the digits of the number n. For example, the following...
DQuestion 19 28 pts Problem 2. Quadratic Equations A quadratic equation has the form: a bc0 The two solutions are given by the formula: 2a Write a program with a loop that a) solves quadratic equations with coefficients read from the terminal, b) visualizes the corresponding quadratic function az2 brc0using the matplotlib module. Instructions Write all code for this problem in a file p2.py 1. The program consists of a main whtle loop (an infinite loop) in which the user...
Introduction Write a MIPS program to allow a user to play a simple variation of the game BINGO. Your program should display the following game board and the player wants to choose a location to mark BINGO A position can be marked by entering its column letter (eit B', 'I', 'N' 'G', or CO and row number (either 1, 2, 3, 4, or 5). An 'X' should mark the positions already marked. An underscore, e C 1 should represent unmarked...
Need help with number 3, thanks!
isplays l itnuml is less than num2. 2. (50+30- 80 Points) Write a MATLAB function numcomp502 (numl, num2) that takes two numbers numl and as input and returns num3 as output, such that num3 is equal to 0, 1, and-1 depending on whether numl is equal to, greater than or less than num2 respectively. Test your code with the pairs (10, 5), (-3,-3), and (2, 10) as input. Attach a screen-shot. 3. 80 Points...
Write a C program that does the following: • Displays a menu (similar to what you see in a Bank ATM machine) that prompts the user to enter a single character S or D or Q and then prints a shape of Square, Diamond (with selected height and selected symbol), or Quits if user entered Q. Apart from these 2 other shapes, add a new shape of your choice for any related character. • Program then prompts the user to...