6
CSCE 2004 – Programming Project 5 Midpoint Due Date – 10/28/2020 Due Date – 11/06/2020 (extended) 1. Problem Statement: The primary goal of this programming assignment is to give students experience with two-dimensional arrays. Your task will be to implement some of the basic number crunching features that make spreadsheets like Microsoft Excel so popular. As you know, spreadsheets allow you to store data values in a two-dimensional grid of cells. In Excel, the locations of cells are given by character column indices (A,B,C,…) and integer row indices (1,2,3,…). Using this notation, you can create formulas that combine the data from a range of rows and columns. For example, if you have 10 values in column A from row 1 to row 10, you can add these up using the formula “SUM(A1:A10)”. If you experiment with Excel, you will discover that it supports a huge range of numerical calculations and data display options, which is why spreadsheets were the one of the first “killer apps” back in the 1980’s. Your task in this programming assignment is to implement a command based spreadsheet program. To keep things simple, your spreadsheet should store all data in a fixed size float array of 26 rows and 26 columns. Your program should access

jgauch/2004/F20/hw/project5/project5.docx · Web viewCSCE 2004 – Programming Project 5 Midpoint Due Date – 10/28/2 020 Due Date – 11/0 6 /2020 (extended) 1. Problem Statement:

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: jgauch/2004/F20/hw/project5/project5.docx · Web viewCSCE 2004 – Programming Project 5 Midpoint Due Date – 10/28/2 020 Due Date – 11/0 6 /2020 (extended) 1. Problem Statement:

CSCE 2004 – Programming Project 5Midpoint Due Date – 10/28/2020

Due Date – 11/06/2020 (extended)

1. Problem Statement:

The primary goal of this programming assignment is to give students experience with two-dimensional arrays. Your task will be to implement some of the basic number crunching features that make spreadsheets like Microsoft Excel so popular.

As you know, spreadsheets allow you to store data values in a two-dimensional grid of cells. In Excel, the locations of cells are given by character column indices (A,B,C,…) and integer row indices (1,2,3,…). Using this notation, you can create formulas that combine the data from a range of rows and columns. For example, if you have 10 values in column A from row 1 to row 10, you can add these up using the formula “SUM(A1:A10)”. If you experiment with Excel, you will discover that it supports a huge range of numerical calculations and data display options, which is why spreadsheets were the one of the first “killer apps” back in the 1980’s.

Your task in this programming assignment is to implement a command based spreadsheet program. To keep things simple, your spreadsheet should store all data in a fixed size float array of 26 rows and 26 columns. Your program should access these locations using Excel’s convention with column indices [A..Z] and row indices [1..26]. Your program should support the following spreadsheet operations:

Store data. When the user types “STORE 4.2 A1” your program should store the value 4.2 in location A1 in the array.

Random data. When the user types “RANDOM 1 9 A1 A5” your program should calculate a collection of random values between [1..9] and store these values in array locations A1 to A5.

Find minimum. When the user types “MIN A1 A5 B2” your program should calculate the minimum value in the range A1 to A5 and store the result in B2.

Find maximum. When the user types “MAX A1 A5 B3” your program should calculate the maximum value in the range A1 to A5 and store the result in B3.

Page 2: jgauch/2004/F20/hw/project5/project5.docx · Web viewCSCE 2004 – Programming Project 5 Midpoint Due Date – 10/28/2 020 Due Date – 11/0 6 /2020 (extended) 1. Problem Statement:

Find sum. When the user types “SUM A1 A5 B4” your program should calculate the sum of values in the range A1 to A5 and store the result in B4.

Find average. When the user types “AVE A1 A5 B5” your program should calculate the average of values in the range A1 to A5 and store the result in B5.

Find variance. When the user types “VAR A1 A5 B6” your program should calculate the variance of values in the range A1 to A5 and store the result in B6.

Find standard deviation. When the user types “STDEV A1 A5 B7” your program should calculate the standard deviation of values in the range A1 to A5 and store the result in B7.

Print data. When the user types “PRINT A1 B7” your program should print the data values in the range A1 to B7.

Quit program. When the user types “QUIT” your program should quit.

