You are on page 1of 1

Declare a class called buffer having a data member to store up to n positive int numbers.

A
user gives input as pairs of int numbers as location0, value0;  location1, value1 and so on. At
location0, value0 to be written if appropriate.  
Raise and handle exceptions for following cases: 
1. If location specified is out of bounds 
2. If value given is not positive 
3. If the location specified is not empty (over-writing is not permitted). 
Write a complete program to demonstrate above.

You might also like