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
After a 65 newton weight has fallen freely from rest a vertical distance of 5.3 meters, the kinetic energy of the weight is
inysia [295]

Answer:

The kinetic energy of the weight is 344.5 J

Explanation:

Given that:

Force = F = 65 newton

distance = d = 5.3 meters

We have to find change in kinetic energy ΔK.E

Now we know that, initially kinetic energy was 0 So the formula we use will be:

Work done = Change in kinetic energy

Mathematically,

W =  ΔK.E

As we know W = F . d and  ΔK.E = K.E(final) - K.E(initial)

So by putting values:

F . d = K.E(final) - K.E(initial)

F . d = K.E(final)

As  K.E(initial) is 0 so by putting values of F and d

(65)* (5.3) =  K.E(final)

344.5 J =  K.E(final)

So the change in  K.E will also be 344.5 J

i hope it will help you!

3 0
3 years ago
An important ethical concern for behavior analysts involves special cautions in interactions with a client in any capacity outsi
Phoenix [80]

Answer:A and B are correct. one must take care to avoid violation of ethical codes regarding conflicts of interest and dual or multiple relationships

Explanation:

A conflict of interest (COI) is a situation in which a person or organization is involved in multiple interests, financial or otherwise, and serving one interest could involve working against another. 

4 0
3 years ago
If you are a government authority what extend will you modify the existing policy
mr_godi [17]

Answer:

kk

Explanation:

dkdndidodd ndidkjeeiwonejeeidmdnddkdidfmndd

4 0
4 years ago
It is not a practical proposition to take direct measurements in nanoscale, but we can estimate variations in position and momen
Volgvan

Answer:

Answer is c Heisenberg's uncertainty principle

Explanation:

According to Heisenberg's uncertainty principle there is always an inherent uncertainty in measuring the position and momentum of a particle simultaneously.

Mathematically

\Delta x\times \Delta \overrightarrow{p}\geq \frac{h}{4\pi }

here 'h' is planck's constant

7 0
3 years ago
1. Describe simply what will happen to an airplane in flight in the following conditions:
notka56 [123]

Answer:

For the two you haven't answered: (Drag greater than thrust, lift greater than weight) It will accelerate backwards (decelerate) and upwards

(Lift greater than weight, thrust greater than drag) accelerate upwards and forwards.

4 0
3 years ago
Other questions:
  • Nicholas wants to verify whether a file is a hard link to a file within the same directory. Which of the following commands coul
    6·1 answer
  • How are eras different from decades?
    5·1 answer
  • Which of the following is correct oil viscosity for hybrid electric vehicle?
    10·1 answer
  • The beam is supported by a pin at A and a roller at B which has negligible weight and a radius of 15 mm. If the coefficient of s
    7·1 answer
  • How can goal setting help with academic performance?
    13·1 answer
  • What is a rivet and how do tehey work
    14·1 answer
  • Nguyên lý hoạt động của kim phun
    7·1 answer
  • The annual average of solar photovoltaic energy in Phoenix is 6,720
    8·1 answer
  • 10) A pressure sensor consisting of a diaphragm with strain gauges bonded to its surface has the following information in its sp
    12·1 answer
  • The metric ruler is typically divided into
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!