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
A gas mixture containing 3 moles CO2, 5 moles H2 and 1 mole water is undergoing the following reactions CO2+3H2 →cH3OH + H2O Dev
Ilya [14]
Aaaaaaaaaaaaaaaaaaaaaa
7 0
2 years ago
Use the results of Prob. 5–82 for plane strain near the tip with u 5 0 and n 5 13. If the yieldstrength of the plate is Sy, what
rosijanka [135]

Answer:

Kindly follow the steps as shown below.

Explanation:

8 0
3 years ago
The Stefan-Boltzmann law can be employed to estimate the rate of radiation of energy H from a surface, as in
Mazyrski [523]

Explanation:

A.

H = Aeσ^4

Using the stefan Boltzmann law

When we differentiate

dH/dT = 4AeσT³

dH/dT = 4(0.15)(0.9)(5.67)(10^-8)(650)³

= 8.4085

Exact error = 8.4085x20

= 168.17

H(650) = 0.15(0.9)(5.67)(10^-8)(650)⁴

= 1366.376watts

B.

Verifying values

H(T+ΔT) = 0.15(0.9)(5.67)(10)^-8(670)⁴

= 1542.468

H(T+ΔT) = 0.15(0.9)(5.67)(10^-8)(630)⁴

= 1205.8104

Error = 1542.468-1205.8104/2

= 168.329

ΔT = 40

H(T+ΔT) = 0.15(0.9)(5.67)(10)^-8(690)⁴

= 1735.05

H(T-ΔT) = 0.15(0.9)(5.67)(10^-8)(610)⁴

= 1735.05-1059.83/2

= 675.22/2

= 337.61

5 0
3 years ago
What type of spring is mounted on a mcpherson strut suspension system?
AysviL [449]

Answer:

Coil Spring

Explanation:

6 0
2 years ago
Steam enters a steady-flow adiabatic nozzle with a low inlet velocity (assume ~0 m/s) as a saturated vapor at 6 MPa and expands
Sergio [31]
Yea bro I don’t really know
7 0
2 years ago
Other questions:
  • The boiler pressure is 38bar and the condenser pressure 0.032 bar.The saturated steam is superheated to 420 oC before entering t
    8·1 answer
  • In the 1960s through 1980s, a medical filter manufacturer in Ann Arbor discharged 1,4-dioxane (an industrial solvent) directly i
    10·1 answer
  • List the three main methods employed in dimensional analysis
    6·1 answer
  • ). A 50 mm diameter cylinder is subjected to an axial compressive load of 80 kN. The cylinder is partially
    8·1 answer
  • A 220-V electric heater has two heating coils that can be switched such that either coil can be used independently or the two ca
    15·1 answer
  • The cold drawn AISI 1040 steel bar with 25-mm width and 10-mm thick has a 6- mm diameter thru hole in the center of the plate. T
    10·1 answer
  • 6. Question
    13·1 answer
  • The website of a bank that an organization does business with has been reported as untrusted by the organization's web browser.
    12·1 answer
  • What is the difference between a modular home and a manufactured home?
    5·1 answer
  • 3. If nothing can ever be at absolute zero, why does the concept exist?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!