وهذا حل السؤال الثاني ..
كود:
public static void main(string[] args) {
string name;
scanner sc = new scanner(system.in);
system.out.print("please enter your name: ");
name = sc.nextline();
system.out.print("please enter the year of your birthday: ");
int year = sc.nextint();
year = 2012 - year ;
system.out.print("please enter the month of your birthday: ");
int month = sc.nextint();
month = 11-month;
system.out.print("please enter the day of your birthday: ");
int day = sc.nextint();
day = 2 - day;
system.out.print("\nyour name is "+ name +". Your age is "+ year + " and " + month +" months and " + day+" days.");
}
بالتوفيق واي شي مو مفهوم انا جاهز للتفصيل..
اقصد للشرح