473,949 Members | 9,596 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can anyone help me wit this?

15 New Member
Question 1

The mail-order company requires a program to calculate discounts that it is giving to all its customers during a sales campaign. Write a program that asks the user to enter the total price of an order. If the order price is RM200.00 or less, the discount rate is 10%. If the order price is greater than RM200.00, the discount rate is 15%.The net price of the order is the price minus the discount. The program should display the price of the order, the discount amount, and the net price of the order. Design the program to process any number of orders. When there are no more orders to process, the program should display the number of orders it processed, the total of the prices, the total of the discounts, and the total of the net prices.


Sample output
Enter the total price of an order: RM150.50

Order price: RM150.50
Discount amount: RM15.05
Net order price: RM135.45

Do you have any other orders to proceed? (y/n) : y

Enter the total price of an order: RM420.30

Order price: RM420.30
Discount amount: RM63.05
Net order price: RM357.25

Do you have any other orders to proceed? (y/n) : y

Enter the total price of an order: RM200.00

Order price: RM200.00
Discount amount: RM20.00
Net order price: RM180.00

Do you have any other orders to proceed? (y/n) : n

Total number of orders: 3
Total order prices: RM770.80
Total discounts: RM98.10
Total net prices: RM672.70

Can anyone help me ..i juz don get it?
May 18 '07 #1
3 1460
JosAH
11,448 Recognized Expert MVP
Can anyone help me ..i juz don get it?
What is it that you 'juz don't get'? The structure of your program should be
something like this:
Expand|Select|Wrap|Line Numbers
  1. while more orders to process
  2.    process order and do some bookkeeping
  3.  
  4. print out statistics
kind regards,

Jos
May 18 '07 #2
shadachi
15 New Member
can ya post a sample of anything..

coz i am new to java... ><

thx in advanced
May 18 '07 #3
prometheuzz
197 Recognized Expert New Member
can ya post a sample of anything..

coz i am new to java... ><

thx in advanced
Try to whip up some code yourself: otherwise you will remain "new to java".
Here's some sample code for a while-statement:
http://java.sun.com/docs/books/tutor...lts/while.html
May 18 '07 #4

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

Similar topics

0
1348
by: asdf sdf | last post by:
i have an install issue with moinmoin on win2k. i've tried the mailing list, but it appears to be a very low traffic, low subscriber list. can i get a reality check? is anyone using moinmoin in win2k? any issues? anyone at all?
1
2112
by: Simon Harvey | last post by:
Hi chaps, Does anyone know if the beast is going to release Visual Tools for office to work with Visual Studio 2002 and not just 2003, or are they quite happy to shaft those that supported them when their product just cam out. I can't see why the tools shouldnt work with 2002 seeing as its almost identical to 2003. Has anyone heard anything
1
1497
by: Greg Steele | last post by:
Does anyone have a copy or know where I can get an installation executable for chiliReports 2.0 from chili! soft? The company I'm working for bought a copy several years ago, then moved their datacenter and lost the installation in the process. I have the registration e-mail that was sent to them with the unlocking code so we just need the trial installation executable.
2
3698
by: Ken Shaw | last post by:
G'day, I'm trying to tack down any delta compression library that I could licence for use in a project. Does anyone know of a decent binary delta compression library? cheers, Ken Shaw
0
2287
by: james | last post by:
Hi guys! I´ve got a centerd table on my site with a black 1 pixel border. What i would like to do is to add a drop shadow to the table. Anyone know if it's possible to create a drop shadow for a table? Does anyone has an example? Thanks, James
162
7399
by: Isaac Grover | last post by:
Hi everyone, Just out of curiosity I recently pointed one of my hand-typed pages at the W3 Validator, and my hand-typed code was just ripped to shreds. Then I pointed some major sites (microsoft.com, cnn.com, etc.) at the W3 Validator; to my surprise none of them passed. Doesn't anyone care anymore, or are the standards more-or-less looked at as guidlines for web design?
0
1083
by: Jay1969 | last post by:
Hey all, I heard there was a new service offered to Microsoft partners called ISV Advisory Services (see link) where MS is giving free dev consulting to their Partners. https://partner.microsoft.com/global/40016379 Has anyone in these groups had a chance to try them out? It sounds like it may be a good service but I'd like to hear from anyone who's
13
2248
by: penguin732901 | last post by:
Checking back for discussions, there was a lot of talk about 2000 being slower than 97, but not so much lately. What is the latest opinion? Anyone care to set up a poll for how many NG members are still using 97? 2000? I am slightly tempted to upgrade by a new client whose data is in 2000, but of course, I can just port it all back through Excel...right? and I guess I have seen a couple of nice features...
2
3917
by: Brent Taylor via AccessMonster.com | last post by:
HELP----DOES ANYONE HAVE A SIMPLE .mdb for MLM structure? Does anyone have an example database for multi-level marketing for a 3 Tier setup? Thank you, brenttaylor@actionimports.net
2
2333
by: Bruno Alexandre | last post by:
Hi guys, does anyone know where is the Website used in the MSDN "Lear ASP.NET 2.0 with Jeff Prosise" (http://msdn.microsoft.com/asp.net/beta2/multimedia/default.aspx) events? The website used is called "Contoso", but I can't find it in the MSDN site, so I can evaluate it with the webcasts. If anyone know here is it, or if anyone is using it, please post here a
0
9990
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,...
0
11592
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...
0
11188
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 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...
1
11359
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
10699
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
9903
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
7435
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
6349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3553
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.