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
La Patrulla Fronteriza de los Estados Unidos analiza la compra de un helicóptero nuevo para la vigilancia aérea de la frontera d
patriot [66]

Answer:

The Border Patrol of the United States analyzes the purchase of a new helicopter for the aerial surveillance of the border of New Mexico and Texas with the Mexican Republic. 4 years ago a similar helicopter was purchased at a cost of $ 140,000.00. with an interest rate of 7% per year. Calculate the single payment factor and the present value factor with the above data with the table and formula. Draw the flow chart.

Explanation:

7 0
3 years ago
An insulated 40 ft^3 rigid tank contains air at 50 psia and 580°R. A valve connected to the tank is now opened, and air is allow
Pachacha [2.7K]

Answer:

The answer is "\bold{W_{in} = 645.434573 \ Btu}".

Explanation:

Its air enthalpy is obtained only at a given temperature by A-17E.  

The solution from the carbon cycle is acquired:

\to \Delta U= W_{in}-m_{out}h_{out}=0\\\\\to W_{in} = (m_1 - m_2)h

           =\frac{Vh}{RT}(P_1- P_2)\\\\= \frac{40 \times 138.66}{0.3704\times 580}(50-25) Btu\\\\= \frac{5,546.4}{214.832}(25) Btu\\\\= 25.8173829(25) Btu\\\\ =645.434573 Btu

W_{in} = 645.434573 \ Btu

8 0
3 years ago
Many of the problems applied scientists address are multidisciplinary issues and therefore require the collaboration of scientis
Alex17521 [72]
Scientists have studied global warming for more than 100 years. Thousands of experts have tested hypotheses, gathered evidence, constructed models, debated results, and reviewed one another’s work. Thousands of papers are written every year, produced from nearly every leading university and research institution on Earth—from Harvard to NASA and the US Department of Defense.

The consensus couldn’t be clearer. Climate change is happening. It’s caused primarily by the burning of oil, gas, and coal. If we do nothing, the world will become significantly less habitable.

We’ve lost precious time, but if we act now—decisively and dramatically—we still have a chance at avoiding climate change’s most catastrophic impacts
4 0
3 years ago
Water is pumped from one large reservoir to another at a higher elevation. If the flow rate is 2.5 ft3 /s and the pump delivers
4vir4ik [10]

Answer:

2132hp  ed enregia

e

Explanation:

dawdsawdsawdsawdsawdsawdsawdaas

6 0
4 years ago
What Do Solar Engineers Do?
konstantin123 [22]
Plan, design, and implement solar energy projects
7 0
3 years ago
Other questions:
  • To be able to write an ss-domain equation for a circuit, use partial fraction decomposition to separate the terms in this equati
    12·1 answer
  • What is the deflection equation for a simply supported beam with a uniformly distributed load?
    9·1 answer
  • slader A heat pump cycle is used to maintain the interior of a building at 15°C. At steady state, the heat pump receives energy
    7·2 answers
  • I was grumpy with her when she came over because she forgot something we planned to do.I offered to pick her up down town while
    12·1 answer
  • technician A says that a technician can progress to different jobs within the industry. Technician B says that career in the aut
    5·1 answer
  • A woman approaches a room attendant with a letter. She requests that the attendant leave the letter in Room 1201. Which is the m
    9·1 answer
  • ____________ is the range of all the colors created by different amounts of light.
    8·2 answers
  • A college student volunteers with the elderly in a hospice program and discovers her clients complain of dry skin. She has an id
    13·2 answers
  • Who is responsible for shielding a welding arc to protect
    11·1 answer
  • et G = (V, E) be a directed graph in which each vertex in u E V is labeled with a unique integer L(u) from the set {1, 2 ...,V]}
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!