Click here to Skip to main content
15,919,774 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to view anonymous namespace variables' values in debugger? Pin
Tim Finer4-Nov-02 12:27
Tim Finer4-Nov-02 12:27 
GeneralRe: How to view anonymous namespace variables' values in debugger? Pin
Christian Graus4-Nov-02 12:35
protectorChristian Graus4-Nov-02 12:35 
AnswerRe: How to view anonymous namespace variables' values in debugger? Pin
jbarton5-Nov-02 5:04
jbarton5-Nov-02 5:04 
GeneralRe: How to view anonymous namespace variables' values in debugger? Pin
Tim Finer5-Nov-02 7:08
Tim Finer5-Nov-02 7:08 
AnswerRe: How to view anonymous namespace variables' values in debugger? Pin
dshatilov15-Sep-16 0:29
dshatilov15-Sep-16 0:29 
GeneralRe: How to view anonymous namespace variables' values in debugger? Pin
Richard Deeming15-Sep-16 7:10
mveRichard Deeming15-Sep-16 7:10 
GeneralRe: How to view anonymous namespace variables' values in debugger? Pin
dshatilov15-Sep-16 7:56
dshatilov15-Sep-16 7:56 
GeneralPlease Help!! Pin
Autunmsky4-Nov-02 11:38
Autunmsky4-Nov-02 11:38 
I'm working on this program and it has me stumped!!! Any help would be grateful. I'm trying to have the computer tell me if it is a triangle or not....if it is a triangle it has to tell me if it is an equil., isosoceles, or scalene. If it is not a triangle then I need to have my else statement. For some reason I just can't get it perfect. Thanks again!!

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

using namespace std;


const string EQUIL = "equilateral";
const string ISOS = "isosceles";
const string SCALE = "scalene";


void DisplayOpeningScreen();
void Print6BlankLines();

int main()

{
int side1;
int side2;
int side3;
int halfper;
int area;
string equil;
string isos;
string scal;


// Display an opening screen and explain the program to the user

DisplayOpeningScreen();


// Have the user input 3 values representing the sides of a triangle

cout << "\nEnter first side of triangle: ";
cin >> side1;
cout << "Enter second side of triangle: ";
cin >> side2;
cout << "Enter thrid side of triangle: ";
cin >> side3;


if ((side1 + side2) > side3 && (side2 + side3) > side1 && (side1 + side3) > side2)

{ cout << "\n\nThe three lengths can form a triangle.\n\n";

if ((side1 == side2) && (side2 == side3) && (side1 == side3))

equil = EQUIL;
cout << "This triangle is an " << equil << endl << endl;

else if ((side1 == side2) || (side2 == side3) || (side1 == side3))

isos = ISOS;
cout << "This triangle is an " << isos << endl << endl;

else;

scal = SCALE;
cout << "This triangle is an " << scal << endl << endl;
}

else
{
cout << "\n\nThe three lengths can not form a triangle.\n\n";
}




return 0;

}

//********************************************************************************************************************************************

void DisplayOpeningScreen()
// Purpose: Explains the program to the user

{

cout << "\n Welcome to the \"Triangle Program\"\n";

Print6BlankLines();

cout << " You will be asked to enter 3 integer values to represent the sides of a triangle.\n";
cout << " A message will be printed stating whether or not the 3 lengths can form a triangle.\n";
cout << " For valid triangles, a messge corresponding to the triangle's type will be printes.\n";
cout << " Finally, the area of the triangle using Hero's formula which is:\n\n";
cout << " area = squareroot (s)(s - a) (s - b) (s - c)\n";

Print6BlankLines();

// Pause and then clear the screen
system("pause");
system("cls");

}


//********************************************************************************************************************************************

void Print6BlankLines()
// Purpose: Prints 6 blank lines on the output screen

{

cout << "\n\n\n\n\n\n";

}



I know I haven't used the area and the halfper yet....I need to figure out this part first!!! Thanks everyone!!

Eek! | :eek: WTF | :WTF:

Autumn Smile | :)
GeneralRe: Please Help!! Pin
Christian Graus4-Nov-02 11:50
protectorChristian Graus4-Nov-02 11:50 
GeneralRe: Please Help!! Pin
Gary Kirkham4-Nov-02 11:48
Gary Kirkham4-Nov-02 11:48 
GeneralRe: Please Help!! Pin
Autunmsky4-Nov-02 11:55
Autunmsky4-Nov-02 11:55 
GeneralRe: Please Help!! Pin
Christian Graus4-Nov-02 12:22
protectorChristian Graus4-Nov-02 12:22 
GeneralRe: Please Help!! Pin
Chris Losinger4-Nov-02 12:23
professionalChris Losinger4-Nov-02 12:23 
GeneralRe: Please Help!! Pin
Christian Graus4-Nov-02 12:33
protectorChristian Graus4-Nov-02 12:33 
GeneralRe: Please Help!! Pin
Chris Losinger4-Nov-02 15:01
professionalChris Losinger4-Nov-02 15:01 
GeneralRe: Please Help!! Pin
Christian Graus4-Nov-02 15:17
protectorChristian Graus4-Nov-02 15:17 
GeneralRe: Please Help!! Pin
Chris Losinger4-Nov-02 17:29
professionalChris Losinger4-Nov-02 17:29 
GeneralRe: Please Help!! Pin
Autunmsky4-Nov-02 12:57
Autunmsky4-Nov-02 12:57 
GeneralRe: Please Help!! Pin
Christian Graus4-Nov-02 13:12
protectorChristian Graus4-Nov-02 13:12 
GeneralRe: Please Help!! Pin
Autunmsky4-Nov-02 14:29
Autunmsky4-Nov-02 14:29 
GeneralHelp with Dialog Toolbars Pin
Steven M Hunt4-Nov-02 10:33
Steven M Hunt4-Nov-02 10:33 
GeneralRe: Help with Dialog Toolbars Pin
dabs4-Nov-02 10:50
dabs4-Nov-02 10:50 
GeneralCMenu question. Pin
Anonymous4-Nov-02 10:11
Anonymous4-Nov-02 10:11 
QuestionHow do i at runtime, draw a bitmap in my application? Pin
Anonymous4-Nov-02 9:45
Anonymous4-Nov-02 9:45 
AnswerRe: How do i at runtime, draw a bitmap in my application? Pin
Christian Graus4-Nov-02 9:56
protectorChristian Graus4-Nov-02 9:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.