Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9266483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:19:46+00:00 2026-06-18T14:19:46+00:00

So, I start debugging, and get through this much code, #include <cmath> #include <string>

  • 0

So, I start debugging, and get through this much code,

#include <cmath>
#include <string>
#include <iostream>

using namespace std;

int main()
{
    double radius,width,length,height,area,base;
    int shape;
    const double pi =3.14159;
    cout<< "Please choose from the following menu. \n"
            "Geometry Calculator \n"
            "1. Calculate the Area of a Circle \n"
            "2. Calculate the Area of a Rectangle\n"
            "3. Calculate the Area of a Triangle\n"
            "4. Quit\n";
    cin>>shape;
    if(shape>4 || shape < 1)
    {
        cout<<"Your selection was not acceptable.\n\a\a"
              "Please choose from the following menu. \n"
              "Geometry Calculator \n"
              "1. Calculate the Area of a Circle \n"
              "2. Calculate the Area of a Rectangle\n"
              "3. Calculate the Area of a Triangle\n"
              "4. Quit\n";
    }
switch (shape)
{
case '1':
    cout<<"What is the radius of the circle?\n";
    cin>>radius;
    if(radius<0)
    {
        cout<<"Please enter a non-negative radius.\n\a";
        cin>>radius;
    }

    area = pow(radius,2) * pi;

    cout<<"Your circle has an area of " <<area<<".";
    break;


case '2':
    cout<<"What is the width of the rectangle?\n";
    cin>>width;
    if(width<0)
    {
        cout<<"Please enter a non-negative width.\n\a";
        cin>>width;
    }
    cout<<"What is the length of the rectangle?\n";
    cin>>length;
    if(length<0)
    {
        cout<<"Please enter a non-negative length.\n\a";
        cin>>length;
    }
    area = length * width;
    cout<<"The area of your rectangle is " <<area<<".\n";
    break;

case '3':
    cout<<"What is the base of the triangle?\n";
    cin>>base;
    if(base<0)
    {
        cout<<"Please enter a non-negative base measurement.\n\a";
        cin>>base;
    }
    cout<<"What is the height of the triangle?\n";
    cin>>height;
    if(height<0)
    {
        cout<<"Please enter a non-negative height measurement.\n\a";
        cin>>height;
    }
    area = base*height*.5;
    cout<<"Your triangle's area is "<<area<<".\n";
    break;
}
}

Etc – I think it actually stops at the cin. The debugging window abruptly closes, and then this is what is shown in the output window when this happens:

'heather t chapter 4 21.exe' (Win32): Loaded 'C:\Users\Heather\Documents\Visual Studio 2012\Projects\heather t chapter 4 21\Debug\heather t chapter 4 21.exe'. Symbols loaded.
'heather t chapter 4 21.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'heather t chapter 4 21.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'heather t chapter 4 21.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'heather t chapter 4 21.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp110d.dll'. Symbols loaded.
'heather t chapter 4 21.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr110d.dll'. Symbols loaded.
The program '[3800] heather t chapter 4 21.exe' has exited with code 0 (0x0).

What in the world is happening, and how do I fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T14:19:47+00:00Added an answer on June 18, 2026 at 2:19 pm

    The problem is you are reading shape as an int but switching it as a char.
    Your switch cases should look like case 1:, not case '1':.

    To prevent the program from closing the console after it is done, you can add a cin.get() to wait for a key press at the very end of the code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I start a download using PHP with this code: <? $_REQUEST['file'] = urldecode($_GET['file']); header(Content-type:
Since a few days I'm unable to start resque I have tried debugging this
I'm having a tough time even finding a point to start debugging this. Basically,
This is more of a hypothetical whilst I'm debugging some code. Lets say I
When I start debugging the project we are currently working on, the program window
Sometimes when I set a breakpoint and start debugging its color changes from red
I'm debugging a service that's experiencing some problems on start-up. To aid me in
When I start my Silverlight 4 and 5 applications with debugging in VS 2010,
I've managed to get through my C++ game programming career so far virtually never
I'm getting the following error after I start debugging my program. Do you know

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.