Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 3 Write a recursive function progress _ bar ( completion _ percent ) that takes an int completion _ percent. The function should return

Problem 3
Write a recursive function progress_bar(completion_percent) that takes an int completion_percent. The function should return a string
progress bar representing the completion percentage. The beginning and end of the completion bar should be square brackets [ and ]. Each ten
percent of completion will be represented by one character in the progress bar. Thus, every progress bar should be ten characters long. Use hashmarks
# to represent the completion percentage and use blank spaces to represent the remaining work to be completed. You should always 'round down' the
completion number to the nearest ten (see hint below). You do not need to deal with inputs below 0 or above 100.
in the digisum() or vertical() practice problems for an idea of how to round down.
Sample usage:
completion = progress_bar(25)
completion
'[## ]'
completion = progress_bar(37)
completion
'[### ]'
completion = progress_bar(71)
completion
'[#######]'
completion = progress_bar(100)
completion
'[##########]'
completion = progress_bar(99)
completion
'[######### ]'
completion = progress_bar(1)
completion
'[]'
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is focal length? Explain with a diagram and give an example.

Answered: 1 week ago

Question

What is physics and how does it apply in daily life?

Answered: 1 week ago

Question

Write a letter asking them to refund your $1,500 down payment.

Answered: 1 week ago