Part A Write an application called PastPresentFuture that uses the LocalDate class to access the current date. Prompt a user for a month, day, and year. Display a message that specifies whether the entered date is (1) not this year, (2) in an earlier month this year, (3) in a later month this year, or (4) this month. An example of the program is shown below: Enter a month >> 7 Enter a day >> 20 Enter a year (four digits) >> 2021 7 is this month Part B Copy the code from your PastPresentFuture program into PastPresentFuture2. Use the Web to learn how to use the LocalDate Boolean methods isBefore(), isAfter(), and equals(). Use your knowledge to write a program that prompts a user for a month, day, and year, and then displays a message specifying whether the entered day is in the past, the current date, or in the future. Task 01: Create the PastPresentFuture class. Task 02: The program returns the correct response for a date matching the current month. Task 03: The program returns the correct response for a date in the past. Task 04: The program returns the correct response for a date in the future. Task 05: The program returns the correct response for a date not in the current year. Task 06: Create the PastPresentFuture2 class. Task 07: The PastPresentFuture2 program implements isBefore(), isAfter(), or equals().

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

 

Part A

Write an application called PastPresentFuture that uses the LocalDate class to access the current date.

Prompt a user for a month, day, and year. Display a message that specifies whether the entered date is (1) not this year, (2) in an earlier month this year, (3) in a later month this year, or (4) this month.

An example of the program is shown below:

Enter a month >> 7

Enter a day >> 20

Enter a year (four digits) >> 2021

7 is this month

Part B

Copy the code from your PastPresentFuture program into PastPresentFuture2. Use the Web to learn how to use the LocalDate Boolean methods isBefore(), isAfter(), and equals(). Use your knowledge to write a program that prompts a user for a month, day, and year, and then displays a message specifying whether the entered day is in the past, the current date, or in the future.

Task 01: Create the PastPresentFuture class.

Task 02: The program returns the correct response for a date matching the current month.

Task 03: The program returns the correct response for a date in the past.

Task 04: The program returns the correct response for a date in the future.

Task 05: The program returns the correct response for a date not in the current year.

Task 06: Create the PastPresentFuture2 class.

Task 07: The PastPresentFuture2 program implements isBefore(), isAfter(), or equals().

 

♡ Q 2 4 C
G
Unit 5: Making Decis X
CENGAGE COMPANION: COMMANDS
MindTap - Cengage X
Open Companion Tab
Refresh Companion Tab
Bundle Current Workspace
https://literate-sniffle-x5wx9wg5x7w4fr5r.github.dev/?folder=/workspaces/9780357673423_java-programming-10e-5d83f9...
← →
Companion - studer X
J ShadyRestRoom.java X J ShadyRestRoom2.java
J ShadyRestRoom.java > ShadyRestRoom
115
116
117
118
119
120
121 System.out.println("an invalid choice!");
122
123
124
125
126
}
//appropriate message.
room_price = 0;
//set the price of room to and display an
//Close the scanner object.
127 sc.close();
128
129 }
130
131 }
Home | bartleby
student [Codespaces: literate sniffle]
> Codespaces: literate sniffle Ⓒ0A01 Java: Lightweight Mode
Bill eliminating drop X
田
HOME
Welcome
All
Home | Academics X +
☆ {} ()
= Companion X
·1+
How to Use the Code Editor
1. Select the "Run Code" button to execute
program.
2. Select the "Calculate Grade" button to genera
score based on the completed tasks.
3. Continue to modify, run, and calculate your c
until you are happy with the grade.
4. Select the "Submit" button to turn in
assignment to your instructor.
Part A
Write an application called ShadyRestRoom for
bash + I
M
PROBLEMS OUTPUT DEBUG CONSOLE TERMINAL PORTS 1
o@jbowen3225 →.../9780357673423_java-programming-10e-5d83f9ac-c9c6-4288-9e22-37326c529145/chapter5/ex03/student (template) $
B
4
Layout: US
08
x
Q
Transcribed Image Text:♡ Q 2 4 C G Unit 5: Making Decis X CENGAGE COMPANION: COMMANDS MindTap - Cengage X Open Companion Tab Refresh Companion Tab Bundle Current Workspace https://literate-sniffle-x5wx9wg5x7w4fr5r.github.dev/?folder=/workspaces/9780357673423_java-programming-10e-5d83f9... ← → Companion - studer X J ShadyRestRoom.java X J ShadyRestRoom2.java J ShadyRestRoom.java > ShadyRestRoom 115 116 117 118 119 120 121 System.out.println("an invalid choice!"); 122 123 124 125 126 } //appropriate message. room_price = 0; //set the price of room to and display an //Close the scanner object. 127 sc.close(); 128 129 } 130 131 } Home | bartleby student [Codespaces: literate sniffle] > Codespaces: literate sniffle Ⓒ0A01 Java: Lightweight Mode Bill eliminating drop X 田 HOME Welcome All Home | Academics X + ☆ {} () = Companion X ·1+ How to Use the Code Editor 1. Select the "Run Code" button to execute program. 2. Select the "Calculate Grade" button to genera score based on the completed tasks. 3. Continue to modify, run, and calculate your c until you are happy with the grade. 4. Select the "Submit" button to turn in assignment to your instructor. Part A Write an application called ShadyRestRoom for bash + I M PROBLEMS OUTPUT DEBUG CONSOLE TERMINAL PORTS 1 o@jbowen3225 →.../9780357673423_java-programming-10e-5d83f9ac-c9c6-4288-9e22-37326c529145/chapter5/ex03/student (template) $ B 4 Layout: US 08 x Q
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Class
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
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