- A PrimeInteger class that determines whether an integer is prime (divisible only by itself and 1). Hint: use two nested loops and the modulus operator.
- An IB_Grade class that determines the IB grade assigned to a real mark.
- A Parrot class that repeats string input from the console until a secret phrase is entered.
- A Magnitude class which determines whether an integer is greater than, equal to, or less than another integer. Test with 25 randomly-generated integers, and a control integer from the user.
- A Palindrome class which determines whether two strings are matching palindromes (one string is the reverse of the other).
- An EvenOdd class which determines whether a given integer is even or odd.
- A SportsAdvice class which determines the appropriate sport to play, given the outdoor temperature.
- A FuelEconomy class which determines whether an economy, given in miles/gallon, is better than, equal to, or worse than an economy given in L/100 km.
- A CreditWatch class which determines whether a cardholder has exceeded her credit limit.
- A SalesCommission class which determines the commission payable on sales as follows: 1% of the first 1 000, 2% of the next 2 000, and 3% of the balance.
- A Payroll class which determines the regular and overtime (over 40 hrs/week) pay for hourly employees.
- A FederalIncomeTax class which determines the gross tax payable on income at each of the prescribed income bands.
- An IntegerSize class which determines which integer is the biggest-so-far of all which have been read from the user.
- A CheckDigit class which determines whether the check digit appended to a 4-digit integer is correct.
- A BodyMassIndex class which determines whether a person's BMI is appropriate for her mass and height.
- A TelephoneNumber class which determines the number to be dialed from a string like “1 800 O-Canada.”
- A LeapYear class which determines whether a given year is a leap year. Hint: check the rules at a reputable site.
- A SimpleCalculator class.
- A Quadrilateral class which determines the type of figure, given the lengths of four sides and the degree of one angle, according to following criteria (name, all sides equal, opposite sides equal, internal angle is a right angle):
- square, true, true, true
- rectangle, false, true, true
- rhombus, true, true, false
- parallelogram, false, true, false
- irregular, false, false, —
[This page last updated 2020-12-23 at 12h12 Toronto local time.]
© 2007–2021 Hersch, Bear & Company Limited. All rights reserved. “Grammar Authority,” “grammarauthority.com,” “touque.ca,” and “Canada’s Thinking Cap” are trademarks of Hersch, Bear & Company Limited. All other trademarks and copyrights are the property of their respective owners.