In each of these spreadsheet operations, the first word the user types is the command (STORE, RANDOMIZE, MIN, MAX, SUM, AVE, VAR, STD, PRINT, or QUIT). If the user types in anything besides one of these nine commands, your program should print an error message and quit.

Once you have determined what command the user entered, your program must then read in the arguments to this command. You will notice that the number and type of arguments to the command vary. For example MIN takes three spreadsheet locations while STORE takes one float value and one spreadsheet location

When the user enters a spreadsheet location like B4 in one of their commands, your program must read this location and convert the input into the corresponding array location (row=3, col=1). This operation is a little tricky, so we have provided a function “read_index” that you can use in your project.

For this assignment, students are allowed to use any combination of C++ features we have discussed in class or lab. You are not required or allowed to look ahead to more advanced C++ features like files or classes to perform this task.

2. Design:

For this assignment, you have two big design decisions. First, you need to decide how to read and decode the user commands. How will you read the command? How will you check it is valid? How you will read and verify the input parameters for each operation. What error messages do you want to print when the user enters something incorrectly?

The second design task is to decide how to implement each of the operations above. Do you want to use small functions that take an input array and other parameters? Do you want to put the operation code inside the command processing loop? Finally, what formulas are needed to implement these commands?

3. Implementation:

Page 3: jgauch/2004/F20/hw/project5/project5.docx · Web viewCSCE 2004 – Programming Project 5 Midpoint Due Date – 10/28/2 020 Due Date – 11/0 6 /2020 (extended) 1. Problem Statement:

You will be given sample code with three functions you can use in your program. The first function is “read_index” that reads locations like B4 and returns row=3, col=1. The second function is “print” that outputs the values in a specified range in the array. The third function is “main” that initializes the data array, and has a command processing loop.

As you complete this project, it is important to develop your code incrementally writing comments, adding code, compiling, debugging, a little bit at a time. This way, you always have a program that "does something" even if it is not complete.

4. Testing:

Test your program with a variety of inputs to check that main function and any other functions you created work correctly. You can add cout statements in each function to help you track of what is being passed into the function, and what values are calculated.

Once your program is running correctly, you should perform a sequence of commands to verify that your code is correct. To do this, you should enter some data values that are easy to work with, so you can check program outputs manually.

Sample output from our solution will be provided on the class website for you to compare with your program output.

5. Documentation:

When you have completed your C++ program, write a short report using the “Programming Project Report Template” describing what the objectives were, what you did, and the status of the program. Does your program work properly for all test cases? Are there any known problems? Save this project report in a separate document to be submitted electronically.

6. Project Submission:

In this class, we will be using electronic project submission to make sure that all students hand their programming projects and labs on time, and to perform automatic plagiarism analysis of all programs that are submitted.

When you have completed the tasks above go to Blackboard to upload your documentation (a single docx or pdf file), and your C++ program (a single cpp file). Do NOT upload an executable version of your program.

The dates on your electronic submission will be used to verify that you met the due date above. All late projects will receive reduced credit:

Page 4: jgauch/2004/F20/hw/project5/project5.docx · Web viewCSCE 2004 – Programming Project 5 Midpoint Due Date – 10/28/2 020 Due Date – 11/0 6 /2020 (extended) 1. Problem Statement:

10% off if less than 1 day late,20% off if less than 2 days late,30% off if less than 3 days late,no credit if more than 3 days late.

You will receive partial credit for all programs that compile even if they do not meet all program requirements, so handing projects in on time is highly recommended.

7. Academic Honesty Statement:

Students are expected to submit their own work on all programming projects, unless group projects have been explicitly assigned. Students are NOT allowed to distribute code to each other, or copy code from another individual or website. Students ARE allowed to use any materials on the class website, or in the textbook, or ask the instructor and/or GTAs for assistance.

This course will be using highly effective program comparison software to calculate the similarity of all programs to each other, and to homework assignments from previous semesters. Please do not be tempted to plagiarize from another student.

Violations of the policies above will be reported to the Provost's office and may result in a ZERO on the programming project, an F in the class, or suspension from the university, depending on the severity of the violation and any history of prior violations.