1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alexandra [31]
3 years ago
14

Integer to Float Conversion All labs must be done during lab time. Each labs worth 10 points The lab can be hand in next day wit

h 2 points penalty. Remember: Grading will be on program correctness and comment completeness. (Every line of code should be commented. Also be sure to fill out the template comments.) Write a program that prompt the user for a temperature in Celsius and then display the result in Fahrenheit. Sample Output: Please input a temperature in Celsius => 39 The temperature in Fahrenheit is: => 102.19999695
Engineering
1 answer:
andrew-mc [135]3 years ago
4 0

Answer:

Code explained below

Explanation:

.data

msg1: .asciiz "Please input a temperature in celsius: "

msg2: .asciiz "The temperature in Fahrenheit is: => "

num: .float 0.0

.text

main:

#print the msg1

li $v0, 4

la $a0, msg1

syscall

#read the float value from user

li $v0,6 #read float syscall value is $v0

syscall #read value stored in $f0

#formula for celsius to fahrenheit is

#(temperature(C)* 9/5)+32

#li.s means load immediate float

#copy value 9.0 to $f2

li.s $f2,9.0  

#copy value 5.0 to $f3

li.s $f3,5.0

# following instructions performs: 9/5

#div.s - division of two float numbers

#divide $f2 and f3.Result will stores in $f1

div.s $f1,$f2,$f3

#following instruction performs: temperature(C) * (9/5)

#multiple $f1 and $f0.Result stored in $f1

mul.s $f1,$f1,$f0

#copy value 32 to $f4

li.s $f4,32.0

#following instruction performs: (temperature(C) * (9/5))+32

#add $f1 and $f4.Result stores in $f1

add.s $f1,$f1,$f4

#store float from $f1 to num

s.s $f1,num

#print the msg2

li $v0, 4 #print string syscall value is 4

la $a0, msg2 #copy address of msg2 to $a0

#print the float

syscall

li $v0,2 #print float syscall value is 2

l.s $f12,num #load value in num to $f12

syscall

#terminate the program

li $v0, 10 #terminate the program syscall value is 10

syscall

You might be interested in
Cite another example of information technology companies pushing the boundaries of privacy issues; apologizing, and then pushing
Alexxx [7]

Answer:

Explanation:

Tech Social Media giant FB is one of those companies. Not long ago the ceo was brought to court to accusations that his company was selling user data. Turns out this is true and they are selling their users private data to companies all over the word. Once the news turned to something else, people focused on something new but the company still continues to sell it's users data the same as before. This is completely unethical as the information belongs to the user and they are not getting anything while the corporation is profiting.

7 0
3 years ago
Ventajas motor avion
Sauron [17]

Answer:

Explanation:

Usar motores eléctricos en aviones ofrece numerosas ventajas reales. A diferencia de los motores de combustión interna los motores eléctricos no necesitan aire para funcionar, lo que significa que pueden mantener toda su capacidad y potencia incluso a altitudes elevadas donde el aire es más tenue.

4 0
3 years ago
Which band has an average of $3.58 per hour of parking?
Minchanka [31]
C it would be c because that has more and the others have less
6 0
2 years ago
Câu 1: Tìm từ trong 2 câu thơ sau liên quan đến các từ: hình chiếu, tia chiếu, mặt phẳng chiếu.
xeze [42]

Explanation:

are bhai brainly aap english me questions kar ne ko hai

ye kon si bhasha hai ??????

4 0
2 years ago
List six possible valve defects that should be included in the inspection of a used valve?
olchik [2.2K]

Answer:

Valvular stenosis , Valvular prolapse , Regurgitation,

Explanation:

8 0
3 years ago
Other questions:
  • A pipe of 10 cm inner diameter is used to send crude oil over distance of 400 meters. The entire pipe was laid horizontal. The v
    5·1 answer
  • A photovoltaic panel of dimension 2m×4m is installed on the
    14·1 answer
  • Water of dynamic viscosity 1.12E-3 N*s/m2 flows in a pipe of 30 mm diameter. Calculate the largest flowrate for which laminar fl
    13·1 answer
  • An MRI technician moves his hand from a region of very low magnetic field strength into an MRI scanner’s 2.00 T field with his f
    5·1 answer
  • What is a rivet and how do tehey work
    14·1 answer
  • Which of the following is part of the highway
    11·2 answers
  • Describe a pro and con of having a passenger in the car
    11·1 answer
  • Which of these parts of a cell phone is least likely to be found on the phone's circult board?
    5·1 answer
  • Time left 0:35:32 Three steel rod (E = 200 GPa) supports 36 KN Load P. Each of the rods AB and CD has a 200 mm? cross- sectional
    13·1 answer
  • A ____ is either in the pressure reducer or in the downstream side of the system to ensure that the control air pressure does no
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!