Ethan H.

asked • 02/26/21

Help with these questions

1. Assume that the variable amount refers to 24.325. Write the outputs of

   the following statements:

    a. print “Your salary is $%0.2f” % amount

    b. print “The area is %0.1f” % amount

    c. print “%7f” % amount

2. Write a code segment that displays the values of the integers x, y, and z

   on a single line, such that each value is right-justified in 6 columns.

3. Write a format operation that builds a string for the float variable

   amount that has exactly two digits of precision and a field width of zero.

4. Write a loop that outputs the numbers in a list named salaries. The

   outputs should be formatted in a column that is right-justified, with a

  field width of 12 and a precision of 2.

1 Expert Answer

By:

Patrick B. answered • 02/26/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.