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!!!!!!!!!!
7 4317 Meetee 931
Recognized Expert Moderator Contributor
We are not allowed to help in assignments or homeworks until some efforts have been taken by the posters. Please read posting guidelines
Regards
sicarie 4,677
Recognized Expert Moderator Specialist
Pls help me guys!!!!!!!!!!
Sure, what do you have so far?
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............. ..
#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,TrnNu mber,HoursWorke d,PayRate,Total salary
Endif code here
sicarie 4,677
Recognized Expert Moderator Specialist
Okay, so you don't have code, and 20 minutes later you post code and what looked like pseudocode.
Did you have a question?
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.
sicarie 4,677
Recognized Expert Moderator Specialist
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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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
appreciated.
Thanks
declare
money number := 50000.00;
year number := 1;
|
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
we get an interest payment. Unless the bank is cruel to its developers the
interest figure will be able to be exactly represented by a computer, something
like 4.1% as opposed to 4 1/3 %
125.78 * ' Initial Balance
04.1%
-------
|
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 example : the user choses week43 (this week)
so somehow i must calculate what date is startdate that week (monday 18th).
How do i do this with c# ?
all i know is that its-
|
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 help,
Bob
|
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
| |
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 between datetime
instances returns a timedelta object that gives a number of days, but
not an age
So is there such a function somewhere ? If not, for what reason, since
it's a rather usual task
|
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 by financial year eg 2007/08 March to April inclusive. Can anyone suggest how I could adapt the script, maybe be creating a new variable 'finyear'?
sub report_5 () {
my ($title) = @_;
output_title($title,5);
output_heading ('Month', '|...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |