Hello, there. I'm a programming student and while I understand the idea of not finding a symbol, I'm still in need of assistance for my following code:
public class FileTicketAsText {
private static String file;
/**
* @param args the command line arguments
*/
public static void Main(String[] args) {
// TODO code application logic here
Scanner scan = new Scanner(System.in);
String name = getName(scan, " Name");
String symbol = getSymbol(scan, " Symbol ");
String title = getTitle(scan, "Title");
String summary = getSummary(scan, " Summary ");
String question = getQuestion(scan, " Question");
String answer = getAnswer(scan, " Answer");
String nameFile = file + "txt";
FileWriter outputStream = null;
String word = null;
try {
outputStream = new FileWriter(nameFile);
BufferedWriter out = new BufferedWriter(outputStream);
out.write(word + "/n");
out.close();
} catch (IOException ex){
Logger.getLogger(Main.class.getName().log(Level.SEVERE,null,ex));
}
}
private static String getName(Scanner scan, String string) {
System.out.print(string + "?");
return scan.nextLine();
}
private static String getSymbol(Scanner scan, String string) {
System.out.print(string + "?");
return scan.nextLine();
}
private static String getSummary(Scanner scan, String string) {
System.out.print(string + "?");
return scan.nextLine();
}
private static String getQuestion(Scanner scan, String string) {
System.out.print(string + "?");
return scan.nextLine();
}
private static String getAnswer(Scanner scan, String string) {
System.out.println(string + "?");
return scan.nextLine();
}
private static String getTitle(Scanner scan, String string) {
System.out.print(string + "?");
return scan.nextLine();
}
}
Specifically, the "Logger.getLogger(Main.class.getName().log(Level.SEVERE,null,ex)); " is giving me trouble, because I cannot find the symbol and such my JDK(NetBeans) is giving me all these imports which I don't understand and don't work. All in all, I am in need for some help
I have this problem with the cannot find symbol. This is my code.
public class KineticEnergy
{
public static void main(String[] args)
{
KeyboardReader input = new KeyboardReader();
System.out.println("Enter the mass of the object");
double mass = input. readDouble();
System.out.println("Enter the volume of the object");
double volume = input. readDouble();
System.out.println("Mass =" + mass);
System.out.println("Volume =" + volume);
double KE = 1.0/2 * mass * volume * volume;
System.out.println("Kenetic Energy =" + KE);
}
}
Then when i try to compile it says that cannot find symbol in KeyboardReader.Please help
import java.io.*;
public class FisherPriceToys
{
String ToyName,Colour;
double Cost;
int YearOfManufacture;
FisherPriceToys(String a,String b,double c,int d)
{
ToyName=a;
Colour=b;
Cost=c;
YearOfManufacture=d;
}
public static void main()throws IOException
{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the toy's name of 20 characters");
String x=in.readLine();
int y=x.length();
for(;y==20;)
{
System.out.println("Invalid choice.Enter the toy's name of 20 characters");
String z=in.readLine();
y=z.length();
}
System.out.println("Enter the toy's colour of 15 characters");
String m=in.readLine();
int n=m.length();
for(;n==15;)
{
System.out.println("Invalid choice.Enter the toy's colour of 15 characters");
String p=in.readLine();
n=p.length();
}
System.out.println("Enter the toy's cost");
String cost=in.readLine();
double cos=Double.parseDouble(cost);
System.out.println("Enter the Year of manufacture");
String year=in.readLine();
int ye=Integer.parseInt(year);
int k=ye,g=0;
do
{
k=k/10;
g++;
}
while(k!=0);
for(;g==4;)
{
System.out.println("Invalid choice.Enter the valid year");
String yer=in.readLine();
int years=Integer.parseInt(yer);
k=years;
do
{
k=k/10;
g++;
}
while(k!=0);
}
FisherPriceToys ob=new FisherPriceToys(z,p,cos,years);
System.out.println("Toy's name is "+ob.ToyName);
System.out.println("Toy's colour is "+ob.Colour);
System.out.println("Toy's cost is "+ob.Cost);
System.out.println("Toy's year of manufacture is "+ob.YearOfManufacture);
}
}
/**while compling this program error is reported on constructor calling.Please send the solution to my email.
import java.io.*;
public class FisherPriceToys
{
String ToyName,Colour;
double Cost;
int YearOfManufacture;
FisherPriceToys(String a,String b,double c,int d)
{
ToyName=a;
Colour=b;
Cost=c;
YearOfManufacture=d;
}
public static void main()throws IOException
{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the toy's name of 20 characters");
String x=in.readLine();
int y=x.length();
for(;y==20;)
{
System.out.println("Invalid choice.Enter the toy's name of 20 characters");
String z=in.readLine();
y=z.length();
}
System.out.println("Enter the toy's colour of 15 characters");
String m=in.readLine();
int n=m.length();
for(;n==15;)
{
System.out.println("Invalid choice.Enter the toy's colour of 15 characters");
String p=in.readLine();
n=p.length();
}
System.out.println("Enter the toy's cost");
String cost=in.readLine();
double cos=Double.parseDouble(cost);
System.out.println("Enter the Year of manufacture");
String year=in.readLine();
int ye=Integer.parseInt(year);
int k=ye,g=0;
do
{
k=k/10;
g++;
}
while(k!=0);
for(;g==4;)
{
System.out.println("Invalid choice.Enter the valid year");
String yer=in.readLine();
int years=Integer.parseInt(yer);
k=years;
do
{
k=k/10;
g++;
}
while(k!=0);
}
FisherPriceToys ob=new FisherPriceToys(z,p,cos,years);
System.out.println("Toy's name is "+ob.ToyName);
System.out.println("Toy's colour is "+ob.Colour);
System.out.println("Toy's cost is "+ob.Cost);
System.out.println("Toy's year of manufacture is "+ob.YearOfManufacture);
}
}
/**error is reported every time i compile this program on calling the constructor.please send the solution to my email provided.
tutorialsadegh July 1, 2011 at 9:28 AM
iam a begginer.please help me .i want to do make a simple calculature in j2me.thanks.
java errorssandhya rani nayak October 20, 2011 at 7:15 PM
need explanation on seberal java errors
java errorssumit November 1, 2011 at 12:17 AM
i have written every thing correctly but can not run a.start()..............please help
+Alexey January 21, 2012 at 12:09 AM
3. When programmer didn't declare variable (didn't put "Int, String, Float, etc.")
Still confused about missing symbolNeil May 27, 2012 at 5:41 PM
Hello, there. I'm a programming student and while I understand the idea of not finding a symbol, I'm still in need of assistance for my following code: public class FileTicketAsText { private static String file; /** * @param args the command line arguments */ public static void Main(String[] args) { // TODO code application logic here Scanner scan = new Scanner(System.in); String name = getName(scan, " Name"); String symbol = getSymbol(scan, " Symbol "); String title = getTitle(scan, "Title"); String summary = getSummary(scan, " Summary "); String question = getQuestion(scan, " Question"); String answer = getAnswer(scan, " Answer"); String nameFile = file + "txt"; FileWriter outputStream = null; String word = null; try { outputStream = new FileWriter(nameFile); BufferedWriter out = new BufferedWriter(outputStream); out.write(word + "/n"); out.close(); } catch (IOException ex){ Logger.getLogger(Main.class.getName().log(Level.SEVERE,null,ex)); } } private static String getName(Scanner scan, String string) { System.out.print(string + "?"); return scan.nextLine(); } private static String getSymbol(Scanner scan, String string) { System.out.print(string + "?"); return scan.nextLine(); } private static String getSummary(Scanner scan, String string) { System.out.print(string + "?"); return scan.nextLine(); } private static String getQuestion(Scanner scan, String string) { System.out.print(string + "?"); return scan.nextLine(); } private static String getAnswer(Scanner scan, String string) { System.out.println(string + "?"); return scan.nextLine(); } private static String getTitle(Scanner scan, String string) { System.out.print(string + "?"); return scan.nextLine(); } } Specifically, the "Logger.getLogger(Main.class.getName().log(Level.SEVERE,null,ex)); " is giving me trouble, because I cannot find the symbol and such my JDK(NetBeans) is giving me all these imports which I don't understand and don't work. All in all, I am in need for some help
cannot find symbolLeo September 2, 2012 at 11:32 AM
I have this problem with the cannot find symbol. This is my code. public class KineticEnergy { public static void main(String[] args) { KeyboardReader input = new KeyboardReader(); System.out.println("Enter the mass of the object"); double mass = input. readDouble(); System.out.println("Enter the volume of the object"); double volume = input. readDouble(); System.out.println("Mass =" + mass); System.out.println("Volume =" + volume); double KE = 1.0/2 * mass * volume * volume; System.out.println("Kenetic Energy =" + KE); } } Then when i try to compile it says that cannot find symbol in KeyboardReader.Please help
cannot find symbol errorAbinaya October 10, 2012 at 5:26 PM
import java.io.*; public class FisherPriceToys { String ToyName,Colour; double Cost; int YearOfManufacture; FisherPriceToys(String a,String b,double c,int d) { ToyName=a; Colour=b; Cost=c; YearOfManufacture=d; } public static void main()throws IOException { BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter the toy's name of 20 characters"); String x=in.readLine(); int y=x.length(); for(;y==20;) { System.out.println("Invalid choice.Enter the toy's name of 20 characters"); String z=in.readLine(); y=z.length(); } System.out.println("Enter the toy's colour of 15 characters"); String m=in.readLine(); int n=m.length(); for(;n==15;) { System.out.println("Invalid choice.Enter the toy's colour of 15 characters"); String p=in.readLine(); n=p.length(); } System.out.println("Enter the toy's cost"); String cost=in.readLine(); double cos=Double.parseDouble(cost); System.out.println("Enter the Year of manufacture"); String year=in.readLine(); int ye=Integer.parseInt(year); int k=ye,g=0; do { k=k/10; g++; } while(k!=0); for(;g==4;) { System.out.println("Invalid choice.Enter the valid year"); String yer=in.readLine(); int years=Integer.parseInt(yer); k=years; do { k=k/10; g++; } while(k!=0); } FisherPriceToys ob=new FisherPriceToys(z,p,cos,years); System.out.println("Toy's name is "+ob.ToyName); System.out.println("Toy's colour is "+ob.Colour); System.out.println("Toy's cost is "+ob.Cost); System.out.println("Toy's year of manufacture is "+ob.YearOfManufacture); } } /**while compling this program error is reported on constructor calling.Please send the solution to my email.
error cannot find symbolAbinaya October 10, 2012 at 5:33 PM
import java.io.*; public class FisherPriceToys { String ToyName,Colour; double Cost; int YearOfManufacture; FisherPriceToys(String a,String b,double c,int d) { ToyName=a; Colour=b; Cost=c; YearOfManufacture=d; } public static void main()throws IOException { BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter the toy's name of 20 characters"); String x=in.readLine(); int y=x.length(); for(;y==20;) { System.out.println("Invalid choice.Enter the toy's name of 20 characters"); String z=in.readLine(); y=z.length(); } System.out.println("Enter the toy's colour of 15 characters"); String m=in.readLine(); int n=m.length(); for(;n==15;) { System.out.println("Invalid choice.Enter the toy's colour of 15 characters"); String p=in.readLine(); n=p.length(); } System.out.println("Enter the toy's cost"); String cost=in.readLine(); double cos=Double.parseDouble(cost); System.out.println("Enter the Year of manufacture"); String year=in.readLine(); int ye=Integer.parseInt(year); int k=ye,g=0; do { k=k/10; g++; } while(k!=0); for(;g==4;) { System.out.println("Invalid choice.Enter the valid year"); String yer=in.readLine(); int years=Integer.parseInt(yer); k=years; do { k=k/10; g++; } while(k!=0); } FisherPriceToys ob=new FisherPriceToys(z,p,cos,years); System.out.println("Toy's name is "+ob.ToyName); System.out.println("Toy's colour is "+ob.Colour); System.out.println("Toy's cost is "+ob.Cost); System.out.println("Toy's year of manufacture is "+ob.YearOfManufacture); } } /**error is reported every time i compile this program on calling the constructor.please send the solution to my email provided.
j2eeln mahapatra January 7, 2013 at 3:42 PM
find cant find symbol error while executing a servlet program after import package for classes
Post your Comment