pa01 : Statistician as a C++ Abstract Data Type (ADT)

num ready? description assigned due
pa01 true Statistician as a C++ Abstract Data Type (ADT) Thu 04/12 09:00AM Fri 04/20 11:59PM

PA1 must be done individually - each student must accomplish it alone and submit it. Later assignments may allow students to work in pairs , but not this assignment.

Create a git repo and obtain the starter code

  • Create a git repo named pa01_your_github_username in our class organization.

  • Clone your repo on CSIL in your home directory.

  • Get the starter code : If you have already cloned the cs24-s18-starter-code change into it and type git pull to get the latest starter code.

  • Change into your repo directory and obtain copy the starter code by typing the following command

cp ~/cs24/cs24-s18-starter-code/pa01/* ./

Assignment instructions

Files to submit: stats.h, stats.cpp and a Makefile

This assignment is based on Chapter 2, Programming Project 2 and 3 (here is a local copy of page 90. Follow the instructions on this web page, not the ones on page 90 - but do see the hints provided by the textbook author.

  1. Type your name and the date in a comment at the top.(Like always, whether or not we remind you!)

  2. Read and understand the two provided test files: stattest.cpp (which is an interactive test code) and statexam.cpp. Make sure you understand the expected behavior of statistician before you implement it.

  3. Complete the incomplete definition of class statistician as provided in stats.h header file. In particular you must reason about the attributes of the statistician. Define the private member variables. Push your code to github and contact your mentor to get feedback on your class definition. It is important that you discuss your design choices with your mentor before implementing the class. This step carries 20% of your grade.

  4. Write a Makefile to compile your code with both the test files.

  5. Implement the constructor, all the member functions, and all three non-member functions (including the two friends) as they are declared in stats.h. Read the documentation for each of these functions at the top of stats.h, and make sure your implementations work as advertised in those comments - i.e., satisfy all of the postconditions.

  6. Push your code to github often. When you think it is ready for feedback from your mentor push it with the commit message “Ready for feedback”.

  7. Submit the files for PA1 on gradescope: stats.h, stats.cpp, Makefile. Be sure to wait for the results of all tests. If you score 80/80, and you’ve followed all of the other rules, then you’ll earn 80/80. The additional 20 points will be given by the mentor for good style and for showing off your initial design of the class.

Some hints:

  • Use assert to verify the pre-conditions of functions mean, minimum and maximum.

  • Compile and test your program at CSIL (connecting remotely is okay).

  • Use the interactive test program: stattest.cpp to do some initial testing. The point of this interactive test program is for you to test your functions individually, to make sure each one is working properly before running your implementation through more comprehensive tests like the ones that will be used when you submit. To learn details of those tests, see the non-interactive test program we will use: statexam.cpp (you can try it out before submitting if you want - give a test number, 1 to 5, as a command line argument if you run it). Do not proceed to the next step to submit your work until you are sure that all of your functions are working properly.