Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: help a first time java programer

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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 :
    //* 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.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,069
    Thanks
    47
    Thanked 2,146 Times in 2,119 Posts

    Default Re: help a first time java programer

    . i am comeing across an error
    Please copy the full text of the error messages and post it here.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Feb 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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);
    ^

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,069
    Thanks
    47
    Thanked 2,146 Times in 2,119 Posts

    Default 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/
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Feb 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: help a first time java programer

    does the c in class have to be capitilized to?

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,069
    Thanks
    47
    Thanked 2,146 Times in 2,119 Posts

    Default 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
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Junior Member
    Join Date
    Feb 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: help a first time java programer

    thanks, now just have to figure out the class interface or enum expected faults

Similar Threads

  1. Hello, first time caller long time programmer....
    By P2C2N in forum Member Introductions
    Replies: 3
    Last Post: December 10th, 2012, 10:53 AM
  2. Replies: 1
    Last Post: November 1st, 2012, 07:54 AM
  3. java run time problem?
    By kcs403 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: July 15th, 2011, 09:06 AM
  4. [SOLVED] Java run time error: 'java.lang.NullPointerException"
    By ChandanSharma in forum What's Wrong With My Code?
    Replies: 9
    Last Post: June 20th, 2011, 11:53 AM
  5. Java Programming Help - thanks ahead of time
    By javanerd in forum What's Wrong With My Code?
    Replies: 5
    Last Post: September 28th, 2010, 04:14 PM