Java Programming, Loose-leaf Version
Java Programming, Loose-leaf Version
8th Edition
ISBN: 9781337685917
Author: Joyce Farrell
Publisher: Cengage Learning
Question
Book Icon
Chapter 4, Problem 8PE
Program Plan Intro

Display the months

Program plan:

Filename: “TestMonthHandling.java”

  • Define the “TestMonthHandling” class
  • Define the main method.
    • Create an object for “LocalDate” class and get the 31st January of current year.
    • Create an object for “LocalDate” class and get the 31st December of current year.
    • Iterate “i” value until it reaches 4
      • Display the dates after adding one, two, and three months on both the dates.

Blurred answer
Students have asked these similar questions
Write a java application that handles a student report card. The application shall save the marks of computer science, math and English. Each subject has a total of 50 marks. If a student obtains at least 75/150 marks, an event will trigger and show a congratulation message on passing the exam. Otherwise, it will display an “F” grade.
Write a program that declares two LocalDate objects, jan31 and dec31, and assign values that represent January 31 and December 31 in the current year. Display output that demonstrates the dates displayed when one, two, and three months are added to each of the objects. An example of the program is shown below: First date 2021-01-31 Second date 2021-02-28 Third date 2021-03-31 Fourth date 2021-04-30 First date 2021-12-31 Second date 2022-01-31 Third date 2022-02-28 Fourth date 2022-03-31
Create an application in Java that uses card layout with three cards. The first card - a login card - should have two text fields, one for username and other for password. There are two users - Bob and Fred - whose passwords are "mubby and "goolag" respectively. If Bob logs in, switch to a card - the bob card - that has a text field, a text area and two buttons. If the first button is pressed, get the text from the text field and append it to the text area. If the second button is pressed, return to the login card. If Fred logs in, switch to a card - the fred card - that has three buttons. If the first button is pressed, change the background color to green. If the second  button is pressed, change the background color to red. If the third button is pressed, return to login card.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
    Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781305480537
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT