Engineering
Engineering, 16.01.2020 04:31, Disd112984

The following code contains several nested if-else statements. unfortunately,

it

##was written without proper alignment and indentation. rewrite the code and use

the

##proper conventions of alignment and indentation.

## start with input('enter integer score: ') for the variable score.

##a_score = 90

##b_score = 80

##c_score = 70

##d_score = 60

##if score > = a_score:

##print('your grade is a.')

##else:

##if score > = b_score:

##print('your grade is b.')

##else:

##if score > = c_score:

##print('your grade is c.')

##else:

##if score > = d_score:

##print('your grade is d.')

##else:

##print('your grade is f.')



##5. write an if-else statement that assigns true to the again variable if the

##score variable is within the range of 10 to 59. if the score variable’s value

##is outside this range, assign false to the again variable. print the answer.

##start your code with the following:

##test1 = int(input('enter your test1 score: '))

##test2 = int(input('enter your test2 score: '))

##hw = int(input('enter your homework score: '))

##cw = int(input('enter your classwork score: '))

##totals = 0.25*test1 + 0.25*test2 + 0.35*hw + 0.15*cw

## write your code here

##print('is it true that i have to repeat the course again? ' , again )



##6. write nested decision structures that perform the following: if amount1 is

##greater than 10 and amount2 is less than 100, display the greater of amount1

##and amount2.

##solution:

##if amount1 > 10 and amount2 < 100:

## if amount1 > amount2:

## print (amount1)

## elif amount2 > amount1:

## print (amount2)

##else:

## print('both values are the same.')

##

6.1. further extension of 6. write nested decision structures that perform the

##following: if amount1 is greater than 10 and amount2 is less than 100,

##display the greater of amount1 and amount2 if the difference between them is

##more than 33, if not - display the minimum of these amounts.

##start with input('enter integer amount1: ') and input('enter integer amount2: ')

##for these amounts.

##write your code here:

answer
Answers: 2

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 23:20, abbz13
Two technicians are discussing the intake air temperature (iat) sensor. technician a says that the computer uses the iat sensor as a backup to the engine coolant temperature (ect) sensor. technician b says that the powertrain control module (pcm) will subtract the calculated amount of fuel if the air measures hot. who is correct
Answers: 3
image
Engineering, 04.07.2019 18:10, anna22684
Water at 70°f and streams enter the mixing chamber at the same mass flow rate, determine the temperature and the quality of the exiting stream. 0 psia is heated in a chamber by mixing it with saturated water vapor at 20 psia. if both streams enters the mixing chamber at the same mass flow rate, determine the temperature and the quality of the existing system.
Answers: 2
image
Engineering, 04.07.2019 18:20, sanchez626
Aheavily insulated piston-cylinder device contains 0.02 m3 of steam at 300 kpa and 200 °c. 1.2 mpa. d this process. team is now compressed in a reversible manner to a pressure of etermine the entropy change and the work done on the steam during this process
Answers: 1
image
Engineering, 04.07.2019 19:20, natalie2sheffield
Acompressor compresses a gas, a pump compresses a liquid. for a given pressure ratio, why does it take more work to compress a gas in a compressor than a liquid in a pump? a)- for a given pressure ratio the average specific volume for a gas is much higher than the average specific volume for a liquid. b)- there is no difference. the only difference is the amount of heat generated (not work) c)- for a given pressure ratio the average volurge for a gas is much higher than the average volume for a liquid. d)-there is no difference
Answers: 3
Do you know the correct answer?
The following code contains several nested if-else statements. unfortunately,

it

Questions in other subjects:

Konu
Biology, 15.06.2021 07:30