Results 1 to 11 of 11
  1. #1
    tonyfingures is offline Member
    Join Date
    Sep 2010
    Location
    USA
    Posts
    4
    Rep Power
    0

    Default Birthday Party Code

    I'm having a party in a few weeks.I want to charge $6 for every person and $10 per couple. I have already sold invitations for people to RSVP and i don't know how many will show up. I need a java program that will allow me to enter these numbers once i get the RSVP's and also output a total dollar amount so i know how much i can spend on drinks and decorations.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by tonyfingures View Post
    I'm having a party in a few weeks.I want to charge $6 for every person and $10 per couple. I have already sold invitations for people to RSVP and i don't know how many will show up. I need a java program that will allow me to enter these numbers once i get the RSVP's and also output a total dollar amount so i know how much i can spend on drinks and decorations.
    And I think I speak for all in welcoming you to the Java-Forums and wishing you much success in creating such a program. Please feel free to come on back if you have any problems with creating this app, but don't forget to show us your code and ask as specific a question as possible since doing this greatly increases your chances of getting decent help.

    Much luck and again, welcome!

  3. #3
    berkeleybross's Avatar
    berkeleybross is offline Senior Member
    Join Date
    Feb 2010
    Location
    England
    Posts
    187
    Rep Power
    5

    Default

    Its admirable you want to make a program to do such a job, but wouldnt a spreadsheet be easier to use, and quicker to set up?

    Or is this just a training exercise to see if you can do it?

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by berkeleybross View Post
    Its admirable you want to make a program to do such a job, but wouldnt a spreadsheet be easier to use, and quicker to set up?

    Or is this just a training exercise to see if you can do it?
    It's obviously a legitimate question, I'm sure. There's no way that the original poster would post a homework assignment in such a way, just to try to fool us dolts into doing his work for him, right? No one could be that foolish, could they? Or maybe I'm just being naÔve. ;)

  5. #5
    tonyfingures is offline Member
    Join Date
    Sep 2010
    Location
    USA
    Posts
    4
    Rep Power
    0

    Default

    Below is the code that i was hoping would work. I am more into hardware and not coding but i'm trying to understand all this. Your input will be appreciated as long as its positive. I have done this using VB.NET and it works. I know theirs a simpler way to do it using other apps but i want to see it in JAVA.

    import javax.swing.JOptionane;

    //Author: Tony Fingers
    //Purpose: Inputs the number of couples, singles who have RSVP'd and then calculates the total cost of decorations

    public class Decorationcost
    {
    public static void main(String[]args)
    {
    int dom, number1, number2;


    dom=0;
    number1 = 0;
    number2 = 0;

    dom = Integer .parseInt(JOptionPane.showInputDialog("Enter the guests (1-100) who have RSVP'd."));

    number1 = dom * 6;
    number2 = dom * 10;

    JOptionPane.ShowMessageDialog(null, "Single people who have RSVP'd is: "* number1 * "!");
    JOptionPane.ShowMessageDialog(null, "Couples who have RSVP'd is: " * number2 * "!");

    } //Closes class.

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default

    Are there problems or errors?
    Please copy and paste the full text of the error messages here.
    Or explain what the problem is.

  7. #7
    tonyfingures is offline Member
    Join Date
    Sep 2010
    Location
    USA
    Posts
    4
    Rep Power
    0

    Default

    Well its in CMD promt but its saying that it couldn't find main class

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default

    Please copy the full contents of the command prompt showing the command you entered and the response to that error.
    To copy the contents of the command prompt window:
    Click on Icon in upper left corner
    Select Edit
    Select 'Select All' - The selection will show
    Click in upper left again
    Select Edit and click 'Copy'

    Paste here.

  9. #9
    tonyfingures is offline Member
    Join Date
    Sep 2010
    Location
    USA
    Posts
    4
    Rep Power
    0

    Default

    this is the error.

    Exception in thread "main" java.lang.NoClassDefFoundError: Decorationcost
    Caused by: java.lang.ClassNotFoundException: Decorationcost
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
    Could not find the main class: Decorationcost. Program will exit.
    Press any key to continue . . .

  10. #10
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default

    You left off part of it:
    full contents of the command prompt showing the command you entered

    Is there a file named: Decorationcost.class in the folder where you issued the java command?
    Did you compile the Decorationcost.java file using the javac command?

  11. #11
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Adding third party package in web service
    By abhijit in forum New To Java
    Replies: 0
    Last Post: 12-03-2009, 11:15 AM
  2. Third party packages
    By logicbug in forum New To Java
    Replies: 0
    Last Post: 03-23-2009, 03:05 PM
  3. How to stop/pause running third party exe?
    By 2bGeek in forum AWT / Swing
    Replies: 3
    Last Post: 02-28-2009, 07:26 AM
  4. JSP Unable to access the third party libraries
    By VJSFDeveloper in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 09-08-2008, 04:57 PM
  5. Need to hook up my jsp code to third party vendor
    By priya123 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 08-28-2008, 10:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •