Introduction to Programming s1

Introduction to Programming s1

<p>Introduction to Programming Using Python Python Worksheet 2 </p><p>1. Write a program that will ask the user for their first name. The program should then concatenate the name with a message, such as ‘Hello Fred. How are you?’ and output this string to the user</p><p>2. Write a program that asks the user to enter two real numbers and displays the product of these two numbers to 2 decimal places, with user-friendly messages.</p><p>3. Write a program to enter a temperature in degrees Fahrenheit and display the equivalent temperature in degrees Centigrade. [The formula for conversion is Centigrade = (Fahrenheit – 32) * (5/9)] 4. Write a program to convert a person’s height in inches into centimetres and their weight in stones into kilograms. [1 inch = 2.54 cm and 1 stone = 6.364 kg]</p><p>5. Write a program to enter the length, width and depths at the deepest and shallowest ends of a rectangular swimming pool. Calculate the volume of water required to fill the pool, and display this volume.</p><p>6. Write a program to enter the length and width of a rectangular-shaped garden. Calculate the area of the garden and the cost of turfing a lawn if a 1m border is around the perimeter of the garden. Assume the cost of turf is £10 per square metre. Display the result of these calculations.</p><p>Page 1</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    1 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us