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?" <

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education