.Open CSci202 Laboratory 04 Classes (previous): See .See http://www/dick/cs202/lab03.html + Problem .See http://www/dick/cs202/lab02bad.cpp + Four of my solutions: .See http://www/dick/cs202/lab02string.cpp (use C++ 'string' type) .See http://www/dick/cs202/lab02get.cpp .See http://www/dick/cs202/lab02get2.cpp (input one character at a time and discard the extra ones) .See http://www/dick/cs202/lab02getline.cpp (use getline... and tidy up extra input if needed). . Check out the Latest News .See http://www/dick/cs202/ . Problem Arrays are efficient but dangerous to use. It is wise to wrap up a dangerous data structure inside a class. We hide the data by making it private. We have only a few safe operations that are public. Anything which might be abused is private. So we forbid the dangerous operations and only allow the safe ones. We use `assert` to protect our `safe` operations from abuse. We provide the user with a safe Application Programmer Interface --(API) We also provide common constructors and operators that application programmers expect. . Goals By the end of the lab you should know more about coding classes that include common constructors and operators. . Deliverables Due at end of Lab Period A working program that uses a safe 8 character Buffer class that does the useful things of the lab02 program but does not permit the abuse possible in lab02. . Givens Here .See http://www/dick/cs202/lab04main.cpp is a program that is designed to test a new safe Buffer class. The safe buffer was defined in a file called `buffer04.h`. It worked until I deleted some functions header lines from the function definitions and replaced them by .As_is // DELETED Here is the result .See http://www/dick/cs202/buffer04.h Download test and "header" files. Your task is to use the book, the compiler, your brain, and my advice to replace the DELETED lines until it compiles and runs. Do not change the main program. Do not change anthing but the DELETED lines in the .h file. . Disclaimer There are things that still need improving in these two files. Do not do these. We will tackle them in later labs. If you have time at the end of the lab, start on .See http://www/dick/cs202/project3.html the next project. . Next Lab -- Inheritance and Polymorphism In .See http://www/dick/cs202/lab05.html you will add new features to a program, one step at a time, by deriving new classes from given classes. .Close CSci202 Laboratory 04 Classes