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
Explain how to properly engage the safety latches on the Stan Design Pit Jack.
sattari [20]

The way to properly engage the safety latches on the Stan Design Pit Jack is:

  • Connect the hydraulic jack.
  • Make sure it is properly lubricated.
  • Ensure that the rolling bridge jack is well fused together.
  • Use the machine.

<h3>What is the Stan Design Pit Jack?</h3>

This refers to the machination which makes use of pit jacks to execute tire rotation in a fast lube pit.

We can note that based on the design, this machine is put in the pit of a car and then rolls back and forth and perform their operations on both the front and real axles.

Hence, it is important to note that the safety latches are designed to prevent work accidents and it is important to properly lubricate the parts to prevent damage.

Read more about safety latches here:
brainly.com/question/24573204

8 0
2 years ago
Which of the following activities could be considered unethical?
Zigmanuir [339]

Answer: u slap birds

Explanation: u order cheeseburgers with n cheese

8 0
3 years ago
A. For a 200g load acting vertically downwards at point B’, determine the axial load in members A’B’, B’C’, B’D’, C’D’ and C’E’.
Nonamiya [84]

Answer:

attached below

Explanation:

7 0
3 years ago
Order of Design Process steps ?
gregori [183]

Answer:

The five stages of Design Thinking, according to d.school, are as follows: Empathise, Define , Ideate, Prototype, and Test. Let's take a closer look at the five different stages of Design Thinking

Explanation:

5 0
3 years ago
Some_____
Thepotemich [5.8K]

Answer:

it’s IGS

Explanation:

because i read

5 0
3 years ago
Other questions:
  • Suppose you are designing a sliding window protocol for a 1 Mbps point-to-point link to the moon, which has a one-way latency of
    10·1 answer
  • Please read
    6·1 answer
  • A polymeric extruder is turned on and immediately begins producing a product at a rate of 10 kg/min. An operator realizes 20 min
    12·1 answer
  • An aircraft component is fabricated from an aluminum alloy that has a plane strain fracture toughness of 40 MPa . It has been de
    7·1 answer
  • WHAT IS THE MOST POWERFUL PART IN A CAR
    13·2 answers
  • Which of the following units of measurement is denoted by a single apostrophe mark (')?
    6·1 answer
  • Which design activity is part of the design for manufacturability (DFM) methodology?
    10·1 answer
  • Match the scenario to the problem-solving step it represents.
    7·1 answer
  • Technician A says power steering pumps can be engine driven. Technician B says power steering
    9·1 answer
  • (a) calculate the moment at point "c", where point "c" is the square 3'' below the centroid
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!