Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+6 votes

How to update the progress bar? I tried calling update() but I keep getting an error.

asked in CSC201 Spring 2021 by (1.6k points)

3 Answers

+4 votes

I think you need to call object.update(window, percent) in which object is specific progress bar you want to update the state.

answered by (8 points)
+1

When I was working on it figuring out the percent was the harder part because there is a way to do it if you assume base 10 and then there is a way to do it when the number of the questions don't matter. You have to use 100, division, and count.

+2 votes

What type of error did you get?

answered by (4.5k points)
+2 votes

are you putting both parameters, window and %, into the .update() call?

answered by (8 points)
+1

yes. I did smth like this firstbar = update(window, 20).

+2

it should be firstBar.update(). we always use . when using methods on objects. = is for the intitial construction.

...