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
Question 9 of 25
mafiozo [28]

Answer:

D

Explanation:

took test failed question D is the right answer

3 0
3 years ago
15- Vipsana's Gyros House sells gyros. The cost of ingredients (pita, meat, spices, etc.) to make a gyro is $2.00. Vipsana pays
sineoko [7]
D is a great answer
4 0
2 years ago
Takt time is the rate at which a factory must produce to satisfy the customer's demand. a)- True b)- False
laila [671]

Answer: a)True

Explanation: Takt time is defined as the average time difference between  the production of the two consecutive unit of goods by the manufacturer and this rate is matched with the demand of the customer. This is the time which is calculated to find the acceptable time for which the goods unit must be produced  by the factory to meet the needs of the customer. Therefore , the statement is true that takt time is the rate at which a factory must produce to satisfy the customer's demand.

6 0
3 years ago
When do you know if you start volly ball
igomit [66]
Answer You ask your coach
7 0
3 years ago
This problem has been solved!
lisov135 [29]

Answer: a) 135642 b) 146253

Explanation:

A)

1- the bankers algorithm tests for safety by simulating the allocation for predetermined maximum possible amounts of all resources, as stated this has the greatest degree of concurrency.

3- reserving all resources in advance helps would happen most likely if the algorithm has been used.

5- Resource ordering comes first before detection of any deadlock

6- Thread action would be rolled back much easily of Resource ordering precedes.

4- restart thread and release all resources if thread needs to wait, this should surely happen before killing the thread

2- only option practicable after thread has been killed.

Bii) ; No. Even if deadlock happens rapidly, the safest sequence have been decided already.

5 0
2 years ago
Other questions:
  • Data becomes information when it is__________ in some way and made___________
    5·1 answer
  • 3. When performing overhead work on scaffolding, what protective measures must be taken to prevent objects
    9·1 answer
  • A square isothermal chip is of width w = 5 mm on a side and is mounted in a substrate such that its side and back surfaces are w
    7·1 answer
  • Might give brainliest
    8·1 answer
  • A 230 V shunt motor has a nominal armature current of 60 A. If the armature resistance is 0.15 ohm, calculate the following: a.
    5·1 answer
  • Products. of sheet metal​
    8·1 answer
  • If you log into the admin account on windows 10, will the admin be notified ? ​
    14·2 answers
  • Anything you want to do in Hootsuite can be found in the ________, with the main workspace in the _________?
    15·1 answer
  • Agricultural economics is a study of how agriculture and business are related.<br> False<br> True
    15·1 answer
  • It tells the amount of materials to be purchased.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!