• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Cannot find symbol variable

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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());
}

}
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic