473,387 Members | 1,476 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,387 software developers and data experts.

Need help with homework questions

i'm tryin to make this program,

here is the qouestion

----------------


(a) (i) Ask the user whether the user wants to continue or stop (use while loop).
(ii) If the user wants to continue:
- Ask the user for the salesperson id and salary.
- Ask the user to enter quantity for 2 products (use for loop).
- Calculate the total quantity.
- If total is more than 500, a bonus of 20% of the salary is given.
- Calculate the nett salary ( nett salary = salary + bonus ).
- Display the salesperson id, salary, bonus and nett salary.
- Again ask the user whether the user wants to continue or stop.
(iii) if the user wants to stop, terminate the program


-----------------

Do you want to continue [Y/N] ? : Y

---------------------------------------------
SALESPERSON DETAILS
---------------------------------------------
Enter Salesperson ID : 1111

Enter Salesperson Salary : RM 5000.00

Enter product 1 quantity : 300
Enter product 2 quantity : 100

---------------------------------------------
SALARY DETAILS
---------------------------------------------
Salesperson ID : 1111
Salary : RM 5000.00
Bonus : RM 0.00
Nett Salary : RM 5000.00


Do you want to continue [Y/N] ? : Y

---------------------------------------------
SALESPERSON DETAILS
---------------------------------------------
Enter Salesperson ID : 2122

Enter Salesperson Salary : RM 3000.00

Enter product 1 quantity : 4500
Enter product 2 quantity : 345

---------------------------------------------
SALARY DETAILS
---------------------------------------------
Salesperson ID : 2122
Salary : RM 3000.00
Bonus : RM 600.00
Nett Salary : RM 3600.00


Do you want to continue [Y/N] ? : N

Press any key to continue
Aug 28 '06 #1
1 1773
Banfa
9,065 Expert Mod 8TB
This sounds like a homework question and the general rule of thumb we apply here is that we will help anyone to iron out the bugs in the code they have already written but we do not do their homework for them.

Post an attempt at a solution and we will help you make it work.
Aug 28 '06 #2

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

Similar topics

3
by: Troy | last post by:
I would really appreciate it if someone could give me the answers or direct me to a place that would have the answers to the following 5 questions. 1. I need an example of SQL select statement....
4
by: Raju Shrestha | last post by:
I have two tables Income(Date, IncomeType, Amount) and Expense(Date, ExpenseType, Amount). I want to create a balance sheet report for which need a query or view which creates a virtual table of...
33
by: ankursinha | last post by:
Hi, Is it possible to write a C program that prints "Hello World" on screen without having a single semi-colon in the entire program? The extra constraint here is that u r not allowed to use...
13
by: XXXXXX.working.in.my.blood | last post by:
hi all, i need help with linked lists... the problem is this, "reverse the contents of a singly linked list without using a temporary node"... solution with code will be appreciated...
34
by: Mark Kamoski | last post by:
Hi-- Please help. I need a code sample for bubble sort. Thank you. --Mark
15
by: carr4895 | last post by:
Hello. I was wondering if someone could help me too with a login form. Upon startup, I have to display a password screen and it should accept a user name and password. User name can be anything...
2
by: nicks | last post by:
Hi there ! i need a bit of help as i am a new c++ user to write a program. The program should ask the user n questions or until the user enters -1 to Exit (n should be a constant and it should be...
18
by: __PPS__ | last post by:
Hello, I'm a university student and I'm preparing for my final today. I'm reading course notes, I found completely strange piece of code. It makes me laugh, I think the teacher needs to prepare...
10
by: Peschtra | last post by:
Hello -- I am trying to write to a a MySql database using php, and I seem to be hitting a wall. I am attaching my php file in case someone can look at it. When I run it, I don't get any error...
24
by: Three Headed Monkey | last post by:
write a program in "C" language that computes 9^(8^(7^(6^(5^(4^(3^(2^1))))))) I tried #include <stdio.h> int pow(int n) { int i,power; power=n;
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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...

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.