touque.ca > Education Commons > Programming: Assignments > Selection > Repetition

Assignments

Selection

  1. Gather a mark out of 100, and report whether it is a passing mark.
  2. Gather the name of a colour. If the colour is blue, display a thank-you message in blue; otherwise, display the same message in black (which is the default colour).
  3. Gather a price in dollars. If the price is greater than $4.99, display a final price including PST and GST; otherwise, display the original price as the final price.
  4. Gather a mark out of 100, and report whether it is a passing mark or a failing mark.
  5. Gather the name of a colour. If the colour is blue or red, display a thank-you message in blue or red; otherwise, display the same message in black.
  6. Ask whether the user wishes to convert inches to centimetres, or centimetres to inches, then gather the measurement and provide the appropriate conversion.
  7. Gather a full name, street address, city, and country. If the country is Canada, gather the province and postal code, otherwise gather the U.S. state and zip code. Then display the full address on a single line, with the components separated by commas.
  8. Gather the radius or the diameter of a circle, in metres, and display the radius, diameter, circumference, and area.
  9. Gather the principal amount of a loan, and a monthly or annual interest rate, and display the interest owing for one year.
  10. Gather the price of an item and its tax status (taxable or nontaxable), and display a receipt showing the price, PST, GST, and the total.
  11. Gather two integers, and display their sum, difference, product, and quotient. Guard against division by zero.
  12. Gather an age in months, then provide the age in whole years, rounded up or down as appropriate.
  13. Gather a starting time, an ending time, and display the elapsed time appropriately formatted. Accept the times in two parts: the hours and the minutes.

touque.ca > Education Commons > Programming: Assignments > Selection > Repetition