473,402 Members | 2,050 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,402 software developers and data experts.

Salary program

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 3865
vninja
40
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
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...
11
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...
2
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 ...
5
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...
1
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...
5
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%...
8
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...
4
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...
1
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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...
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,...
0
isladogs
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...

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.