Post: My first program + I need a bit of help about something. (C++)
11-28-2011, 07:55 PM #1
MacPale
Indeed.
(adsbygoogle = window.adsbygoogle || []).push({}); Hellllooooo so today i just made my first functional program well obviously I've done the "Hello World" ones but this is my first one that is somewhat useful and i created myself. So anyway here it is it works perfectly its just an application to calculate the Area and Perimeter of a right angled triangle using the lengths of the base height and hypotenuse. Its pretty simple just please remember im a complete noob only been learning c++ a day or 2 and this was off the top of my head.

#include <iostream>

using namespace std;
int main()
{

int base;
int hyp;
int height;
int perimeter;
int area;

cout<< "Enter the length of the base :" ;
cin>>base;
cout<< "Enter the length of the hypotenuse or slanted side :";
cin>>hyp;
cout<< "Enter the heighth of the triangle :" ;
cin>>height;

perimeter=base+hyp+height;
area=0.5*base*height;

cout<< endl;
cout<< "The perimeter is :" <<perimeter<<endl;
cout<< "The area is :" <<area<<endl;
cout<< endl;

system("PAUSE");
return 0;

}

ANYWAY where i need help is, althought the program runs perfectly im getting some errors while compiling and im hoping some of you programming genies can help me with this . Here are the errors im getting :

'Right angled triangle.exe': Loaded 'C:\Users\CPP\Documents\Visual Studio 2010\Projects\Right angled triangle\Debug\Right angled triangle.exe', Symbols loaded.
'Right angled triangle.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file
'Right angled triangle.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file
'Right angled triangle.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Cannot find or open the PDB file
'Right angled triangle.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded.
'Right angled triangle.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.
The thread 'Win32 Thread' (0xb80) has exited with code -1073741510 (0xc000013a).
The program '[2868] Right angled triangle.exe: Native' has exited with code -1073741510 (0xc000013a).

Cheers for looking guys hope you can help and remember im a noob and just used formulas from my head for this nothing special just trying to work on my programming heh Smile
(adsbygoogle = window.adsbygoogle || []).push({});
11-30-2011, 11:11 PM #11
MacPale
Indeed.
Originally posted by Epic
You will as you start to learn OOP. You'll definitely learn it if you take any computer science courses later on. They'll probably teach you something like Java. IMO, Ruby is the way to teach OOP.


The only place i could be doing any computer language would be college im thinking about Software Development but im just doing this because its fun I suppose and i like learning new things :L I wish our school did this tho but only 1 or 2 out of 100 would be interested
12-01-2011, 05:01 AM #12
Originally posted by MacPale View Post
Hellllooooo so today i just made my first functional program well obviously I've done the "Hello World" ones but this is my first one that is somewhat useful and i created myself. So anyway here it is it works perfectly its just an application to calculate the Area and Perimeter of a right angled triangle using the lengths of the base height and hypotenuse. Its pretty simple just please remember im a complete noob only been learning c++ a day or 2 and this was off the top of my head.

#include <iostream>

using namespace std;
int main()
{

int base;
int hyp;
int height;
int perimeter;
int area;

cout<< "Enter the length of the base :" ;
cin>>base;
cout<< "Enter the length of the hypotenuse or slanted side :";
cin>>hyp;
cout<< "Enter the heighth of the triangle :" ;
cin>>height;

perimeter=base+hyp+height;
area=0.5*base*height;

cout<< endl;
cout<< "The perimeter is :" <<perimeter<<endl;
cout<< "The area is :" <<area<<endl;
cout<< endl;

system("PAUSE");
return 0;

}

ANYWAY where i need help is, althought the program runs perfectly im getting some errors while compiling and im hoping some of you programming genies can help me with this . Here are the errors im getting :

'Right angled triangle.exe': Loaded 'C:\Users\CPP\Documents\Visual Studio 2010\Projects\Right angled triangle\Debug\Right angled triangle.exe', Symbols loaded.
'Right angled triangle.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file
'Right angled triangle.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file
'Right angled triangle.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Cannot find or open the PDB file
'Right angled triangle.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded.
'Right angled triangle.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.
The thread 'Win32 Thread' (0xb80) has exited with code -1073741510 (0xc000013a).
The program '[2868] Right angled triangle.exe: Native' has exited with code -1073741510 (0xc000013a).

Cheers for looking guys hope you can help and remember im a noob and just used formulas from my head for this nothing special just trying to work on my programming heh Smile


also a tip
when dealing with more than one integer variable just do this:
    
int base, hyp, height, perimeter, area;


saves room. just saying.
12-02-2011, 06:48 PM #13
MacPale
Indeed.
Originally posted by Docko412 View Post
also a tip
when dealing with more than one integer variable just do this:
    
int base, hyp, height, perimeter, area;


saves room. just saying.


Yep i know thanks anyway tho Smile

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo