Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Cannot find symbol variable  RSS feed

 
Yolanda Johnson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I tried to compile my code, I get the error that my symbol variable cannot be found. Here is my code:

import java.util.Scanner;

public class DemoStudent
{

public static void main (String [] args)
{
//creating an instance of the DemoStudent class
std1 = new Student();
//std2 = new Student();
//std3 = new Student();

Scanner in = new Scanner(System.in);

//get first name & last name
System.out.println("Enter your first name.");
First = in.nextLine();
System.out.println("Enter your last name.");
Last = in.nextLine();

//get tuition amount
System.out.println("Enter full tuition amount.");
Tuition = in.nextLine();

std1.setFirst(first);
//std2.setFirst();
//std3.setFirst();
std1.setLast(last);
//std2.setLast();
//std3.setLast();
std1.setTuition(t);
//std2.setTuition();
//std3.setTuition();

printPayment(std1);
//printPayment(student2);
//printPayment(student3);

}

//This method expects to be passed a Student instance
//as an argument

//static void printPayment(Student std1);
{
//double paymt;
//Scanner scan = new Scanner(System.in);
//this method will accept a reference
//to a specific student
//System.out.println(std1.getFullName(std1));
//System.out.println("Current Tuition:" + std1.getTuition());


//accept payment
//System.out.println("Enter payment:");
//paymt = scan.nextDouble();
//std1.payTuition(paymt);
//System.out.println("Current Tuition:" + std1.getTuition());
}


{
//double paymt;
//Scanner scan = new Scanner(System.in);
//this method will accept a reference
//to a specific student
//System.out.println(std2.getFullName());
//System.out.println("Current Tuition:" + std2.getTuition());


//accept payment
//System.out.println("Enter payment:");
//paymt = scan.nextDouble();
//std1.payTuition(paymt);
//System.out.println("Current Tuition:" + std2.getTuition());
}

{
//double paymt;
//Scanner scan = new Scanner(System.in);
//this method will accept a reference
//to a specific student
//System.out.println(std3.getFullName());
//System.out.println("Current Tuition:" + std3.getTuition());


//accept payment
//System.out.println("Enter payment:");
//paymt = scan.nextDouble();
//std1.payTuition(paymt);
//System.out.println("Current Tuition:" + std3.getTuition());
}

}
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yolanda!... Welcome to Javaranch,
This is webservices forum, I am moving your question to Java in General (beginner) forum for better responses.
Have a nice time here.
Balaji
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!