C++ program C++ is based on C, and C is known to be error-prone. This assignment is based on several of my student's programs from previous semesters. Submit a text file that lists each method's header in the attached program and explain what the problem is. You may include the corrected code but you must describe what the core coding issues are. The errors are all logical or syntax related. Just because it compiles and runs does not mean that is does what the author intended. These items are snippets. The problems are not style issues. To get full credit, I need all scenarios answered and correct.  I would expect that you tested out your code correction. I tend to assign low points if I can tell you did not test the proposed solution or incorrectly explained what the problem or solution is.  To solve this issue, simply test out what you would change.   // MS Visual Studio 2015 uses "stdafx.h" - 2017 uses "pch.h" //#include "stdafx.h" //#include "pch.h" #include using namespace std; void helloPlanet(); void bonusCheck(); bool whatIsMyResult(); void soTrue(); void hereIam(); void missCodedIF(); void loopForEachDayThisMonth(); // This program should run all the methods. // Find the problem with the code int main() { helloPlanet(); bonusCheck(); bool result = whatIsMyResult(); soTrue(); missCodedIF(); loopForEachDayThisMonth(); return0; } // Compiles perfectly. What do you think this was intented to do? void helloPlanet() { "Program is starting .."; } // Why does this state You get a bonus now? void bonusCheck() { bool getBonus = false; if (getBonus) cout << "You are qualified!" << endl; cout << "You get a bonus now! " << endl; } // What is the result of this method bool whatIsMyResult() { int x = 5; int y = 6; if (y == 5) { if (x == 4) { returntrue; } else { returnfalse; } } } // Why does this not display? void hereIam() { cout << "Do you see me?" <

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter9: Completing The Basics
Section: Chapter Questions
Problem 7PP
icon
Related questions
Question

C++ program

C++ is based on C, and C is known to be error-prone. This assignment is based on several of my student's programs from previous semesters.

Submit a text file that lists each method's header in the attached program and explain what the problem is. You may include the corrected code but you must describe what the core coding issues are.

The errors are all logical or syntax related. Just because it compiles and runs does not mean that is does what the author intended. These items are snippets. The problems are not style issues.

To get full credit, I need all scenarios answered and correct.  I would expect that you tested out your code correction. I tend to assign low points if I can tell you did not test the proposed solution or incorrectly explained what the problem or solution is.  To solve this issue, simply test out what you would change.

 

// MS Visual Studio 2015 uses "stdafx.h" - 2017 uses "pch.h"
//#include "stdafx.h"
//#include "pch.h"

#include <iostream>
using namespace std;

void helloPlanet();
void bonusCheck();
bool whatIsMyResult();
void soTrue();
void hereIam();
void missCodedIF();
void loopForEachDayThisMonth();


// This program should run all the methods.
// Find the problem with the code

int main() {

helloPlanet();
bonusCheck();
bool result = whatIsMyResult();
soTrue();

missCodedIF();
loopForEachDayThisMonth();

return0;

}

// Compiles perfectly. What do you think this was intented to do?
void helloPlanet() {

"Program is starting ..";

}


// Why does this state You get a bonus now?
void bonusCheck() {

bool getBonus = false;
if (getBonus)
cout << "You are qualified!" << endl;
cout << "You get a bonus now! " << endl;


}


// What is the result of this method
bool whatIsMyResult() {
int x = 5;
int y = 6;
if (y == 5) {
if (x == 4) {
returntrue;
}
else {
returnfalse;
}
}
}

// Why does this not display?
void hereIam() {
cout << "Do you see me?" <<endl;
}

void soTrue() {
bool done = false;
if (done);
{
cout << "Why do you see this when condition is false." << endl;
}
}


void missCodedIF() {
int x = 5;
if (x = 4) {
cout << "Why do you see this line?." << endl;
}

}


void loopForEachDayThisMonth() {
// We will assume this is a 31 day month
// The loop should show "Got sales for " 1 - 31
int MAX_MONTH_DAY = 31;
int today = 0;
for (today = 1; today < (MAX_MONTH_DAY + 1); today++);
{
cout << "Get sales for " << today << endl;
}

}
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr