CSE 283 Introduction to Object Oriented Design

Barbara Nostrand, Ph.D.


CSE 283 Labs
Welcome to the site for CSE 283 Labs!

 

Lab 3: C++ Project

Prev | Next | Lab 3

 

Objectives

1. Practice writing numeric programs in C++.
2. Gain experience with sequential programming in C++.
3. Practice using C++ I/O facilities.

Introduction

C++ provides the cassert mechanism for checking preconditions.  This mechanism is contained in the cassert library which must be included in order to use this mechanism.  The assert function is passed a boolean value.  Execution procedes normally if this value is true.  However,  the program is immediately terminated if this value is false.  A diagnostic message is automatically displayed on the console device if the assertion fails. 

Project

Implement a version of Change in C++.  Change will prompt the user for a purchase amount and an amount tendered.  Given the amount of a purchase and the amount received in payment,   Change computes the change in dollars,   half-dollars,   quarters,   dimes,   nickels,  and pennies.   After completing a transaction,  Change prompts the user for another transaction.  Do not use any conditional staments such as if to compute change.  Your C++ version of Change need not produce a GUI interface. 

Don't forget to clean up your directory when you are all finished. 

Prev | Next | Lab 3

 
  Home

Schedule

Help

Lab 0

Lab 1

Lab 2

Lab 3

Lab 4

Lab 5

Lab 6

Lab 7-8

Lab 9

Lab 10

Lab 11

Lab 12

Lab 13






Last modified: 2007 OCT 28
bnostran@syr.edu