Question: Lab 0 : Hello, Boxes CSCI 4 1 Objectives: Get familiar with the autograder and the terminal Implement a class with a custom constructor, overloaded
Lab : Hello, Boxes CSCI Objectives: Get familiar with the autograder and the terminal Implement a class with a custom constructor, overloaded operators, and friend functions Write custom tests to verify that your implementation is correct Draw pretty boxes on the terminal Overview This lab is half about getting settled into the virtual machine, and half about practicing our classimplementation skills. You'll first make a simple program to get used to the whole process, and then implement and test a custom class Part : Get the starter code First, cd into the folder where you want to store your class files eg simlabs Copy the starter code there with the following line: gimme @csci This will make a lab folder in whatever directory you were in Then, if you cd into that folder and run you should see the following files: box.hrunBox.cpp testBox.cpp Now you're ready to start working.
Part : Write a hello world program You will write the classic "hello world" program as a warmup. You must write your program in a file called hello.cppand your program must print exactly "Hello, world! am ready for CSCI and then a newline. Compile your code with g hello.cpp hello and verify that it's working correctly
Part : Implement a boxdrawing class Take a look at box.hit has some comments that explain how the class works. You will make a file called box.cpp that contains the implementations of these functions Look at runBox.cpp It includes box.h and provides an example of using the Box class. Play around with compiling and running this file using g runBox.cpp box.cpp runBox to test your program. runBox.cpp is just for youyou won't be turning it in Here is what the unedited runBox.cpp should look like when you run it after you've implemented the Box class Lawtonnichols: solution $ runBox Enter a width: Enter a character to draw the box with: $ $$$$$$$$ $$$$$$$$ $$$$$$$$ $$$$$$$$ $$$$$$$$ $$$$$$$$ $$$$$$$$ $$$$$$$$ Now that you know what's supposed to happen, go forth and implement box.cpp
Part : Test your boxdrawing class Look at testBox.cpp It includes box.h and tests that the Box class was implemented correctlythese are the benchmarks that you will be graded against. Compile it with g testBox.cpp box.cpp o testBox You might want to look into how the std::stringstream class works: here's a link to the documentation page It lets you create a "fake" output stream that you can into and get the resulting built up string with str In addition to getting the current tests to pass, your job is to write more tests the same style as the ones given.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
