subject
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:

ansver
Answers: 2

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, viicborella
Steel is coated with a thin layer of ceramic to protect against corrosion. what do you expect to happen to the coating when the temperature of the steel is increased significantly? explain.
Answers: 1
image
Engineering, 04.07.2019 18:10, ashleybaber4966
If a particle moves along a path such that r : (3 sin t) m and ? : 2t rad, where t is in seconds. what is the particle's acceleration in m/s in 4 seconds? a)- 16.43 b)- 16.29 c)- 15.21 d)- 13.79
Answers: 1
image
Engineering, 04.07.2019 18:10, selenamr
Ifa component is made of two or more materials with different modulus of elasticity (e), it is called a composite member and we calculate the factor·n". mention the formula for calculating n". also, ifn> 1, explain what will happen to the 1. transformed. gi) ifn 1, what will happen to the material when transformed material when
Answers: 1
image
Engineering, 04.07.2019 18:20, jessie8022
Apiston-cylinder device contains 0.1 m3 of liquid water and 0.9 m3 of water vapor in equilibrium at 800 kpa. heat is transferred at constant pressure until the temperature of water reaches 350 °c. determine (a) the quality of water at the initial state (b) the work associated with this process, (c) the heat associated with this process.
Answers: 2
You know the right answer?
The following code contains several nested if-else statements. unfortunately,

it

Questions in other subjects:

Konu
Computers and Technology, 23.07.2019 17:50