Advanced Java questions -3

Where 1999 is the year and 5 is the numeric sequence of the month (corresponding to June). The program should display the day on which June 28, 1999 fell, and in this case the output will be MONDAY.

The output should be displayed in uppercase letters.

Suppose the following INPUT sequence is given to the program:


Then the output should be:



import java.text.DateFormatSymbols;
import java.util.Calendar;
import java.util.Scanner;

public class Solution {

  * @param args
 public static void main(String[] args) {
  boolean condition = false;
  do {
   Scanner scanner = new Scanner(;
   String value = scanner.nextLine();
   condition = value.equalsIgnoreCase("exit");
   if(!condition && value.contains("-")){
   System.out.println("Count is: " + condition);
  } while (!condition);


 private static void calculate(String value) {
  final String[] input = value.split("-");
  Calendar cl = Calendar.getInstance();
  cl.set(Integer.parseInt(input[0]), Integer.parseInt(input[1]), 28);
  String[] weekdays = new DateFormatSymbols().getWeekdays();


Post a Comment

Popular posts from this blog

Secure Spring Boot REST API using Basic Authentication

Integrating Swagger with Spring Boot REST API

Building a RESTFul Service using Spring Boot