Solved–Assignment 01 –Solution 17

$30.00 $19.00

Description: This programming assignment will provide exercises in designing classes with proper abstractionand encapsulation. Encapsulation and abstraction are key components of the C++ programminglanguage as well as OOP in general. In addition, the programming assignment will require understanding of operator overloading and some use of the friend concept. 1- Design the interface for a class…

You’ll get a: . zip file solution

 

 

Description

5/5 – (2 votes)

Description:

This programming assignment will provide exercises in designing classes with proper abstractionand encapsulation.

Encapsulation and abstraction are key components of the C++ programminglanguage as well as OOP in general.

In addition, the programming assignment will require understanding of operator overloading and some use of the friend concept.

1- Design the interface for a class which models the coin-operated “bank” part of a Vending machine which sells snacks.

You only need to design the interface (.h file) and not the implementation (.cpp file).

Here is a start of VendingBank.h with one function already defined.

2- Design and implement a TimeSpan class which represents a duration of time in hours, minutes, and seconds.

The order hours, minutes, and seconds should be respected in the constructor.

In the instances of the TimeSpan class you should store the values as integers in a normalized way.

The number of seconds should be between -60 and 60; number of minutes should be between -60 and 60.

You do not need to worry about integer overflow for very big TimeSpans.