Forum Topic: C++: Main

(14,098 views • 132 replies)

This topic is 5 pages long. [ 1 | 2 | 3 | 4 | 5 ]

<< < > >>
None

blah569

Reply To Post Reply & Quote

Posted at: 1/6/08 06:35 PM

blah569 DARK LEVEL 21

Sign-Up: 01/18/05

Posts: 2,685

I just wrote this tutorial: C++: Structs and Custom Functions.

PHP: Main | AS3: Main | Get Firefox | Host large files (fast and free)!
"Thank you for learning me English."

BBS Signature

None

FallingTears

Reply To Post Reply & Quote

Posted at: 9/18/08 07:03 PM

FallingTears LIGHT LEVEL 11

Sign-Up: 11/13/03

Posts: 261

I have a C++ Tutorial:

C++ Tutorial: Win Forms Made Easy

FallingTears

Every town has it's ups and downs. Sometimes ups out-numbers the downds, but not in Nottingham.
My Website | PHP: Main | FallenSword RPG - Play online now free!

BBS Signature

None

gumOnShoe

Reply To Post Reply & Quote

Posted at: 9/19/08 12:26 AM

gumOnShoe LIGHT LEVEL 15

Sign-Up: 05/29/04

Posts: 13,857

The c++ faq lite is kind of like the bible to c++ programming. I'm surprised to not see it here.

FORUM MODERATOR PM Forum Abuse to: Me :: AIM: gumOnShoeNG
Improve Your Responses >:(

BBS Signature

None

Bapabooiee

Reply To Post Reply & Quote

Posted at: 12/27/08 08:24 PM

Bapabooiee FAB LEVEL 12

Sign-Up: 08/14/04

Posts: 369

At 5/14/06 07:21 AM, FlashStation wrote: It seems to me that only a handful of users on NG only code with C++, come on guys, there has to be more.

Yeah =[ every time I visit this forum, I pretty much only see PHP threads, with a side of confused Flash scripters =[


None

StaliN98

Reply To Post Reply & Quote

Posted at: 1/11/09 08:24 AM

StaliN98 LIGHT LEVEL 10

Sign-Up: 07/27/07

Posts: 690

This needs an update page.


None

Jon-86

Reply To Post Reply & Quote

Posted at: 1/11/09 08:55 AM

Jon-86 NEUTRAL LEVEL 13

Sign-Up: 01/30/07

Posts: 3,858

At 1/11/09 08:24 AM, StaliN98 wrote: This needs an update page.

Unless your gonna post that update dont bump the topic!

PHP Main :: C++ Main :: Java Main :: irc.freenode.net

BBS Signature

None

schach

Reply To Post Reply & Quote

Posted at: 9/7/09 03:12 PM

schach NEUTRAL LEVEL 04

Sign-Up: 09/07/09

Posts: 6

I use the GNU C compiler (from the GNU compiler collection). Good editors are gVim, codeblocks, and Dev Bloodshed. Vim is a general purpose editor while codeblocks and bloodshed are geared specifically for C/C++. For just fooling around with C I'd recommend codeblocks.


None

kingdarkeyes

Reply To Post Reply & Quote

Posted at: 9/7/09 11:25 PM

kingdarkeyes DARK LEVEL 06

Sign-Up: 10/21/06

Posts: 493

Classes: What you didn't know
Howdy thar, I finally contributed something :)

BBS Signature

None

imdead597

Reply To Post Reply & Quote

Posted at: 9/13/09 07:44 PM

imdead597 DARK LEVEL 02

Sign-Up: 01/24/09

Posts: 57


None

Porkchop

Reply To Post Reply & Quote

Posted at: 10/29/09 09:06 PM

Porkchop FAB LEVEL 21

Sign-Up: 03/10/08

Posts: 4,749

Hey C++. i've got a question with decimals. I'm just starting out with C++ and i'm trying to code a program that will calculate simple interest.

The Simple interest equation is I = PRT
I = Interest
P = Principal (starting amount)
R = Interest rate (percentage)
T = Time in years.

Interest rate has to be a decimal number when it's being calculated. For example, if I had 5.4% interest, i'd have to plug it into a calculator as 0.054.

How can I change the output to put decimal places in so I dont have to have a user input it as a decimal?

Save a tree. Wipe your ass with an owl. <3 Mein NG Homies.

BBS Signature

None

Porkchop

Reply To Post Reply & Quote

Posted at: 10/30/09 10:42 AM

Porkchop FAB LEVEL 21

Sign-Up: 03/10/08

Posts: 4,749

This is my code, if my previous post was unclear.

// Financial calculator

#include <iostream>
using namespace std;

int main()
{
long Interest, Principal, Time;
float Rate;

cout << "What was the principal payment?" << endl;
cin >> Principal;

cout << "What's the interest rate?" << endl;
cin >> Rate;

cout << "How many years?" << endl;
cin >> Time;

Interest = Principal * Rate * Time;

cout << "The amount of interest you'll have earned will be $"<< Interest << endl << endl;

system("PAUSE");
return 0;
}

For a test input I enter the Principal as $4500, the Rate as 9.5%, and the Time at 6 yrs. The outcome is $256500. Is there a way for me to change the output from $256500 to $2565.00?

Save a tree. Wipe your ass with an owl. <3 Mein NG Homies.

BBS Signature

None

thingie-348

Reply To Post Reply & Quote

Posted at: 10/31/09 12:05 AM

thingie-348 EVIL LEVEL 07

Sign-Up: 11/27/05

Posts: 1,236


For a test input I enter the Principal as $4500, the Rate as 9.5%, and the Time at 6 yrs. The outcome is $256500. Is there a way for me to change the output from $256500 to $2565.00?

printf ("$%.02f", value / 100.) ;


None

Porkchop

Reply To Post Reply & Quote

Posted at: 10/31/09 09:33 PM

Porkchop FAB LEVEL 21

Sign-Up: 03/10/08

Posts: 4,749

At 10/31/09 12:05 AM, thingie-348 wrote:

For a test input I enter the Principal as $4500, the Rate as 9.5%, and the Time at 6 yrs. The outcome is $256500. Is there a way for me to change the output from $256500 to $2565.00?
printf ("$%.02f", value / 100.) ;

Thanks a lot!

Save a tree. Wipe your ass with an owl. <3 Mein NG Homies.

BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 06:48 PM

<< Back

This topic is 5 pages long. [ 1 | 2 | 3 | 4 | 5 ]

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!