473,770 Members | 5,091 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Salary program

11 New Member
Basically my task is to write a program that computes and displays the weekly salaries of a company's salespeople based upon information entered by the user and that also displays the total for the week. Use a loop prompt the user to enter the gross sales in dollars and cents for each salesperson and use -1 to quit ... read in the entered value and display the salary for that salesperson immediately then go on to the next salesperson.

If the user enter a negative value other than -1 the program will reprompt as many times as needed for a non-negative value but use a nested loop. When the user is finished entering information for each salespeople he will enter -1 in which the program will display the final total salaries of all salespeople. Example: base pay is $250 plus 9.5% of gross sales for the week. If salesperson gross sales for the week is 200 then salary is 250+(200*9.5%)

Enter gross sales for salesperson#1 (or -1 to end): 200
Salary for salesperson #1 is $269.00

Enter gross sales for salesperson #2 (or -1 to end): 427.68
Salary for salesperson #2 is $368.82

Enter gross sales for salesperson #3 (or -1 to end): -23.45
Sales cannot be negative - please reenter:

etc.

I started the program but can't get it to count the number successfully for each salesperson and state their salary immediately after. Currently my program hangs and keeps repeating the first result of salary computed. Any ideas has how to do this. I greatly appreciate.
Oct 29 '06 #1
1 3882
vninja
40 New Member
well lets see your code. probably be easier to fix a problem when we can see potential areas where it could be.


are you using something similar to a while statement

while(input!=(-1))
{
int i=1;
get (i) 's gross sales;
input
if(input<-1)
error
else
i++
}
Oct 30 '06 #2

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

Similar topics

19
2252
by: ljb | last post by:
Anyone have a good idea for encrypting salary data in US $? I have an Access database with some salary info connected to ASP on our intranet. My manager is somewhat apprehensive about the level of security currently provided. I'm using basic authentication (I think that's what it is called). It relies on NT directory permissions and code to query "AUTH_USER". Does anyone have a simple encryption idea that can take US$, 5 digit employee ID,...
11
2122
by: reciprocity85 | last post by:
Hello all. I have a question about what you all get paid, and what I should expect in my situation. I googled quite a bit, but not come up with any benchmarks definite enough that I would want to approach my employer with, so I figured I would check with you, since presumably at least some of you do this for money. I have been with a small company in Laguna Hills, CA for almost two years now. I am the only programmer here...
2
1969
by: Deano | last post by:
OK, I'm working on a solution to the following problem but there are other ways to skin a cat as they say... Here's the table (simplified); ID EmployeeName SalaryAcc 1 Brown 3,475 2 Smith 12,302 3 Smith 19,450 4 Jones 16,700
5
8871
by: Stu | last post by:
What are .NET programmers making now a days? No one has to answer or give their exact salary, but I think it might be useful for those of us who think they might be underpaid :) I know it varies a lot by where you live and how much experience you have, so it will be hard to draw any conclusions. For example, I graduated from college about a year ago, have about 2 years experience with C# / ASP.NET, live in Cali, and I'm making around 45k....
1
11541
by: sallyk57 | last post by:
Help with following Programs: Write two programs one where the performance rating here shoud be entered as a int where Excellent =1, Good= 2, Poor=3. an employee who is rated excellent will receive a 6% raise, one rated good will receive a 4% raise, and one rated poor will receive a 1.5% raise. Add the if... else... statements to program Salary to make it run as described above. //...
5
8569
by: james121285 | last post by:
This is to calculate an employees tax and pension. The salary is input from the keyboard. The NI contribution is calculated as 6% of the gross salary. The pension contribution is calculated as 2% of the gross salary. The income tax is computed progressively after detracting NI and pension contributions. The taxable amount (after detractions) is divided into bands, each taxed at a different rate as follows: Gross yearly income: Tax rate:...
8
14781
by: hmmtn | last post by:
I would appreciate any help on this one. Assignment is as follows: Develop a program that will determine the gross pay for each of several employees. The company pays "straight time" for the first 40 hours worked by each employee and pays "time-and-a-half" for all hours worked in excess of 40 hours. You are given a list of the employees of the company, the number of hours each employee worked last week and the hourly rate of each employee....
4
7508
by: sonia.sardana | last post by:
I know how how to retrive the largest & second largest salary. tell me how to retrive the 3,4,5,...............Largest salary. Create table empl(empid int, empname varchar,salary int) insert into empl values(1,'A',100) insert into empl values(2,'B',200) insert into empl values(3,'C',300) insert into empl values(4,'D',400) insert into empl values(5,'E',500) insert into empl values(6,'F',600)
1
10235
by: ygsunilkumar | last post by:
select distinct (a.salary) from employees a where &N = (select count (distinct(b.salary)) from employees b where a.salary <= b.salary); Pls any one explain how the query works, logic behind it.
0
10228
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, 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...
1
10002
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9869
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 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...
0
8883
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6676
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();...
0
5312
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...
1
3970
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
2
3575
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.