Question
IT 312 Debugging Assignment Guidelines and Rubric Overview: Debugging is the process of finding and fixing errors (bugs/defects) in your code. It is an essential
IT 312 Debugging Assignment Guidelines and Rubric Overview: Debugging is the process of finding and fixing errors (bugs/defects) in your code. It is an essential skill for any programming. Bugs can take many forms: typos, incorrect syntax, missing or improperly used elements (quotations, parentheses, spaces, etc.), as well as larger issues that result from coded items interacting in an unanticipated manner. Regardless of the skill of the programmer, bugs are a part of coding and learning to locate them in your code takes patience and practice. Prompt: This assignment presents you with broken code that you will need to debug. Analyze the existing source code to identify and correct all bugs. Include a brief written summary of the process you used, the issues you found, and how you corrected them. The following critical elements should be addressed in your project submission: Locate and fix the multiple syntax errors. Ensure that loops/flow control statements function properly. Edit the code to account for case-sensitivity of variables . Verify that the program output matches the problem statement requirements, fixing defects as necessary. Include a brief summary of your debugging process and the errors you corrected. // UserMenu_Solution.cpp : This code contains five errors before it will work as desired. Find those errors, // document a description of the errors and their fix, and fix them. Try using the debugger to // step through the program to find the bugs. As you step through, take notice of the information // you can see. //This program builds a menu based on switchcase statements to determine where a user wants to go in the program. // Program options are then to solve the Tower of Hanoi problem, view the user profile, or exit the program
// UserMenu_Solution.cpp : This code contains five errors before it will work as desired. Find those errors,
// document a description of the errors and their fix, and fix them. Try using the debugger to
// step through the program to find the bugs. As you step through, take notice of the information
// you can see.
//This program builds a menu based on switchcase statements to determine where a user wants to go in the program.
// Program options are then to solve the Tower of Hanoi problem, view the user profile, or exit the program.
#include "stdafx.h"
#include
#include
void Tower(int, char, char, char);
int main()
{
int choice;
cout << "1. Solve the Tower of Hanoi" << endl;
cout << "2. View Your Profile" << endl;
cout << "3. Exit" << endl;
cout << "Enter your choice : " << endl;
cin >> choice;
switch (Choice)
{
case 1:
system("cls");
int numDiscs;
cout << "**Tower of Hanoi** ";
cout << Enter the number of discs : ;
cin >> numDiscs;
cout << " ";
Tower(numDiscs, 'A', 'B', 'C');
break;
case :
cout << "Username:\t\tPlayer 1" << endl;
cout << "Gamertag:\t\tImTheBest" << endl;
cout << "No. Hours Played:\t173" << endl;
break;
case 3:
cout << "Now Exiting." << endl;
break;
default:
cout << "You did not choose anything...so exit this program." << endl;
}
return 0;
}
void Tower(int numDiscs, char from, char aux, char to){
if (numDiscs == 1){
cout << "\tMove disc 1 from " << from << " to " << to << " ";
return;
}
else{
tower(numDiscs - 1, from, to, aux);
cout << "\tMove disc " << numDiscs << " from " << from << " to " << to << " ";
Tower(numDiscs - 1, aux, from, to);
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started