# Basic Paycheck Calculator

Page 1 of 1

## 2 Replies - 3246 Views - Last Post: 21 November 2008 - 02:15 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=72689&amp;s=4404d2b68d63133a3e3a30a7cb7e89ba&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 ZMAN86

Reputation: 0
• Posts: 1
• Joined: 19-November 08

# Basic Paycheck Calculator

Posted 19 November 2008 - 08:03 PM

I'm trying to learn C++ Programming in Linux and have decided to make a basic paycheck calculator, however, I am not getting too far with this task. This is what I have so far. Can anybody give me any advice on this subject?

#include <stdio.h>

int main(void)
{
printf("enter hours worked:");
printf("enter pay rate:);
return(0);
}
Is This A Good Question/Topic? 0

## Replies To: Basic Paycheck Calculator

### #2 DaneAU

• Great::Southern::Land

Reputation: 286
• Posts: 1,620
• Joined: 15-May 08

## Re: Basic Paycheck Calculator

Posted 19 November 2008 - 09:57 PM

Well you might need to do some reading on variables... As in int, float, double, bool, string, char... You will need to do something to take in the input, which i will leave to you to read up on - plenty of examples on here if you use the search function of this site

Also some other stuff would be looking at + - = * / and how they work... Anyway here is an example

```#include <iostream>

using namespace std;

double payRate = 15; // 15 dollars an hour
int hoursWorked = 10;
double totalPay = payRate * hoursWorked;

int main()
{
cout << "Pay Earnt \$ " << totalPay << endl;
return 0;
}

```

### #3 janotte

• code > sword

Reputation: 991
• Posts: 5,141
• Joined: 28-September 06

## Re: Basic Paycheck Calculator

Posted 21 November 2008 - 02:15 AM

ZMAN86, on 19 Nov, 2008 - 07:03 PM, said:

I'm trying to learn C++ Programming in Linux and have decided to make a basic paycheck calculator, however, I am not getting too far with this task. This is what I have so far. Can anybody give me any advice on this subject?
```#include <stdio.h>

int main(void)
{
printf("enter hours worked:");
printf("enter pay rate:);
return(0);
}

```

If you have a look at what I have done to your posting you'll see that your code is now in a box called 'code'.
I did this by wrapping the code in "[co de]" and "[/co de]" (without the spaces).
This is what posting rule 3 is asking you to do and it is good manners to do so when making a posting.