Skip to content

CIS1275CPPI/MlengelaP6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Debugging Quiz:

About the Program:

This program calculates the Windchill Temperature based on a NOAA.gov formula. The Windchill Temperature provides an accurate way to calculate the dangers from winter winds and freezing temperatures. Here is their chart showing the wind versus temperature for your information. You will not need it for the program. The formulas are already coded correctly. But you can use it to check if your program’s answer is right.

image

The Time to frostbite is calculated using another NOAA formula.

NOTE: that the wind chill can only be calculated if the wind is blowing 5 mph or faster and the temperature must be 40 degrees or colder. These are empirical equations and have ranges of validity. There is a Validate function in the program that checks that the user’s input data is in the correct range.

Program Requirements:

Instead of a program to write, you will start with a broken program, and your job is to get it to run correctly.

Download the zipped file Quiz C6. Create a new folder called LastnameC6, extract the Quiz C6 program from the zipped file, and put it into that folder.

Open the program. The code has a few simple syntax errors, which cause it to not compile. Once you get it to compile and run, and start testing all the possible cases, it might crash! Once you fix that, the answers might not be correct. You will not have to type very much at all! Do not rewrite the program. Find the errors that are in this code! Your job is to find all problems and get this code to run correctly. Note: the frostbite time logic in the main is basically fine. So are the calculations for wind chill temperature and time to frostbite that are in WindChill.cpp.

  1. As you debug the program, put a comment above the line of code you need to fix.

  2. Specify if your fix is a syntax/compile correction or a run-time/logic fix/correction.

  3. Explain WHY the problem caused the error in the program. (Put explanation in your comment.)

VERY IMPORTANT!!!!

ADD A COMMENT ABOVE EACH LINE THAT YOU HAVE TO FIX EXPLAIN THE PROBLEM AND WHAT YOU HAD TO DO TO FIX IT!! NO COMMENT, NO CREDIT!

When you are satisfied that the program is running correctly, do the usual preparation and upload it to the assignment.

Sources:

Debugging Functions

Debuging Demo

Debugging MortCalc

Usage:

Core Features:

Contributions:

Releases

No releases published

Packages

 
 
 

Contributors