sean foley
Posts: 3
Nickname: foleysf
Registered: Nov, 2002
|
|
Re: Arithmetic java operators
|
Posted: Nov 14, 2002 1:28 PM
|
|
//set2_11 /*this program reads in a variables representing todays date and reads in a variables to repersent a persons age and uses the else if statement*/
public class set2_11 { public static void main(String args[]) { int todaysYear,birthYear,todaysMonth,birthMonth,todaysDay,birthDay; System.out.print("please enter todays calender day:"); todaysDay=UserInput.getInt(); System.out.print("\nplease enter the month of year it is:"); todaysMonth=UserInput.getInt(); System.out.print("\nPlease enter the year it is:"); todaysYear=UserInput.getInt(); System.out.print("\n\nplease enter the calender day you were born:"); birthDay=UserInput.getInt(); System.out.print("\n\nPlease enter the month you were born:"); birthMonth=UserInput.getInt(); System.out.print("\n\nPlease enter the year you were born:"); birthYear=UserInput.getInt(); if(todaysYear > birthYear){ age = todaysYear - birthYear; System.out.println("the age of the person is:" + (age)); } } } thanks for that reply ray , I can't seem to get it to compile without errors this stuff is new to me if you could intrepret the code into this program it would be great. regards sf.
|
|