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
Ordan has _ 5 8 can of green paint and _ 3 6 can of blue paint. If the cans are the same size, does Jordan have more green paint
Morgarella [4.7K]

Answer:

Jordan has more green paints

Explanation:

Given

Green = \frac{5}{8}

Blue = \frac{3}{6}

Required

Which paint does he have more?

For better understanding, it's better to convert both measurements to decimal.

For the green paint:

Green = \frac{5}{8}

Green = 0.625

For the blue paint:

Blue = \frac{3}{6}

Blue = 0.5

By comparison:

0.625 > 0.5

<em>This means that Jordan has more green paints</em>

3 0
3 years ago
Given a two-dimensional steady inviscid air flow field with no body forces described by the velocity field given below. Assuming
kolbaska11 [484]

Answer:

the pressure gradient in the x direction = -15.48Pa/m

Explanation:

  • The concept of partial differentiation was used in the determination of the expression for u and v.
  • each is partially differentiated with respect to x and the appropriate substitution was done to get the value of the pressure gradient as shown in the attached file.

4 0
3 years ago
FAST PLLZZ!! Ideally, the backrest is tilted back slightly, so when you turn the wheel your shoulders are _______ the seat.
exis [7]

Answer:

touching

Explanation:

The backrest of the seat should be tilted back ever so slightly, and when turning the steering wheel your shoulders should remain in contact with the seat – rather than hunched forward.

8 0
3 years ago
Consider the following relational database that Best Airlines uses to keep track of its mechanics, their skills, and their airpo
Musya8 [376]

Answer:

Explanation:

A)

SELECT MECHNAME,AGE FROM MECHANIC;

B)

SELECT AIRNAME,SIZE FROM AIRPORT WHERE SIZE>=20 AND STATE='CALIFORNIA' AND YEAROPENED >=1935 ORDER BY SIZE ASC;

C)

SELECT AIRNAME,SIZE FROM AIRPORT WHERE (SIZE>=20 OR YEAROPENED >=1935) AND STATE='CALIFORNIA';

D)

SELECT AVG(SIZE) FROM AIRPORT WHERE STATE='CALIFORNIA' AND YEAROPENED >=1935;

E)

SELECT COUNT(AIRNAME) FROM AIRPORT WHERE STATE='CALIFORNIA' AND YEAROPENED >=1935;

F)

SELECT COUNT(AIRNAME),STATE FROM AIRPORT WHERE YEAROPENED>=1935 GROUP BY STATE;

G)

SELECT COUNT(AIRNAME),STATE FROM AIRPORT WHERE YEAR OPENED>=1935 GROUP BY STATE HAVING COUNT(*)>=5;

H)

SELECT MECHNAME FROM MECHANIC A JOIN AIRPORT B

ON A.AIRNAME=B.AIRNAME AND B.STATE='CALIFORNIA';

I)  

SELECT MECHNAME FROM MECHANIC A

JOIN QUALIFICATION B

ON A.MECHNUM=B.MECHNUM

AND B.PROFRATE=4

JOIN SKILL C

ON B.SKILLNUM=C.SKILLNUM

AND SKILLNAME='FAN BLADE RELACEMENT';

J)  SELECT MECHNAME FROM MECHANIC A

JOIN QUALIFICATION B

ON A.MECHNUM=B.MECHNUM

AND B.PROFRATE=4

JOIN SKILL C

ON B.SKILLNUM=C.SKILLNUM

AND SKILL NAME='FAN BLADE REPLACEMENT'

JOIN AIRPORT D

ON A.AIRNAME=D.AIRNAME

AND STATE='CALIFORNIA';

K)   SELECT SUM(SALARY),CITY FROM MECHANIC A

JOIN AIRPORT B

ON A.AIRNAME=B.AIRNAME

AND STATE='CALIFORNIA'

GROUP BY CITY;

L)   SELECT MAX(SIZE) FROM AIRPORT ;

M)  SELECT MAX(SIZE) FROM AIRPORT WHERE STATE='CALIFORNIA';

6 0
3 years ago
Doubling the diameter of a solid, cylindrical wire doubles its strength in tension.
julsineya [31]

Answer:

True ❤️

-Solid by solid can make Cylindrical wire doubles Strengths in tension

4 0
3 years ago
Other questions:
  • What is the energy change when the temperature of 15.0 grams of solid silver is decreased from 37.3 °C to 20.5 °C ?
    13·1 answer
  • Motion is defined as a change in an object's position when compared to other objects around it. Mary Ann was watching a slug cra
    10·1 answer
  • What is the ILS stand for
    8·2 answers
  • Architects design roads.<br><br> A. True<br> B. False
    9·2 answers
  • If the power to a condensing unit has been turned off for an extended period of time, the _________________________ should be en
    12·1 answer
  • Which state did NOT have people that got sick from the
    10·1 answer
  • An incremental encoder is rotating at 15 rpm. On the wheel there are 40 holes. How many degrees of rotation would 1 pulse be?
    11·1 answer
  • A cross beam in a highway bridge experiences a stress of 14 ksi due to the dead weight of the bridge structure. When a fully loa
    14·1 answer
  • Computer system analyst advantage​
    5·2 answers
  • How many times greater is the value of the 2 of the 270413 than the valuce of the 2 in 419427?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!