Ch5-Exercises - and coins ($2, $1, 25¢, 10¢, 5¢, 1¢)....

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Exercises from Chapter 5 which need only if-statements: 11. Write a program that will read real values for the lengths of the three sides of a triangle, calling them A, B and C, and determine which of the following is true: a) no triangle is possible, b) triangle is isosceles, c) triangle is equilateral, d) triangle is right-angled, e) triangle is neither isosceles, nor equilateral, nor right-angled. 13. Write a program that will read in any amount (under $20), given in dollars and cents, and determine the way that this can be made up of bills ($10, $5)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: and coins ($2, $1, 25¢, 10¢, 5¢, 1¢). This is an automatic change-maker and should give the minimum number of bills and coins possible. Exercises from Chapter 5 which use loops: 14. Write a program that will count the number of digits in a positive integer that is input. 15. Write a program that will tell whether an integer is a palindrome, that is, has the same value with the digits reversed. Examples of integer palindromes are 11, 323, and 7667....
View Full Document

This note was uploaded on 02/13/2012 for the course CSE 1540 taught by Professor Hofbauer during the Winter '12 term at York University.

Ask a homework question - tutors are online