help a first time java programer
hi everyone, i'm chris and i'm just starting out with java. through my java course i am trying to create a java program that computes a series as follows: 1/2 +2/3+ ... i/i+1 up to where i = 20. it also has to display the grand total with each addition, i.e. count 1 and total = .5, count 2 = 1.1667, etc. i am comeing across an error while trying to compile it stateing that the problem is with the system is in the line system.out.println("the total at "+ count + "is" + m);, pointing at the dor between system and out. the code is as follows :
Code :
//* problem 5.4 page 212*//
//* christopher bruce *//
public class problem5_4 {
public static void main (double[] args) {
int count = 1;
double m = 0;
do {
m = m+count/(count + 1);
system.out.println("the total at "+ count + "is" + m);
count = count ++;
} while (count <21);
}
}
any help is appreciated.
Re: help a first time java programer
Quote:
. i am comeing across an error
Please copy the full text of the error messages and post it here.
Re: help a first time java programer
problem5.4.java:11: error: package system does not exist
system.out.println("the total at " + count + "is" + m);
^
Re: help a first time java programer
Java is case sensitive. You must spell everything with the correct case. System starts with S not s
When in doubt read the API doc:
http://docs.oracle.com/javase/7/docs/api/
Re: help a first time java programer
does the c in class have to be capitilized to?
Re: help a first time java programer
Depends which word you are talking about. The keyword is lowercase (I think most keywords start with lowercase)
There is a class named Class which starts with uppercase as all class names do.
Your class name: problem5_4 should be Problem5_4
Re: help a first time java programer
thanks, now just have to figure out the class interface or enum expected faults