diagnostic

EECS 280 Preparedness Diagnostic Project

This project will help determine if you would be better positioned to take an introductory programming course (EECS 183/ENGR 101/ENGR 151) or EECS 280. The project covers material that students entering EECS 280 are expected to know.

Students must achieve a score of 45/50 on the diagnostic project to be considered for an override into EECS 280 without prerequisite.

Earning a score of 45/50 makes a student eligible to submit an override request, but does not guarantee approval. All requests are reviewed by the Chief Program Advisor (CPA), and permission to enroll in EECS 280 without the prerequisite is granted at the discretion of the CPA on a case-by-case basis.

Overview of files

arrays.hpp contains only function declarations (AKA prototypes). Download arrays.hpp.

arrays.cpp should contain function definitions (AKA implementations) listed in arrays.hpp. Create a new file called arrays.cpp and write your code there.

Overview

Consider an application that does basic encrypting and decrypting of text-based messages. Such an application involves manipulating sequences of characters, moving characters to different positions or transforming the characters in some other way. In this project, you will write a library for manipulating arrays of characters; once complete, the library could be used to build an encryption program, but that is not required for this project.

Approach to what you should do first

The project consists of writing several functions according to specifications. All the requirements for the functions are within the given arrays.hpp file. You are to implement these functions as given. Do not alter any of the prototypes; if you do, your code will not compile on the autograder. The implementation code must be in a file named: arrays.cpp. The best approach is to implement one function and test it. Make sure your first function works perfectly before moving onto the next function. Implement the second function and test it. Implement your functions in arrays.cpp.

Notice that many of the functions in arrays.hpp come in pairs, one for a 1-dimensional array, and the second for a 2-dimensional array. Implement the 1D array function first; then treat the 2D array as an array of arrays and call the 1D function within the implementation for the 2D array.

Testing

It is good practice to write the test suite before you implement a function. This way, once you have written code for a function, you can test it immediately. It is always good to know if you are correct or not —— without using a submit to the autograder, since the number of autograder submissions is limited. It is also a very good way to cut coding time by a significant amount.

For testing to be beneficial, you must know expected output/return values.

Example

Sample test code:

#include "arrays.hpp"

void test1() {
  char arr[SIZE] = {'a', 'b', 'c', 'd', 'e', 'f'};
  printArray(arr, 6);
}

int main() {
  test1();
}

Sample expected output:

abcdef

Test as many cases as are needed to ensure that your functions work for all allowed inputs.

Submission

Submit arrays.cpp to the autograder

You may submit up to 3 times. Your final grade is the score on your last submission.