Lab 04

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Laboratory 04: Object-Oriented Programming (OOP)

The submission deadline for the assignment is Tuesday, September 19, at 23:59 hours, via
the virtual platform. The submission should not be delayed beyond this deadline. The
assignment allows a maximum of two students to collaborate. Please note that groups
consisting of three students will not be permitted under any circumstances. Only one of the
two students should upload the report to Moodle.

The report for the assignment is expected to be written in English. Additionally, you are
required to present the assignment in class on Wednesday, September 20.

Your adherence to these deadlines and presentation requirements is appreciated.

For this program I will be using US dollars and cents.

Write a program that asks the user to enter the following:


An integer representing the number of cents

You may assume that the number of cents entered is greater than or equal to zero

The program should then display how to provide that change to the user.

In the US:
1 dollar is 100 cents
1 quarter is 25 cents
1 dime is 10 cents
1 nickel is 5 cents, and
1 penny is 1 cent.

Here is a sample run:

Enter an amount in cents : 92

You can provide this change as follows:


dollars : 0
quarters : 3
dimes : 1
nickels : 1
pennies : 2
Conditional statements, loops, or functions are not allowed. No other libraries are allowed
apart from iostream or the std namespace

The code must be able to be copied and pasted


To accomplish this, kindly adhere to the sequential stages of the programming
methodology:
• Problem Analysis.
• Problem Specification.
• Algorithm Design.
• Algorithm Testing and Refinement.
• Code Implementation.
• Testing and Verification.

You might also like