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 0: Hello, Boxes CSCI 41 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 class-implementation skills. You'll first make a simple program to get used to the whole process, and then implement and test a custom class Part 1: Get the starter code First, cd into the folder where you want to store your class files (e.g., sim/labs). Copy the starter code there with the following line: gimme @csci41 This will make a lab00 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 2: 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 41" and then a newline. Compile your code with g++ hello.cpp hello and verify that it's working correctly
Part 3: Implement a box-drawing class Take a look at box.h-it 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 you-you 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: 8 Enter a character to draw the box with: $ $$$$$$$$ $$$$$$$$ $$$$$$$$ $$$$$$$$ $$$$$$$$ $$$$$$$$ $$$$$$$$ $$$$$$$$ Now that you know what's supposed to happen, go forth and implement box.cpp
Part 4: Test your box-drawing class Look at testBox.cpp. It includes box.h and tests that the Box class was implemented correctly-these 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 6 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!