The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Please help!

Posted by Matt Gerrans on November 13, 2001 at 4:07 PM

So... what's your question?

By the way, call me crazy, but I wouldn't choose killograms for the weight (or even mass) of a teabag, unless this tea is for the jolly green giant.

- mfg


> I'm new in java programming.
> I got two simple question here, hope someone can help me...

> Question 1:
> Write an application or applet that accept the unit weight of a bag of tea in KG and the number of bag sold and displays the total price of the sale. computed as
>
> totalPrice = unitWeight * numberOfUnits * 5.99;
> totalPriceWithTax = totalPrice + totalPrice * 0.0725;

> where 5.99 is the cost per Kg and 0.0725 is the sales tax. Display the result in the following manner.

> sample output:
> Number of bags sold: 32
> Weight per bag: 5 kg
> Price per kg: $5.99
> Sales tax: 7.25%
>
> Total price: $1027.884

>
> Question 2:
> A large company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson that sales $5000 worth of merchandise in a week receives $200 plus 9% of $5000, or a total of $650. You have been supplied with a list of items sold by each salesperson. The values of these items are as follows:

> Item Value
> 1 239.99
> 2 129.75
> 3 99.95
> 4 350.89

> Develop a java application or applet that inputs one salesperson's items sold for last week and calculates and display the salesperson's earnings. There is no limit to the number of items sold by a salesperson.





Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us