Results 1 to 10 of 10
Thread: help in
- 11-25-2010, 06:04 AM #1
Member
- Join Date
- Nov 2010
- Posts
- 4
- Rep Power
- 0
help in
Hi everyone, could any one help me solving my problem
actually it's assignment & i'm new in java i can't solve it
i have been asked to develope java console program,, this program to manage a vegie fruit shop
1-enter the name of product
2 weight of it
3 price per kilo
4-enter the discount if not enter zero
i must use BufferedReader
Plz guys i am waiting 4 helpLast edited by aussi; 11-25-2010 at 06:12 AM.
- 11-25-2010, 06:13 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
So what you've done so far? This is a forum, not a place to get done your assignments. So you've to show some effort here.
- 11-25-2010, 06:26 AM #3
Member
- Join Date
- Nov 2010
- Posts
- 4
- Rep Power
- 0
that what i've doneJava Code://import java.io.BufferedReader; //import java.io.InputStreamReader; import java.io.*; import java.lang.*; import java.text.*; public class FruitVegShop { public static void main (String[]args) throws IOException { String name= ("Banana"); double wieghtOfProduct=1.3; double PricePerKilogram=2.5; double DiscountForStudentStaff=1; double Total=wieghtOfProduct *PricePerKilogram; BufferedReader Keyboardln=new BufferedReader(new InputStreamReader (System.in)); System.out.println("Please enter the name of product .."); name=Keyboardln.readLine(); System.out.println("The name of product is "+ name); System.out.println("Please enter Wieght Of Product.."); wieghtOfProduct=Double.parseDouble(Keyboardln.readLine()); System.out.println("The weight of product is"+ wieghtOfProduct); System.out.println("Please enter the price per kilogram.."); PricePerKilogram=Double.parseDouble(Keyboardln.readLine()); System.out.println("The price per kilogram"+ PricePerKilogram); Total=Double.parseDouble(Keyboardln.readLine()); System.out.println("The Total="+Total); System.out.println("The product name is ,,"+ name+" The weight of Product is "+wieghtOfProduct+"The discount is"+DiscountForStudentStaff+"The Total purchase is"+Total+"."); } }//end classLast edited by Eranga; 11-25-2010 at 06:35 AM. Reason: code tags added
- 11-25-2010, 06:36 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Please use code tags next time, for posting code segments. Unformated codes are rally hard to read. If you don't know how to do it, check my forum signature.
Lets look at your question. :)
- 11-25-2010, 06:45 AM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Your first task it to enter the product name. Do you want to select it from a list, or user can enter anything they wish?
- 11-25-2010, 06:54 AM #6
Member
- Join Date
- Nov 2010
- Posts
- 4
- Rep Power
- 0
the users can enter anything they want
- 11-25-2010, 07:08 AM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Other than that rest of it seems fine. So where you stuck?
- 11-25-2010, 07:21 AM #8
Member
- Join Date
- Nov 2010
- Posts
- 4
- Rep Power
- 0
if fact i cant do the arthmatic operation .finally doesnt give me the total and the discount?!!
- 11-25-2010, 08:37 AM #9
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 11-25-2010, 12:46 PM #10
Hi sorry to bump in but aussi can you pls tell me which part of code deals with the step
enter the discount if not enter zero
OK leave the code part ... Making the process simpler can you just describe how you calculate "Total purchase Amount" when given with parameters
Weight
Price/Kg
Discount
warm regards
Vinod M
____________________________
Give me beans .........


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks