#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

#### Categories

Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

# c++ code

Posts: 6Member
anyone can help me...

translate the given statements into c++ code.

Calculate gross-pay as hours_worked multiplied by pay_rate. If gross_pay is less than 100,00, calculate as 12% of gross_pay. IF gross_pay is greater than or equal to 100.00, calculate tax as 15% of gross_pay. In either case, calculate late net-pay as tax subtracted from gross_pay.
· ·

• Posts: 621Member
: anyone can help me...
:
: translate the given statements into c++ code.
:
: Calculate gross-pay as hours_worked multiplied by pay_rate. If gross_pay is less than 100,00, calculate as 12% of gross_pay. IF gross_pay is greater than or equal to 100.00, calculate tax as 15% of gross_pay. In either case, calculate late net-pay as tax subtracted from gross_pay.
:
What part of the code you have already written gives you trouble?

Greets,
Eric Goldstein
http://www.gvh-maatwerk.nl

· ·
• Posts: 6Member
: : anyone can help me...
: :
: : translate the given statements into c++ code.
: :
: : Calculate gross-pay as hours_worked multiplied by pay_rate. If gross_pay is less than 100,00, calculate as 12% of gross_pay. IF gross_pay is greater than or equal to 100.00, calculate tax as 15% of gross_pay. In either case, calculate late net-pay as tax subtracted from gross_pay.
: :
: What part of the code you have already written gives you trouble?
:
: Greets,
: Eric Goldstein
: http://www.gvh-maatwerk.nl
:
: all of it.... i am confused, if someone can start me, i believe i can finish the code
:

· ·
• Posts: 9,763Member
: :
: : all of it.... i am confused, if someone can start me, i believe i can finish the code
: :
:
:

solve it with pencil & paper first, then maybe you can get starded with the C program. Also make sure you study your book and do the problems at the end of the chapters.

[code]
int main()
{

return 0;
}
[/code]
· ·
• Posts: 6Member
: : :
: : : all of it.... i am confused, if someone can start me, i believe i can finish the code
: : :
: :
: :
:
:
: solve it with pencil & paper first, then maybe you can get starded with the C program. Also make sure you study your book and do the problems at the end of the chapters.
:
: [code]
: int main()
: {
: // put your code here
:
: return 0;
: }
: [/code]
:

o.k. thanks

· ·
• Posts: 6Member
: : : :
: : : : all of it.... i am confused, if someone can start me, i believe i can finish the code
: : : :
: : :
: : :
: :
: :
: : solve it with pencil & paper first, then maybe you can get starded with the C program. Also make sure you study your book and do the problems at the end of the chapters.
: :
: : [code]
: : int main()
: : {
: : // put your code here
: :
: : return 0;
: : }
: : [/code]
: :
:
: o.k. thanks
:
:

· ·
• Posts: 6Member
: : : : :
: : : : : all of it.... i am confused, if someone can start me, i believe i can finish the code
: : : : :
: : : :
: : : :
: : :
: : :
: : : solve it with pencil & paper first, then maybe you can get starded with the C program. Also make sure you study your book and do the problems at the end of the chapters.
: : :
: : : [code]
: : : int main()
: : : {
: : : // put your code here
: : :
: : : return 0;
: : : }
: : : [/code]
: : :
: :
: : o.k. thanks
: :
: :
:
:

i know the pseudo code goes like this, now i have to do the c++
code..

> // Read in the HoursWorked (I assume you are using
> cin statements)
> // Read in the PayRate
> // Calculate the gross pay (Gross Pay = HoursWorked
> * PayRate)
> // Next Calculate the TaxRate
> // If (GrossPay < 100)
> // TaxRate = .12
> // Else
> // TaxRate = .15
> // Now we can calculate the tax
> // Tax = TaxRate * GrossPay
> // And finally the NetPay
> // NetPay = GrossPay Tax

· ·
• Posts: 6,519Member
: > // Read in the HoursWorked (I assume you are using
: > cin statements)
: > // Read in the PayRate
: > // Calculate the gross pay (Gross Pay = HoursWorked
: > * PayRate)
: > // Next Calculate the TaxRate
: > // If (GrossPay < 100)
: > // TaxRate = .12
: > // Else
: > // TaxRate = .15
: > // Now we can calculate the tax
: > // Tax = TaxRate * GrossPay
: > // And finally the NetPay
: > // NetPay = GrossPay Tax
:
[blue]
Good!
Now start with taking user input. You need two values at first: HoursWorked and PayRate:

[code]
double HoursWorked;
double PayRate;

cout << "Please, enter hours worked: ";
cin >> HoursWorked;

// Now try to do the second one...
[/code]
[/blue]
· ·