A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Java
»
Beginning Java
Author
Please Help! Having problems with class program
Kevin Quarles
Greenhorn
Joined: Sep 07, 2009
Posts: 26
posted
Sep 07, 2009 18:20:35
0
I am having problems with errors. I am using Wordpad and command prompt. I type in javac (my program name).java and I am getting 76 errors.
Here is a sample of the errors:
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Ar
ial;}}
^
PayrollProgram.java:1: illegal character: \92
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Ar
ial;}}
^
PayrollProgram.java:1: illegal character: \92
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Ar
ial;}}
^
PayrollProgram.java:1: illegal character: \92
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Ar
ial;}}
PayrollProgram.java:1: class, interface, or enum expected
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Ar
ial;}}
PayrollProgram.java:3: illegal character: \92
{\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\cf1\f0\fs24 // PayrollP
rogram.java\par
^
PayrollProgram.java:5: illegal character: \92
\par
^
PayrollProgram.java:7: illegal character: \92
\par
^
PayrollProgram.java:8: illegal character: \92
public class PayrollProgram\par
^
PayrollProgram.java:9: illegal character: \92
\{\par
^
PayrollProgram.java:9: illegal character: \92
\{\par
^
PayrollProgram.java:9: ';' expected
\{\par
^
PayrollProgram.java:11: illegal character: \92
\par
Here is my code:
// PayrollProgram.java // By Kevin Quarles import java.util.Scanner; // program uses class Scanner public class PayrollProgram { // main method begins execution of Java application public static void main( String args[] ) { // create Scanner to obtain input from command window Scanner input = new Scanner( System.in ) ; String name ; // employee's name double number1 ; // hourly rate int number2 ; // number of hours worked for the week double product ; // product of number1 and number2 System.out.print( "Enter employee's name:" ) ; // prompt user to input name name = input.nextLine() ; // read employee's name from user's input System.out.print( "Enter hourly rate:" ) ; // prompt user for employee's hourly rate number1 = input.nextDouble() ; // read hourly rate from user's input System.out.print( "Enter hours worked for the week:" ) ; // prompt user to enter number of hours worked for the week number2 = input.nextInt() ; // read number of weeks from user's input product = number1 * number2 ; // multiply numbers System.out.printf( "The Employee" + name ) ; // displays employee's name System.out.printf( "weekly pay is $" + product ) ; // displays weekly pay } // end method main } // end class PayrollProgram
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56528
14
I like...
posted
Sep 07, 2009 18:25:31
0
Please be sure to post a question only once.
[
Smart Questions
] [
JSP FAQ
] [
Books by Bear
] [
Bear's FrontMan
] [
About Bear
]
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Please Help! Having problems with class program
Similar Threads
Error problems
Where do the CLDC class files need to be placed?
Replace unuseless characters in a String
sql file problem
installing java
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter