Let's say if user needs to put some input in integer and the output will be in a month.
The first line of input is the number of members in a group. So for each of the following line there are 3 integers that represent a valid date which is the birthdate of each member in the format of dd mm yyyy. If a user insert number in for an example 1 01 2018 so output will become 1 January 2018.
This is my code.
import java.util.*;
import java.text.SimpleDateFormat;
public class LabExercise1b {
public static void main(String[] args) {
Scanner console = new Scanner(System.in);
System.out.print(" "); //number of people
int people = console.nextInt();
int day, year;
String[] month = new String[]{"January", "February", "March", "April", "May", "June", "July", "August",
"September", "October", "November", "December"};
for (int i = 1; i <= people; i++) {
SimpleDateFormat newFormat = new SimpleDateFormat("MM");
System.out.println(" ");
day = console.nextInt();
year = console.nextInt();
}
System.exit(0);
}
}
Btw, i am still new on learning java language. Hopefully someone can teach me or share some knowledge. I am using eclipse IDE.