CS 160 - Programming Concepts and Applications

Summer II 2018 - Lab 4A - Function Errors

Quick Links: Canvas | John Cabot | Piazza | zyBooks

|   Home |  Contact |  Syllabus |  Assignments |  Schedule |  Resources   |

This lab is due by Tuesday, July 17, 2018, 11:59 PM.


Function Errors



To gain more practice with functions, as well as provide experience to read/fix someone else's code.

Your task for this lab is to fix a program that has several functions and several errors.


Instructions



Create a new project and call it L5D. Once you have your empty main.cpp , open FunctionErrors_main.cpp and copy the code to your main.cpp .

This FunctionErrors_main.cpp program, as it currently stands, contains a number of errors related to the learning objectives stated. Your task is to correct the program, describe the type of error(s) you found, and list all the different values you need to input to test all possible cases in each section of the program. You should write this information (errors found/corrected and test values) as a comment at the top of each program section.

Compile and run the program. It is obviously not correct!

For each section, you must correct the error or errors. To identify the errors, you may need to do some calculations. For example, if the program says it is calculating the sum of the numbers from 1 to 5 (inclusive), the result should be 15.

NOTE: If you get help on any of these sections, BE SURE that you understand the answer. You may see questions similar to these on the exam.


Lab Submission



You will submit your solution to this lab with the rest of Set4. Detailed instructions for doing this are posted in Assignment 4.


This lab is due by Tuesday, July 17, 2018, 11:59 PM.

Last Updated: 07/05/18 16:27


Valid HTML 4.01 Strict Valid CSS! Level Triple-A conformance, W3C WAI Web Content Accessibility Guidelines 2.0