TORONTO KIDS COMPUTER CLUB | Aurora Monday 18:30 Python Homework 20.11.30.
18794
post-template-default,single,single-post,postid-18794,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Aurora Monday 18:30 Python Homework 20.11.30.

02 Dec Aurora Monday 18:30 Python Homework 20.11.30.

You could create python file and Write program for the following questions, detailed instructions as below:

  • Open Python IDLE
  • In Menu Bar, Click “File” => “New File”
  • In the file write your program
  • After finishing writing the program, click “Run”=>”Run Module” in menu bar or just press “F5”
  • Python will ask you save the file before run the program
  • Check your code and fix the errors.

Question 1.

Write a program that asks for the dimensions (length and width) of a rectangular room, and then calculates and displays the total amount(area) of carpet needed to cover the room.

Hint:
Use input() to ask question and get answer, however, you can only get string data type of answer. In order to get decimal number as dimensions, you need to use float(input(…..)) which will convert from string answer into a decimal number.


Question 2.

Write a program that helps the user add up her change. The program should ask:

  • “How many quarters?”
  • “How many dimes?”
  •  “How many nickels?”

Then it should give the total value of the change

No Comments

Sorry, the comment form is closed at this time.