Please send me answer within 10 min!! I will rate you good for sure!! Please provide explanation and provide screenshot of your output!! **Please use this code (JAVA) to help create a calendar that will display in the console**   /**  * Example to show the manipulation of Date and Time information through   * Java 8.0 API.   */     import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.Scanner;   public class DateTimeExample {         public static void main(String [] args)         {                 LocalDate cal = LocalDate.now(); // capture today                 Scanner sc = new Scanner(System.in);                 System.out.print("Today: ");                   printCalendar(cal);                   while (sc.hasNextLine())                 {                         String input = sc.nextLine();                         if (input.equals("p"))                         {                                 cal = cal.minusMonths(1); // LocalDateTime is immutable                                 printCalendar(cal);                         }                         else if (input.equals("n"))                         {                                 cal = cal.plusMonths(1); // LocalDateTime is immutable                                 printCalendar(cal);                                                          }                 }                 System.out.println("Bye!");         }         public static void printCalendar(LocalDate c)         {               System.out.print(c.getDayOfWeek());             System.out.print(" ");             System.out.print(c.getDayOfMonth());             System.out.print(" ");             System.out.println(c.getMonth());                             // To print a calendar in a specified format.              DateTimeFormatter formatter = DateTimeFormatter.ofPattern("E, MMM d yyyy");             System.out.println(" " + formatter.format(c));               // To figure out the day of week of the 1st day of the given month             LocalDate x = LocalDate.of(c.getYear(), c.getMonth(), 1);              System.out.println(x.getDayOfWeek() + " is the day of " + c.getMonth() + " 1."); // enum value as it is             System.out.println(x.getDayOfWeek().getValue() + " is an integer value corresponding "               + " to " + x.getDayOfWeek()); // int value corresponding to the enum value                      }                             }         **This photo is an example. I want the console to look like this. But I also want the code to be able to tell the current date when the program is ran**

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Please send me answer within 10 min!! I will rate you good for sure!! Please provide explanation and provide screenshot of your output!!

**Please use this code (JAVA) to help create a calendar that will display in the console**

 

/**

 * Example to show the manipulation of Date and Time information through 

 * Java 8.0 API. 

 */

 

 

import java.time.LocalDate;

import java.time.format.DateTimeFormatter;

import java.util.Scanner;

 

public class DateTimeExample

{

        public static void main(String [] args)

        {

                LocalDate cal = LocalDate.now(); // capture today

                Scanner sc = new Scanner(System.in);

                System.out.print("Today: ");

 

                printCalendar(cal);

 

                while (sc.hasNextLine())

                {

                        String input = sc.nextLine();

                        if (input.equals("p"))

                        {

                                cal = cal.minusMonths(1); // LocalDateTime is immutable

                                printCalendar(cal);

                        }

                        else if (input.equals("n"))

                        {

                                cal = cal.plusMonths(1); // LocalDateTime is immutable

                                printCalendar(cal);

                                

                        }

                }

                System.out.println("Bye!");

        }

        public static void printCalendar(LocalDate c)

        {  

            System.out.print(c.getDayOfWeek());

            System.out.print(" ");

            System.out.print(c.getDayOfMonth());

            System.out.print(" ");

            System.out.println(c.getMonth());

             

 

            // To print a calendar in a specified format. 

            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("E, MMM d yyyy");

            System.out.println(" " + formatter.format(c));

 

            // To figure out the day of week of the 1st day of the given month

            LocalDate x = LocalDate.of(c.getYear(), c.getMonth(), 1); 

            System.out.println(x.getDayOfWeek() + " is the day of " + c.getMonth() + " 1."); // enum value as it is

            System.out.println(x.getDayOfWeek().getValue() + " is an integer value corresponding "

              + " to " + x.getDayOfWeek()); // int value corresponding to the enum value

            

        }

        

        

 

        }

       

**This photo is an example. I want the console to look like this. But I also want the code to be able to tell the current date when the program is ran**

August 2022
1
Su Mo Tu We Th Fr Sa
[2] 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28
<--
It is ok if this line is sticking out.
Transcribed Image Text:August 2022 1 Su Mo Tu We Th Fr Sa [2] 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 <-- It is ok if this line is sticking out.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Top down approach design
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education