Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can someone please tell me what the 5 errors in this code is? cpp (1).cpp stdafx.cpp stdafx.h Squash_The_Bugs.cpp - XSquash_the_bugs.cpp* Miscellaneous Files - (Global Scope)

can someone please tell me what the 5 errors in this code is?
image text in transcribed
image text in transcribed
cpp (1).cpp stdafx.cpp stdafx.h Squash_The_Bugs.cpp - XSquash_the_bugs.cpp* Miscellaneous Files - (Global Scope) - main 1 / Squash_The_Bugs.cpp : This code contains five errors before it will work as desired. Find those errors, 17/ document a description of the errors and their fix, and fix them. Try using the debugger to 11 step through the program to find the bugs. As you step through, take notice of the information 17/ you can see. Try using thered. Find those of maino // This program gets an input of number of gallons of water used from the user. 117 It will then calculate a customer's water bill using the following rules: // A mandatory environmental fee of $15, plus 1 $2.35 per 1000 gallons for the first 6000, 11 $3.75 per 1800 gallons for over 6000 to 20000, 1/ 56.00 per 1000 gallons for over 20000. // The bill is then displayed to the user. 16 #include "stdafx.h" #include #include #include using namespace std; 18 19 Dint main() 22 double gallons, charge - e, total const int fee - 15; int costUp Took = 2.35, costup to 20k - 3.75 costOver 20K - 6.00; "; cout > gallons; 31 if (gallons > 20){ charge - Ballons - 20) - castover 20 charge - charge + (14 - costUp Toek) charge - charge + (6 - costUpTo6K); else if (gallons > 6 B allons #include #include using namespace std; 17 Bint main() double gallons, charge - o, total; const int fee 15; int costUp Took - 2.35, costUp To 20k - 3.75 costover 20 - 6.00; cout > gallons; if (pallons > 20) charge - (gallons - 20) costover 20K; charge - charge + (14 costupT20K) charge - charge + (6 costupTo6K); else if (Ballons > 6 gallons c20) charge (Ballons - 6) - costupToek charge - charge + (6 + costupTo6K); else charge - gallons costuptok total - charte + fee; cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 3 Lnai 8726

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448440, 978-3662448441

More Books

Students also viewed these Databases questions