Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello again. I am writing what I hope to be my last C++ program! I an just runni

ID: 3548114 • Letter: H

Question

Hello again.  I am writing what I hope to be my last C++ program! I an just running into a few problems.  Right now may program takes a string input convert it to an interger and return the value.  I have posted a simplified version of the code here:


http://pastebin.com/87guaHzk


The problem that I am having is twofold.  First, with the code all on the main.cpp file the bandN value is always 2.  Second, when the program is split up into three files (Res.h, Res.cpp, and main.cpp)  I get garbage for a result.  As always, any help would be greatly appreciated especially if there is an explination as well.  Thanks!

Explanation / Answer

Your correct program is here: http://pastebin.com/chwrTwQa

You forgot to assign bandN variable.

The error was on line 88 in main():

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote