473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to calculate financial year bonus?

4
I'm too dummy. Pls help me...


The question:


Write a C program that accepts for staff of cOMPANY two data values: monthly salary
(ringgit amount) and a character value for performance evaluation. The performance
evaluation can have the values E (exceed expectation), M (meet expectation), and N
(need improvement). We want the program to compute and display the bonus for the
financial year for each staff. Every staff will get 0.5 month salary bonus. The staff will
also get extra bonus depending on their performance evaluation:




-Performance Evaluation = Extra Bonus-
-E = - 2.5 months-
-M = -1.5 months-
-N = -0.25 month-




Meaning, if a staff gets RM 2,000 monthly and gets M for the performance evaluation,
the staff will get RM 4,000 bonus.
Your program should get the salary and performance evaluation for five (5) staff. Your
program should display the list of staff with their respective performance evaluation,
monthly salary and bonus. Display this list in decreasing order of bonus given.
Calculate and display the total bonus amount that Company gives to staff.



Note:
�� You are NOT allowed to use structure to solve this problem
�� Do error-checking for every input
�� Input for performance evaluation can be lower and upper case
�� You must use functions to solve this problem
�� Your program will be graded according to the correctness of the output, the
presentation of your output, your programming style, and the appropriateness of
the variables’ and functions’ names



Pls help me guys!!!!!!!!!!
Sep 25 '07 #1
7 4293
Meetee
931 Expert Mod 512MB
We are not allowed to help in assignments or homeworks until some efforts have been taken by the posters. Please read posting guidelines

Regards
Sep 25 '07 #2
sicarie
4,677 Expert Mod 4TB
Pls help me guys!!!!!!!!!!
Sure, what do you have so far?
Sep 25 '07 #3
p0lp0l
4
Sure, what do you have so far?
sicarie..

i dont have anything so far.
i'm so blur.. i have a lot of project to do..pls help me... i need to be submitted this friday..
pls help me...............
Sep 26 '07 #4
p0lp0l
4
#include <iostream> // for keyboard/screen I/O
#include <fstream> // for file I/O


using namespace std;

void CalcPay ( float, float, float& );

const float MAX_HOURS = 40.0; // Maximum normal hours
const float OVERTIME = 1.5; // Overtime pay factor



int main( )
{
float payRate; // Employee’s pay rate
float hourswork; // Hours worked
float wages; // Wages earned
float total; // Total company payroll
int empNum; // Employee ID number
int trnnum; // Employee TRN number
int category;
ofstream payFile; // Company payroll file

payFile.open( “payfile.dat” ); // Open file
total = 0.0; // Initialize total

cout << “Enter employee number: “; // Prompt

cin >> empNum; // Read ID number

while ( empNum != 0 ) // While not done
{
cout << “Enter pay rate: “;
cin >> payRate; // Read pay rate
cout << “Enter hours worked: “;
cin >> hourswork; // and hours worked
cout << "enter employee trn number";
cin >> "trnnumber";
cout << "enter category of employee";
cin >> "category";



If (hoursworked > 40) && (pay rate > 200) then
Print input data
Print appropriate message
Salary not calculated
Else
If( category = = “programmer”)
“Prompt user for schedule time”
If schedule time = = yes
Bonus = 5000
Weeklypay = bonus + (hoursworked * hourlyrate)
Else
Weeklypay = hoursworked *hourlyrate
print (payslip) weeklypay , input data
ElseIf (category = =”sales rep”)
Prompt user to enter weekly sales
If (weeklysales > 20000)
Commission = 2000
Weeklypay = commission + (hourlyrate * hoursworked)
print (payslip) weeklypay , input data
Else
If (weeklysales > = 10000) && (weekly sales < = 20000)
Commission = 1000
Weeklypay = commission + (hoursworked + hourlyrate)
print (payslip) weeklypay , input data
Endif
Else
If (hours worked > 30) then
Overtime = 40 – hoursworked
Overtimepay = 40- hoursworked
Weeklypay = (30* hourlyrate)+ overtimepay
Else
weeklypay = hoursworked * hourlyrate
print (payslip) weeklypay , input data
Endif
Endif

Totalwages = totalwages + weeklypay
Print totalwages
Write File with EmpNumber,TrnNumber,HoursWorked,PayRate,Totalsalar y
Endif code here
Sep 26 '07 #5
sicarie
4,677 Expert Mod 4TB
Okay, so you don't have code, and 20 minutes later you post code and what looked like pseudocode.

Did you have a question?
Sep 26 '07 #6
p0lp0l
4
Okay, so you don't have code, and 20 minutes later you post code and what looked like pseudocode.

Did you have a question?
sorry.. i'm just paste from what i found in the internet.. can u help me for this question?
thanks. n sorry.
Sep 27 '07 #7
sicarie
4,677 Expert Mod 4TB
sorry.. i'm just paste from what i found in the internet.. can u help me for this question?
thanks. n sorry.
Yes we can help, but as you said, all you did was cut and paste from the internet, you have to actually make an effort at it before we can help.
Sep 27 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: David | last post by:
I am learning plsql. I would like to run a stored procedure to calculate my bank account value by predicted 10% annual growth rate. Below is my plsql that is having problems. Your help is highly...
6
by: John Bentley | last post by:
John Bentley writes at this level: If we think about our savings accounts then division never comes in (as far as I can see). We deposit and withdraw exact amounts most of the time. Occasionaly...
2
by: Rustan | last post by:
Hi Im using GregorianCalendar to find out the current years week numbers. When the user chooses a week number in a dropdown i want to show that week in a table with the corresponding dates. For...
3
by: RD | last post by:
Say Company's financial year starts October First and say we are now March 17th. How do you determine which quarter of the Financial year - not the actual year - March 17th is in. Thanks for any...
6
by: Programador | last post by:
I'm getting this error when running this program: Cannot calculate rate using the arguments provided Module Module1 Sub Main() Rate(360, -694.44444444444446, 244274.69178082192) End Sub
9
by: Pierre Quentel | last post by:
Hi all, I have searched in the standard distribution if there was a function to return the difference between 2 dates expressed like an age : number of years, of months and days. The difference...
2
by: clarihorn | last post by:
I have a script which prints extracts from a database to produce an HTML report by month, grouped by calendar year. The relevant part of the script is below. I now want to adapt the script to group...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.