For people into coding *Help*
Can you please tell me what is wrong with this.
import javax.swing.JOptionpane;
class WordGame
{
public static void main(String[] args)
{
String Name;
Name = JOptionpane.showInputdialog ("What is your name.");
String Age;
Age = JOptionpane.showInputdialog ("what is your age.");
String City;
City = JOptionpane.showInputdialog ("Where do you live.");
String College;
College = JOptionpane.showInputdialog ("Where did you attend school.");
String Profession;
Profession = JOptionpane.showInputdialog ("Where do you work.");
String Animal;
Animal = JOptionpane.showInputdialog ("What type of pet do you have.");
String Petname;
Petname = JOptionpane.showInputdialog ("What is your pet name?");
String str="There once was a person named "+ Name +" who lived in "+ City +". At the age of "+ Age +" , "+ Name +" went to college at "+ College +". "+ Name +" graduated and went to work as a "+ Profession +". Then "+ Name +" adopted a(n) "+ Animal +" named "+ Petname +". They both lived happily ever after.";
JOptionpane.showmessageDialog(null, str);
}
}
It didn't come out the way I typed it in notepad, but whenever I try to compile it with Command Prompt, there is an error for every J in JOptionpane in each string, with the error message: Cannot find symbol. This is for my class, and it needs to be submitted by March 6th, so any help would be appreciated.
2 Comments
Recommended Comments
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Join the herd!Sign in
Already have an account? Sign in here.
Sign In Now