The following code contains several nested if-else statements. Unfortunately, it was written without proper alignment and indentation.
Question:
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.
Transcribed Image Text:
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.')
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 50% (2 reviews)
if score Ascore printYour grade is ...View the full answer
Answered By
Muhammad Umair
I have done job as Embedded System Engineer for just four months but after it i have decided to open my own lab and to work on projects that i can launch my own product in market. I work on different softwares like Proteus, Mikroc to program Embedded Systems. My basic work is on Embedded Systems. I have skills in Autocad, Proteus, C++, C programming and i love to share these skills to other to enhance my knowledge too.
3.50+
1+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Based on the dangling-else discussion in Exercise 4.27, state the output for each of the following code segments when x is 9 and y is 11 and when x is 11 and y is 9. We eliminated the indentation...
-
Based on the dangling-else discussion in Exercise 4.27, modify the following code to produce the output shown. Use proper indentation techniques. You must not make any additional changes other than...
-
The maximum daily temperature (in F) for Chicago and San Francisco during August are given in the vectors shown below: TCH = [75 79 86 86 79 81 73 89 91 86 81 82 86 88 89 90 82 84 81 79 73 69 73 79...
-
Examine Treas. Reg. 1.183-2. What Code section and language within that Code section does the Treasury Regulation interpret? What does the Treasury Regulation state are the nine relevant factors?
-
Paula Shoemaker produces a weekly stock market report for an exclusive readership. She normally sells 3,000 reports per week, and 70% of the time her sales range from 2,900 to 3,100. The report costs...
-
\[ \begin{aligned} x(t) & =e^{-2 t} u(t) \\ h(t) & =e^{-2 t} u(t) \\ y(t) & =x(t) * h(t) \end{aligned} \] Find \(Y(j \omega)\) and hence \(y(t)\) ?
-
Identify the four components of an ecosystem. After you do this try to visualize the interactions of these four components of an ecosystem as illustrated by Figure 2. 2 in the textbook. Does this...
-
Electrocomp's management realizes that it forgot to include two critical constraints. In particular, management decides that there should be a minimum number of air conditioners produced in order to...
-
B: Point out the error in the code and correct it. class Person { public void int display () { System.out.println("This is a Person"); } } class Student extnd Person { public void display () {...
-
A decision structure can be nested inside another decision structure.
-
The symbols >,
-
The SEC Form 10-K on NIKE is reproduced in Appendix C. REQUIRED: Review the NIKE SEC Form 10-K, answer the following question: a. What percentage of total assets do property, plant, and equipment and...
-
I e) The figure below shows part of the path of a ray of light, PQR, travelling through an optical fibre. The optical fibre consists of a fibre of denser transparent material, coated with a layer of...
-
Consider a beaker in which a thick layer of oil ( ( po = 7 4 0 . = 7 4 0 . kg / / m ? ) ? ) is poured on top of another thick layer of syrup ( ( ps = 1 3 2 0 = 1 3 2 0 kg / / m 3 ) . 3 ) . The two do...
-
A 0.27 kg slab of fine mahogany wood block is held against a wall at rest. The coefficient of static friction between the wall and the mahogany slab is 0.43. A spring of spring constant 115 N/m is...
-
Consider a person applying a horizontal force to a refrigerator on a level floor. Although they are pushing, there is enough friction that the refrigerator does not move. Check all of the following...
-
A 2.0 kg box of snickers is attached to a spring and placed on a 65 inclined plane hanging at rest. The spring has a spring constant of 20 N/m. The coefficient of static friction between the box and...
-
On February 28, 2014, Stu & Dent, LLP completed the audit of Shylo Ranch, Inc. (a public company) for the year ended December 31, 2013. A recent fire destroyed the accounting records concerning the...
-
Find the inverse, if it exists, for the matrix. -1
-
Draw a flowchart showing the general logic for finding the highest value in an array.
-
Look at the following pseudocode array declaration: a. How many rows does the array have? b. How many columns does the array have? c. How many elements does the array have? d. Write a pseudocode...
-
True or False A declaration for a two-dimensional array requires only one size declarator.
-
For a radio station, increased listening and delivering more occasions of listening are the key to audience gains. This measurement is the percentage of different persons who listen only to one radio...
-
1) What will be the output to the Terminal when the following program has been run? Type your answer into the answer box provided. //code begins #include "splashkit.h" enum part { OFF, ON }; enum...
-
After Niles died, his employer paid his estate $2,000 of salary still owed to Niles. The board of directors of Niles employer also decided to give his widow Daphne the $10,000 it expected to give to...
Study smarter with the SolutionInn App