Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Name Parag Shetty

R11535761

Date 12th October, 2017

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:

1. Here the source code is as follows,

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.

Here is the output,

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.

Here is the output,


4. Here is the source code as follows,

We first declare propertygui class, wherein we define the action for calculate button function.

Then we define how we calculate assessment value and property tax.

Then we define what exactly happens when the calculate button is clicked, where the calculations takes
place for calculating assessment value and property tax.

I have attached the py and gui file as instructed.

The output is as follows,

You might also like