Solved

IF Statements

Posted on 2000-03-15
6
211 Views
Last Modified: 2010-04-02
Program calculates rate of pay, it get the hours and rate from user.
For any hours over 40 hours are paid at a rate of 1.5 times the normal hourly rate.

Question 1
Calculate and display any overtime earnings - both basic, overtime and total earnings.
If there is no overtime then simply display basic earnings.

Question 2
Tax is paid at 20% on amounts over the tax free allowance (which is 44).
Calculate and display the amount of tax due together with the net wages.
0
Comment
Question by:edicts
6 Comments
 

Author Comment

by:edicts
ID: 2620630
Need answer As Soon As Possible - URGENT Response needed.
0
 
LVL 1

Accepted Solution

by:
ntdragon earned 100 total points
ID: 2620702
int main(){
  float rate=15;//i don't know how do  
              //you get the rate
  float hours=50;//same about the hours
  float basic=0;
  float overtime=0;
  float tax=0;
  float salary;
  cout<<"user info ...\n--------------\n";
  if (hours>40){
  basic=40*rate;
  cout<<"Basic hours:40\n";
  cout<<"Basic pay:"<<basic<<'\n';
  overtime=(hours-40)*rate*1.5;
  cout<<"Overtime hours:"<<hours-40<<'\n';
  cout<<"Overtime pay:"<<overtime<<'\n';
  }
  else{
   basic=hours*rate;
   cout<<"Basic hours:"<<hours<<'\n';
   cout<<"Basic pay:"<<basic<<'\n';
  }
  if (basic+overtime>44)  
     tax=(basic+overtime)*20/100;
  cout<<"Tax are:"<<tax<<'\n';
  salary=basic+overtime-tax;
  cout<<"Full Salary:"<<salary<<'\n';
  return 0;
}
   

}
0
 
LVL 22

Expert Comment

by:nietod
ID: 2620714
We cannot provide answers to school assignments.  That is grounds for removal from this site.  (for both you and the experts involved.)  We can provide only limitied help in accademic assignments.    We can answer specific (direct) questions, like you might ask your teacher.  We can review your work and post suggestions, again, like your teacher might do.

Do you have specific questions?
Do you have any work on this (incomplete even) that we can review?


ntdragon, please make note of this for the future!
0
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
LVL 22

Expert Comment

by:nietod
ID: 2620725
FYI, there is a problem in the calculation of the tax.  edicts, why don't you try to fix the problem and post what you get done, then we can tell you if it is right or make suggestions for improvement.
0
 
LVL 3

Expert Comment

by:akalmani
ID: 2622125
I agree to neitod u should not provide answers to school assignments. Please post some code so that we can assist to solve u r problems. Atleast make a try other wise u will never learn.
0
 

Expert Comment

by:padmashali
ID: 2624028
Problem can be from school or college too. What we shall see is that questions are of some standard. Not the one like this which is a very simple program of academic interest.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
GUI: DIalog Stacking and Popping in MS C++ 4 82
Which Linux flavors will this run on? 6 96
Issues with C++ Class 19 101
Gaming Software 1 19
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question