Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: JAVA HELP ASAP PLEASE

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    2
    My Mood
    Confused
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question JAVA HELP ASAP PLEASE

    THIS IS THE PROGRAMM I HAVE TO WRITE
    You have a store that sells the following items:
    Shoes $50.00
    T-shirts $30.00
    Shorts $75.00
    Caps $15.00
    Jackets $100.00

    Your sales associates need a program where they can enter customer information and calculate the customerís total bill.
    When the sales associate enters the program they should be presented with this main menu.
    Enter customer information
    Display Total Bill
    Quit

    If the sales associate selects option 1, the program should allow the sales associate to input their name, address, and e-mail address. Your program should then display this customer information to the screen with a message that the customer has been added to the customer list.

    If the sales associate selects option 2, the program should ask the sales associate for the customerís name, product that the customer is purchasing, the quantity, and the price of the product. The total bill will then be displayed to the screen and should include the following:

    The customerís name.
    The product the customer is purchasing, the quantity, and total cost
    The amount of tax 8%
    The total cost with tax.



    Example Total Bill Output:

    John Doe


    Product Purchased Quantity Total Cost
    Shoes 2 $100.00
    Tax 8%: $8.00
    Total Cost: $108.00

    HOW DO I WIITE IT


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,444
    Thanks
    49
    Thanked 2,218 Times in 2,191 Posts

    Default Re: JAVA HELP ASAP PLEASE

    First you need to work on the design for the program.
    When you have that, then worry about writing it.

    What steps must the program take to do the tasks listed in the assignment? Make a list.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Feb 2014
    Posts
    2
    My Mood
    Confused
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JAVA HELP ASAP PLEASE

    Thank you for replying and yes I already made a list and actually started writing the program.
    But I am confused when doing option 2 of the program I don't know how to calculate all the items.
    This is my code. it is a bit confusing since I just started and I don't have a clear idea but I hope u can help me figure out how to do it thank you,

    Steps
    declare variables
    create a scanner so the user decides option 1/option 2
    create an if statement. I completed option 1 the only one I need help doing option 2 and calculating and displaying the bill for the customer.
    Sorry if I am not being clear enough I am just confused since it is the first time I take a computer class


    import javax.swing.JOptionPane;
    import java.util.Scanner;
     
    public class DubonMartinez_PP1 {
     
    	public static void main(String[] args)
    	{
    		double shoes = 50;
    		double tshirts = 40;
    		double shorts = 75;
    		double caps = 15;
    		double jackets = 100;
    		double option;
    		double tax;
    		int products;
    		tax = 0.8;		
    		String input;
    		String option1;
    		String name;
    		String address;
    		String email;
    		String items;
    		Scanner keyboard = new Scanner(System.in);
    		input = JOptionPane.showInputDialog("Select option 1 (1) or option 2 (2)");
    		option = Double.parseDouble(input);
     
    		if (option == 1)
    		System.out.print("What is your name?");
    		name = keyboard.nextLine();
     
    		System.out.print("What is your address?");
    		address = keyboard.nextLine();
     
    		System.out.print("What is your email?");
    		email = keyboard.nextLine();
     
    		 JOptionPane.showMessageDialog(null,
    	               name + ", you have been added to the system");
     
    		 if (option == 2)
    		System.out.print("What is your name?");
    		 name = keyboard.nextLine();
     
    		 System.out.print("What item do you wish to buy?");
    		 items = keyboard.nextLine();
     
    		 System.out.print("How many products?");
    		 products = keyboard.nextInt();
    Last edited by gustavoed_1@yahoo.com; February 28th, 2014 at 01:48 PM.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,444
    Thanks
    49
    Thanked 2,218 Times in 2,191 Posts

    Default Re: JAVA HELP ASAP PLEASE

    Please edit your post and wrap your code with code tags:
    [code=java]
    YOUR CODE HERE
    [/code]
    to get highlighting and preserve formatting.

    I don't have a clear idea
    Do you have a list of steps the program is supposed to do?
    What steps have been completed?
    What step is giving you a problem?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Errors I don't know how to fix java beginner I need help ASAP
    By coding2 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 12th, 2014, 03:40 PM
  2. Double Negative VFX, London (UK) requires a Java Programmer ASAP!
    By natalie_dneg in forum Paid Java Projects
    Replies: 1
    Last Post: September 11th, 2012, 09:39 AM
  3. new to java need help with code asap
    By stark007 in forum Object Oriented Programming
    Replies: 1
    Last Post: November 13th, 2011, 12:25 PM
  4. Need simple JAVA program fixing ASAP
    By theviper in forum Paid Java Projects
    Replies: 1
    Last Post: April 14th, 2010, 10:59 AM
  5. Replies: 1
    Last Post: April 1st, 2009, 02:47 PM