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

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

pa01 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, ucsb-cs24-w19-mirza.

  • Clone your repo on CSIL in your home directory.

  • Get the starter code : If you have already cloned the cs24-w19-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-w19-starter-code/pa01/* ./
    
    

Assignment instructions

Files to submit: stats.h, stats.cpp stattest.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. Write test code in the file: stattest.cpp This code should test each of the public interfaces and non member functions of your class. This consititutes 5% of your grade.

  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 10% of your grade.

  4. Write a Makefile to compile your code with both the test files. This step carries 5% of the grade

  5. Implement the constructor, all the member functions, and all three non-member functions. Not that a subset of the non-member functions should be declared as friend functions. 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, push it with the commit message “Ready for feedback”.

  7. Submit the files for pa01 on gradescope: stats.h, stats.cpp, stattest.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 manually graded for showing off your initial design of the class, writing appropriate test code, and Makefile, and good coding style.

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).