If you could help me that would be great!!
Thanks
import java.util.Scanner;
public class Numerology
{
public static void main ( String args[] )
{
int date;
int month;
int day;
int year;
int future;
char slash;
char slashx;
Scanner input = new Scanner ( System.in );
System.out.print ("Enter the birth date (mm/dd/yyyy) : ");
month = input.nextInt();
slash = input.next().charAt(0);
day = input.nextInt();
slashx = input.next().charAt(0);
year = input.nextInt();
date = month + day + year;
if (date >= 10)
{
// I need help here, lets say the date adds up to 23, I need to write a code to add 2 + 3
// the result would be 5 and then set future equal to that to outprint the future for case 5
}
future = date;
switch (future)
{
case 1:
System.out.println (":1: The lesson is in the struggle, not in the victory. Life may be difficult now, but you will gain much within a short period of time!");
break;
case 2:
System.out.println (":2: Your everlasting patience will be rewarded sooner or later");
break;
case 3:
System.out.println (":3: Pray for what you want, but work for the things you need.");
break;
case 4:
System.out.println (":4: You will inherit some money or a small piece of land");
break;
case 5:
System.out.println (":5: You will spend old age in comfort and material wealth");
break;
case 6:
System.out.println (":6: You can't always get what you want, but if you try sometimes you might find you get what you need.");
break;
case 7:
System.out.println (":7: If you eat your vegetables you'll grow up big and strong like Popeye");
break;
case 8:
System.out.println (":8: Every exit is an entrance to new experiences.");
break;
case 9:
System.out.println (":9: Embrace joy and slap evil. Avoid violence.");
break;
}
}
}

New Topic/Question
Reply



MultiQuote






|