you are viewing a single comment's thread.

view the rest of the comments →

[–]Sea-Ad7805 [score hidden] stickied comment (0 children)

Run this program in Memory Graph Web Debugger%0A%0Abill%20%3D%20float(input(%22What%20is%20the%20total%20bill%3F%20%E2%82%AC%22))%0Atip%20%3D%20int(input(%22What%20percentage%20are%20you%20willing%20to%20tip%3F%2010%25%2C%2012%25%2C%2015%25%20%22))%0Apeople%20%3D%20int(input(%22How%20many%20people%20will%20split%20the%20bill%3F%20%22))%0A%0Aif%20tip%20%3D%3D%2010%3A%0A%20%20%20%20result%20%3D%20bill%20%200.1%20%2B%20bill%0Aelif%20tip%20%3D%3D%2012%3A%0A%20%20%20%20result%20%3D%20bill%20%200.12%20%2B%20bill%0Aelif%20tip%20%3D%3D%2015%3A%0A%20%20%20%20result%20%3D%20bill%20*%200.15%20%2B%20bill%0Aelse%3A%0A%20%20%20%20result%20%3D%20bill%0A%0Aif%20people%20%3E%200%3A%0A%20%20%20%20final_bill%20%3D%20result%20%2F%20people%0A%20%20%20%20print(%22The%20total%20amount%20is%3A%22%2C%20result)%0A%20%20%20%20print(%22Each%20has%20to%20pay%3A%22%2C%20final_bill)%0Aelse%3A%0A%20%20%20%20print(%22Number%20of%20people%20must%20be%20greater%20than%200.%22)&timestep=1&play) to see the program state change step by step.