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
Given the following access-control list: access-list 90 deny 10.168.7.0 0.0.0.255 access-list 90 permit host 10.168.7.10 access-
Yuri [45]

Answer:

D. Both hosts 10.168.7.10 and 10.168.7.11 will be permitted

Explanation:

access-list 90

deny 10.168.7.0 0.0.0.255

permit 10.168.7.10

permit 10.168.7.11

permit 10.168.7.12

deny any

7 0
2 years ago
The brakes are being bled on a passenger vehicle with a disc/drum brake system. Technician A says that the drums should be remov
exis [7]

The brakes are being bled on a passenger vehicle with a disc/drum brake system is described in the following

Explanation:

1.Risk: Continued operation at or below Rotor Minimum Thickness can lead to Brake system failure. As the rotor reaches its minimum thickness, the braking distance increases, sometimes up to 4 meters. A brake system is designed to take kinetic energy and transfer it into heat energy.

2.Since the piston needs to be pushed back into the caliper in order to fit over the new pads, I do open the bleeder screw when pushing the piston back in. This does help prevent debris from traveling back through the system and contaminating the ABS sensors

3.There are three methods of bleeding brakes: Vacuum pumping. Pressure pumping. Pump and hold.

4,Brake drag is caused by the brake pads or shoes not releasing completely when the brake pedal is released. ... A worn or corroded master cylinder bore causes excess pedal effort resulting in dragging brakes. Brake Lines and Hoses: There may be pressure trapped in the brake line or hose after the pedal has been released.

4 0
3 years ago
Do not discharge wastewater into storm sewers because they flow directly into local surface waters. A. true B. false
enot [183]

Answer:

True

Explanation:

Wastewater should never be discharged into storm sewers. Storm sewers are constructed to store rainwater.  

Rainwater passes through storm sewers to the nearest underground water resource if the wastewater discharge into storm sewers, then they will also pollute the ground water, so usually the dirty water is not put in the storm sewers.

3 0
3 years ago
Using the AASHTO procedure, determine the thickness required for a base and a surface layer over existing subgrade. The structur
garri49 [273]

Answer:

<u>the thickness required would be 12 inch HMA and granular base layer of 6 inches</u>

Explanation:

structural number = 4.5

stone base course material coefficient = 0.13

hma material layer coefficient = 0.40

drainage coefficient = 0.90

we will use layered analysis procedure to get thickness

D1 >= sN1/a1

when we cross multiply,

sN1 = a1D1 >=sN1

D2 >= -sN2-sN1/a2m2

sN2* + sN1* >= sN2

D3 >= sN3-(sN1*+sN2*)/a2m2

where a1,a2,a3 = layer coefficient

d1 d2 d3 = actual thickness

m2,m3 = coefficient of base

a1 = 0.4

a1 = 0.13

sN = 4.5

m2 = 0.9

D1 >= sN1/a1 = 4.5/0.4

= 11.25

thickness of surface = 12 inches

a1D1 = 0.4x12 = 4.8

we have value of sN2 = 5.5

(5.5 -4.8)/(0.13*0.9)

= 0.7/0.117

= 5.9829 inches

approximately 6 inches

so the pavement will have 12inch HMA surface and 6 inches granular base layer.

7 0
2 years ago
Retype the statements, correcting the syntax error in each print statement. print('Predictions are hard.") print(Especially abou
marshall27 [118]
Print(‘Predictions are hard’)
print(‘Especially about the future’)
user_num = 5
print(‘user_num is:’+str(user_num))

There are many ways to do the last print. Look up string interpolation
3 0
2 years ago
Other questions:
  • A commuter train traveling at 50 mi/h is 3 mi from a station. The train then decelerates so that its speed is 15 mi/h when it is
    9·1 answer
  • When fermentation units are operated with high aeration rates, significant amounts of water can be evaporated into the air passi
    13·1 answer
  • Plot the absorbance, A, versus the FeSCN2 concentration of the standard solutions (the values from your Pre-lab assignment). Fro
    7·1 answer
  • The rigid beam is supported by a pin at C and an A992 steel guy wire AB of length 6 ft. If the wire has a diameter of 0.2 in., d
    14·1 answer
  • Consider a modification of the air-standard Otto cycle in which the isentropic compression and expansion processes are each repl
    10·1 answer
  • A ball A is thrown vertically upward from the top of a 30-m-high building with an initial velocity of 5 m&gt;s. At the same inst
    8·1 answer
  • In homes today, what is behind the reason for flashover fires occurring much more rapidly than in the past generations?
    8·1 answer
  • A heat pump with refrigerant-134a as the working uid is used to keep a space at 25C by absorbing heat from geothermal water that
    5·1 answer
  • What are the horizontal structures beneath a slab that help transfer the load from the slab to the columns?
    14·2 answers
  • Instructions: For each problem, identify the appropriate test statistic to be use (t test or z-test). Then compute z or t value.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!