Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

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

Threaded View

  1. #1
    Member
    Join Date
    Jan 2012
    Posts
    65
    My Mood
    Happy
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Question Basic Java Program Help

    Need help with a java program assignment for school. Here is the problem:

    We are all looking forward to retiring someday. Assuming we will retire on our 65th birthday, write a Java program that prompts the user for his/her birthday month, day, and year and then prints out the date the user will retire.

    I am having trouble calculating when the user will turn 65. Here is what I have so far:
    package com.mime.project1;
     
    import java.util.Scanner;
     
    public class Assign2 {
    	public static void main(String[] args) {
    		Scanner stdIn = new Scanner(System.in);
     
    int month, day, year;
     
    System.out.print("Enter the month you were born: ");
    month = stdIn.nextInt();
    System.out.print("Enter the day you were born: ");
    day = stdIn.nextInt();
    System.out.print("Enter the year you were born: ");
    year = stdIn.nextInt();
     
     
    	}
     
    }
    Last edited by helloworld922; January 16th, 2012 at 09:38 PM.


Similar Threads

  1. BASIC program help
    By ryanquanz in forum What's Wrong With My Code?
    Replies: 2
    Last Post: December 15th, 2011, 10:42 AM
  2. Very basic program but its making me crazy
    By craig carl in forum What's Wrong With My Code?
    Replies: 5
    Last Post: February 2nd, 2011, 03:16 PM
  3. Not sure what to do next (Basic java program)
    By desi22601 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: September 21st, 2010, 09:05 AM
  4. Basic program which gets cost, adds tax, gets payment then calculates change.
    By bibboorton in forum What's Wrong With My Code?
    Replies: 6
    Last Post: August 25th, 2010, 10:31 AM
  5. Basic Java Program Help
    By roaster in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 6th, 2009, 10:28 PM