Results 1 to 11 of 11
Thread: Birthday Party Code
- 09-15-2010, 11:10 PM #1
Member
- Join Date
- Sep 2010
- Location
- USA
- Posts
- 4
- Rep Power
- 0
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.
-
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!
- 09-15-2010, 11:35 PM #3
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. ;)
- 09-16-2010, 01:05 AM #5
Member
- Join Date
- Sep 2010
- Location
- USA
- Posts
- 4
- Rep Power
- 0
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.
- 09-16-2010, 01:22 AM #6
Are there problems or errors?
Please copy and paste the full text of the error messages here.
Or explain what the problem is.
- 09-16-2010, 01:26 AM #7
Member
- Join Date
- Sep 2010
- Location
- USA
- Posts
- 4
- Rep Power
- 0
Well its in CMD promt but its saying that it couldn't find main class
- 09-16-2010, 01:31 AM #8
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.
- 09-16-2010, 02:12 AM #9
Member
- Join Date
- Sep 2010
- Location
- USA
- Posts
- 4
- Rep Power
- 0
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 . . .
- 09-16-2010, 02:30 AM #10
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?
-
Similar Threads
-
Adding third party package in web service
By abhijit in forum New To JavaReplies: 0Last Post: 12-03-2009, 11:15 AM -
Third party packages
By logicbug in forum New To JavaReplies: 0Last Post: 03-23-2009, 03:05 PM -
How to stop/pause running third party exe?
By 2bGeek in forum AWT / SwingReplies: 3Last Post: 02-28-2009, 07:26 AM -
JSP Unable to access the third party libraries
By VJSFDeveloper in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 09-08-2008, 04:57 PM -
Need to hook up my jsp code to third party vendor
By priya123 in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 08-28-2008, 10:24 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks