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 Pelton wheel is supplied with water from a lake at an elevation H above the turbine. The penstock that supplies the water to t
gayaneshka [121]

Answer:

Following are the proving to this question:

Explanation:

\frac{D_1}{D} = \frac{1}{(2f(\frac{l}{D}))^{\frac{1}{4}}}

using the energy equation for entry and exit value :

\to \frac{p_o}{y} +\frac{V^{2}_{o}}{2g}+Z_0  = \frac{p_1}{y} +\frac{V^{2}_{1}}{2g}+Z_1+ f \frac{l}{D}\frac{V^{2}}{2g}

where

\to p_0=p_1=0\\\\\to Z_0=Z_1=H\\\\\to v_0=0\\\\AV =A_1V_1 \\\\\to V=(\frac{D_1}{D})^2 V_1\\\\\to V^2=(\frac{D_1}{D})^4 V^{2}_{1}

         = (\frac{1}{(2f (\frac{l}{D} ))^{\frac{1}{4}}})^4\  V^{2}_{1}\\\\

         = \frac{1}{(2f (\frac{l}{D})  )} \  V^{2}_{1}\\

\to \frac{p_o}{y} +\frac{V^{2}_{o}}{2g}+Z_0  =\frac{p_1}{y} +\frac{V^{2}_{1}}{2g}+Z_1+ f \frac{l}{D}\frac{V^{2}}{2g} \\\\

\to 0+0+Z_0 = 0  +\frac{V^{2}_{1} }{2g} +Z_1+ f \frac{l}{D} \frac{\frac{1}{(2f(\frac{l}{D}))}\ V^{2}_{1}}{2g}   \\\\\to Z_0 -Z_1 = +\frac{V^{2}_{1}}{2g} \ (1+f\frac{l}{D}\frac{1}{(2f(\frac{l}{D}) )} )  \\\\\to H= \frac{V^{2}_{1}}{2g} (\frac{3}{2}) \\\\\to  \frac{V^{2}_{1}}{2g} = H(\frac{3}{2})

L.H.S = R.H.S

7 0
2 years ago
Diffrent ways to make a header above a window
Oliga [24]

Answer: double click at the top of the page. Or you can also go to home file and click add heading.

Explanation:

5 0
3 years ago
Ethylene glycol, the ingredient in antifreeze, does not cause health problems because it is a clear liquid.
netineya [11]
B. false

Explanation: because it is
5 0
2 years ago
What are the atomic binding force and energy? how do they relate to materials strength and thermal stability.
Elanso [62]

Answer:

As we know that every molecule is attached by a strong force .The force required to disassemble the atoms is know as atomic binding force or we can say that the force required to disassemble the electron from atoms is known as binding force.On the other hand the energy require to doing this is known as atomic binding energy.

If the binding force is high then it will become difficult to disassemble thermally as well as mechanically.So we can say that it have direct relationship with   materials strength and thermal stability.

7 0
2 years ago
How do you make a robotic dog
fredd [130]
In order to create a robotic dog, you are needing the necessary parts to create Goddard from Jimmy nutreon boy genius
7 0
3 years ago
Read 2 more answers
Other questions:
  • 7 Single-use earplugs require a professional fitting before they can be used.
    10·2 answers
  • What is the zone that has just been added to the exchange zone where athletes may now hand off the baton
    5·1 answer
  • Which statement about direct-mail messages is most accurate? Group of answer choices Direct mail is an effective channel for per
    15·1 answer
  • HELP PLEASE<br> this is for drivers ed btw
    5·1 answer
  • What considerations are included in the Preliminary Floodproofing/Retrofitting Preference Matrix?
    7·1 answer
  • What drives up the cost of consumables?
    6·1 answer
  • How to comment on brainly.com and I'm only 8-years-old so keep it simple please
    9·1 answer
  • Resistance depends on which three properties of a wire?
    15·1 answer
  • What is the purpose of placing a large electrolytic capacitor in the output side of a power supply
    11·1 answer
  • What is the importance of the causal link<br> in work accidents?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!