Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

cannot be resolved to a type

807600Aug 26 2007 — edited Aug 26 2007
hello all. I'm using eclipse and very green to programming.
typing simple program from book and using a program called TextReader from the author to do a little more understanding.

I'm getting this error message:

Exception in thread "main" java.lang.Error: Unresolved compilation problems:
TextReader cannot be resolved to a type
TextReader cannot be resolved to a type

at TestCourseGrade.main(TestCourseGrade.java:15)


here is the code i typed.

import Textreader;
public class TestCourseGrade
{
public static void main (String[] args)
{
double test1 = 0.0;
double test2 = 0.0;
double finalExam = 0.0;
double courseGrade = 0.0;

System.out.println("This program computes a course grade whe");
System.out.println("you have entered three requested values");
System.out.println();

TextReader keyboard = new TextReader();
System.out.print("Enter first test:");
test1 = keyboard.readDouble();

System.out.print("Enter second test:");
test2 = keyboard.readDouble();
System.out.print("Enter final test:");
finalExam = keyboard.readDouble();

courseGrade = (0.25 * test1)
+ (0.25 * test2)
+ (0.50 * finalExam);
System.out.println("Course Grade: " + courseGrade + "%");
}
}

Suggestions?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 23 2007
Added on Aug 26 2007
3 comments
657 views