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 3 of 3

Thread: Whats wrong with this code????

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Whats wrong with this code????

    HI IM EMILY WESTBERG IM NEW AND NEED HELP ASAP!!!

    Whats wrong with this code????


    import java.util.Scanner;

    public class Part1
    {
    //Peform a program that will print out hte interest and current balance of your checking account
    public static void main(String[] args)
    {

    double balance = 135.00;
    //Amount of balance on month one
    double interest = .03;
    //Interest each month

    //display headers
    System.out.printf("Enter number of months: ");
    Scanner in = new Scanner(System.in);
    int nmonth = in.nextInt();

    // calculate amount on deposit for each of ten months

    for (int month = 1; nmonth <=10; month++ )
    {
    double interest = balance * interest /100;
    balance = balance + interest;
    System.out.printf("%4d %10.2f\n", month, balance);
    }
    }
    }


  2. #2
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 140 Times in 135 Posts

    Default Re: HELP ME NOW PLEASE

    You may wish to first tell us what problems you may be having with it.

  3. #3
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: HELP ME NOW PLEASE

    Hi westberge and welcome to the forum.

    There is a sticky you should read at the top of the forum titled: This Forum is for Saying Hi, not for Asking Technical Questions (READ BEFORE POSTING)

    There is another thread you should read containing other important information including the use of code tags when posting code. It is Announcements - What's Wrong With My Code?. Please read that also, and fix the code in your post.

    Please try to relax with the all caps title, and the NOW stuff. It honestly doesn't matter what you type, the movie is over when it is over, and people check the forum when they get around to it. Such is life. However most people see a title like that and ignore it on purpose.


    Moved from member introductions
    Last edited by jps; October 10th, 2012 at 07:52 PM. Reason: Moved thread

Similar Threads

  1. Can someone see whats wrong with my code, please?
    By DJBENZ10 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: July 11th, 2012, 08:54 PM
  2. Whats wrong with my code?
    By Bryan29 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: October 5th, 2011, 09:12 AM
  3. whats wrong with my code.
    By jove in forum Object Oriented Programming
    Replies: 3
    Last Post: July 30th, 2011, 11:45 PM
  4. Whats wrong with my code!!
    By nitwit3 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: July 22nd, 2011, 11:45 AM
  5. Whats wrong with my code?
    By mlan in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 27th, 2010, 01:42 PM