# assign3 - ECOR 1606 Exercise#3 Imagine that we like to...

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

ECOR 1606 Exercise #3 Imagine that we like to determine whether some carpets will fit a room. We know the size of the room and the sizes of the carpets. For each carpet, there are three possibilities. The carpet may be a perfect fit, it may be large enough that it can be cut to size, or it may be of no use at all. Suppose, for example, that the room is 20 x 50 feet (or 50 x 20 feet) If a carpet is 20 x 50 feet (or 50 x 20 feet), it fits the room exactly. If a carpet is 30 x 60 feet (or 60 x 30 feet), it can be trimmed to size. If a carpet is 10 x 60 feet (or 60 x 10 feet), it is of no use at all. You are to create a C-- program (“ carpet.cmm ”) that reads in the size of the room and that then repeatedly reads in carpet sizes until 0 0 is entered. For each carpet size entered, your program should output a message indicating which of the three possibilities applies. An executable that behaves as your program should have been supplied. Running it should give you an excellent idea of what is required. Note that room and carpet dimensions may be
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/28/2011 for the course MATH 101 taught by Professor Duke during the Spring '11 term at University of Ottawa.

Ask a homework question - tutors are online