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

Thread: Help with project please

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with project please

    hello all,

    I am building on my project and would like a hand to get it finished. I will post my entire project, then the questions that I have to answer. I know that I have errors in the project currently, and am going to post to get help on those, but if you would like to help with that also, great. ****I AM VERY NEW TO PROGRAMMING, so please list the codes that I may need, and where I should put it...thank you very much!

    ◦Enter if returning customer (must enter y or n)
    ◦Enter user name (must fill in a name)
    ◦Enter at least 1 product to order
    ◦Enter quantity (must enter 1–99)
    ◦Enter delivery address that includes street, city, state, and zip
    ◦Enter telephone number


     import javax.swing.*;
    public class comoanyname {
     
     
     
         public static void main(String args[]) {
     
            // declare and initialize variables
            String openingMsg, nameInputMsg, customerName, nameOutputMsg, 
                    returnInputMsg, customerReturn, returnOutputMsg, 
                    greetingOutputMsg, outputMsg; 
            String  openingMsg1, openingMsg2, openingMsg3, openingMsg4, openingMsg5, 
                    openingMsg6, openingMsg7;
            String  loginMsg,userid, pwMsg, password, returnFlag,
                    invalidEntry;
            Boolean returnYes, returnNo, returnInvalid, returnName, validCustomer,
                    reurnFlag;
     
     
     
            // display opening message
            openingMsg1 = "*** Welcome to companyname Online Ordering System ***";
            openingMsg2 = "You are now able to order items through our online ordering system";
            openingMsg3 = "take-out order system. \n\n";
            openingMsg4 = "The paint colors you can order are: ";
            openingMsg5 = "Red, Blue, White, Royal Blue, green";
            openingMsg6 = "The paint sizes that you can order are: ";
            openingMsg7 = "Small, Medium, and Large. \n\n";
            JOptionPane.showMessageDialog(null, openingMsg);
     
            //determing if they are a new or returning customer
            returnInputMsg = "Are you a returing customer (Enter y or n)?";
            customerReturn = JOptionPane.showInputDialog( returnInputMsg);
     
            returnYes = customerReturn.equalsIgnoreCase("y");
            returnNo = customerReturn.equalsIgnoreCase("n");
     
     
            //initialize return flag      
     
            if(returnYes)
                returnFlag = "1";
            if(returnNO)
                returnFlag = "2";
     
     
     
            //determing if new customer or returning customer
     
            switch(returnFlag)
            {
                case 1:
                    loginMsg = "Please enter your current username: ";
                    userid = JOptionPane.showInputDialog(null, loginMsg);
                    pwMsg = "Please enter your New Password: ";
                    password = JOptionPane.showInputDialog(null, pwMsg);
                    break;
                case 2: 
                    loginMsg = "Please enter your New username: ";
                    userid = JOptionPane.showInputDialog(null, loginMsg);
                    pwMsg = "Please enter your New passwprd: ";
                    password = JOptionPane.showInputDialog(null, pwMsg);
                    break;
                default:
                    JOptionPane.showMessageDialog(null, invalidEntry);
                    loginMsg = "Please enter your New username: ";
                    userid = JOptionPane.showInputDialog(null, loginMsg);
                    pwMsg = "Please enter your New password: ";
                    password = JOptionPane.showInputDialog(null, pwMsg);
            }//end switch
     
            //get required customer name using dialog boxes
     
             nameInputMsg = "Please enter your name: ";
             customerName = JOptionPane.showInputDialog( nameInputMsg );
     
             //repeat until a name is entered or exit after 3 tries
             for (int i=1; i<=3; i++)
             {
                 validCustomer = customerName.isEmpty();
                 if (validCustomer)
                 {
                     JOptionPane.showMessageDialog(null, invalidEntry);
                    if (==3)
                         System.exit(0);
                     else
                     {
                         nameInputMsg = "Please enter your name: ";
                         customerName = JOptionPane.showInputDialog( nameInputMsg);
     
                     }    
                 }    
                 else
                    break;
    }
     
            // build output strings
            nameOutputMsg = "Welcome " + customerName + ".\n";
            returnOutputMsg = "Your return customer status is " + customerReturn + ".\n";
            greetingOutputMsg = "Thank you for visiting companyname!" + ".\n";
     
            // create outputstring
            outputMsg = nameOutputMsg + returnOutputMsg + greetingOutputMsg;
     
     
            // display output message
            outputMsg = "*** Come back for future orders! ***";
            JOptionPane.showMessageDialog( null, outputMsg );
     
     
     
     
        } // end main
    } // end class


  2. #2
    Senior Member PhHein's Avatar
    Join Date
    Mar 2013
    Location
    Germany
    Posts
    609
    My Mood
    Sleepy
    Thanks
    10
    Thanked 93 Times in 86 Posts

    Default Re: Help with project please

    Do you have a question?

  3. #3
    Junior Member
    Join Date
    Nov 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help with project please

    yes, my questions are posted in my original post.

  4. #4
    Senior Member PhHein's Avatar
    Join Date
    Mar 2013
    Location
    Germany
    Posts
    609
    My Mood
    Sleepy
    Thanks
    10
    Thanked 93 Times in 86 Posts

    Default Re: Help with project please

    I don't see a question in your post.

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

    Default Re: Help with project please

    the question is can anyone help me with my project. I have to build a code that responds to the sentences above, I don't know how to do that.

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Help with project please

    Can you ask some specific questions about the problems you are having with the project?
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Junior Member
    Join Date
    Nov 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help with project please

    sure Norm,

    Can someone please help me create code for this:

    ◦Enter if returning customer (must enter y or n)
    ◦Enter user name (must fill in a name)
    ◦Enter at least 1 product to order
    ◦Enter quantity (must enter 1–99)
    ◦Enter delivery address that includes street, city, state, and zip
    ◦Enter telephone number

    and can someone tell me where I need to enclose the program, within my program?

  8. #8
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Help with project please

    You're not a good communicator, so you should work on that. You've attempted some of those requirements, maybe all of them. Some of your code and the results may be correct, some/all may not. We need to know specifically what you want help with. We won't work with a Christmas wish list of contributions we can make to your project so that it's an aroe2013/JPF group effort.

    I'll give you one hint I see you could use after reading ~20 lines of code: yes/no conditions are usuallly set with boolean "flags."

  9. #9
    Junior Member
    Join Date
    Nov 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help with project please

    I disagree GregBannon, I am actually a great communicator, except when it comes to programming and what people are looking for, specifically. I apologize if you think i'm making a "wish list" I came here for help, with Java programming, which this forum is for. I do not know how to make the cod for the "wish list" above. As I stated above, I know every little about programming, so im struggling with what I need to do.

    Thank you for your hint, I will look at my code and attempt to make the changes.

    btw, what is the JPF you mentioned in your post?

  10. #10
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Help with project please

    I am actually a great communicator
    Then apply those skill to your posts to describe what help you need; make them more like your last one.

    JPF = this forum.

  11. #11
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Help with project please

    Start with the first one:

    ◦Enter if returning customer (must enter y or n)


    What steps does the code need to do for that step?
    For example:
    1) show a message
    2 read the users response
    3) verify the response is correct
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. New Project
    By froggy in forum Paid Java Projects
    Replies: 1
    Last Post: May 2nd, 2013, 10:06 PM
  2. Little help with this project please
    By Darkcore123 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 13th, 2011, 05:08 PM
  3. Help with Project
    By rawrxeroes in forum Object Oriented Programming
    Replies: 1
    Last Post: October 12th, 2011, 07:12 AM
  4. Can anyone help me on my project?
    By alesana514 in forum Paid Java Projects
    Replies: 1
    Last Post: December 16th, 2009, 09:24 AM
  5. Need a project
    By helloworld922 in forum Project Collaboration
    Replies: 6
    Last Post: July 31st, 2009, 08:30 AM