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 7 of 7

Thread: Sales Generator

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Sales Generator

    How do I write a program that allows you to enter a sales person individual sales orders for one week period(assume the data are intergers). When finished entering sales enter zero, then print out how many orders that sales person had for the week and the total of all his/her orders for the week. Make sure that you prompt the user clearly identify your output.

    Sample run


    Enter this salesman's individual sales (one at a time):
    Enter Sale 100
    Enter Sale 150
    Enter Sale 200
    Enter Sale 450
    Enter Sale 500
    Enter Sale 0

    You took 5 orders this week

    The total of your orders is $1400

    Use while or do while in this program


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Sales Generator

    Do you have any specific questions about your assignment?
    Please post your code and any questions about problems you are having.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Jan 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Sales Generator

    What variables should I use and what calculations do i need?

    --- Update ---

    I don't have a problem with my code its just I haven't written any code and I need help starting.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Sales Generator

    Do you have a design for how the program will work? As you create that design, you make a list of the variables that the code will need to have to hold what data it needs.
    And you'll also list what computations you'll need. When you have the list, then do some research to find the formulas that are needed to do the computation.

    The items you ask for will come out as you design the program.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Jan 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Sales Generator

    I really dont know how to start the design is in my original post.

  6. #6
    Junior Member
    Join Date
    Jan 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Sales Generator

    How do I write a program that allows you to enter a sales person individual sales orders for one week period(assume the data are intergers). When finished entering sales enter zero, then print out how many orders that sales person had for the week and the total of all his/her orders for the week. Make sure that you prompt the user clearly identify your output.

    Sample run


    Enter this salesman's individual sales (one at a time):
    Enter Sale 100
    Enter Sale 150
    Enter Sale 200
    Enter Sale 450
    Enter Sale 500
    Enter Sale 0

    You took 5 orders this week

    The total of your orders is $1400

    Use while or do while in this program

  7. #7
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Sales Generator

    Designing a program is an iterative process: do a little, fix it, add some more, fix it, add some more, fix it, etc

    Start with a simple list of what the program needs to do. Then take each complex step in the list and break it into a list of simpler steps. Many programs have these three steps:
    Get data
    process data
    write a report

    The "get data" step might require asking the user for data, getting all the data needed from the user and saving it for the next step.
    The "getting all the data needed" step could require a loop that repeatedly asks the user for the the next item
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Sales not working
    By JeremiahWalker in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 9th, 2012, 10:07 AM
  2. Sales Analysis for various products
    By faridzul90 in forum Java Theory & Questions
    Replies: 3
    Last Post: September 22nd, 2011, 08:36 AM
  3. Replies: 0
    Last Post: January 25th, 2011, 01:24 AM