Professional Documents
Culture Documents
Final Shetty
Final Shetty
R11535761
KINDLY FIND ALL THE OUTPUT, CODE AND APPROPRIATE COMMENTS FOR THE TEST,
DO LET ME KNOW FOR ANY CONCERNS; WILL HELP EXPLAIN IN MORE DETAIL IF
NEEDED.
Answers:
I have kept the print first so it is easier for output representation, defined a function for the
for loop, where we kept the time range from 10 to 30, with a gap of 5. Then print statement
with the time and calories burned using the formula * 4.2 calories per minute.
Output,
2. Here is the source code as follows,
Here once we take the input of replacement amount, then we calculate it with 80%, then we print the
minimum insurance required for the owner.
3. Here is the source code as follows, it is a bit long so, lets break it into sections and explain the
logic here,
So first here we create a class called CarShetty,
Wherein as requested in the question we ask for model year and make of the car, while keeping
a value of zero for the speed attribute. And then we define functions for accelerate and braking
for 5 times.
And then we define the main function, here as we defined in the previous accelerate and
braking functions, we print the speeds 5 times with a gap of 5.
We first declare propertygui class, wherein we define the action for calculate button function.
Then we define what exactly happens when the calculate button is clicked, where the calculations takes
place for calculating assessment value and property tax.