Answered step by step
Verified Expert Solution
Question
1 Approved Answer
GregorianCalendar cal = new GregorianCalendar(); //Today's date GrogiranCalendar eckertsBirthday = new GregorianCalendar(1919, Calendar.APRIL, 9); Use the values Calendar. JANURARY . . . Calendar DECEMBER to
GregorianCalendar cal = new GregorianCalendar(); //Today's date
GrogiranCalendar eckertsBirthday = new GregorianCalendar(1919, Calendar.APRIL, 9);
Use the values Calendar. JANURARY . . . Calendar DECEMBER to specify the month.
The add methrod can be used to add a bumver of days to a GregorianCalendar object;
cal.add(Calendar.DAY_OF_MONTH, 10); // Now cal is ten days from today
This is a mutator method- it changes
The Gregor i anCalendar class describes a polni ir Line, as measured by Lhe Gregorian calendr Lhe standard calendar that is commonly used throughout the world today. Yau construct a GregcrianCalendar object from a year, month, and day of the month, like this: P2.8 GregorianCalendar calnen GregorianCalendarToday's date GragorianCalendar eckertssirthday new GregorianCalendar(1919 Calendar,APRIL 9) Use the values CalendANUARY. . Calenda .DECEMBER tn specify the month The add method can be used to add a rumber of days to a GregorianCalendar object: cal.accalendar.DAY OF_MONTH, 10); Now cal is len days fm today This is a mutator method-it changes the cal objcet. The get method can be used to query a given GregorianCa1endar object int dayOfMonth cal.get(Calendar.DAY OF_MONTH); int month cal.get(Calendar.NONTH) inr ypar ra1. ger(Calendar YFAR); int weekday - cal get(Calendar.DY OF_WEEK) // l is Sunday, 2 sMulky. . ..71s Salusly Your task is to write a program that prints: The date and weekday that is 100 days from today - The wcckday of vour birth 213 Use the birthday of a computer scientist if you don't want to reveal your own. 215/2019 Hini: Tx Gregori anual dar n aafia al ra rANTo wrie a few test programs to expire the API before tacklirg he whole problem Start with a program that constructs coday's date, ads ten days, and prinis oat the day of the month and the weekday ancalendar The Gregor i anCalendar class describes a polni ir Line, as measured by Lhe Gregorian calendr Lhe standard calendar that is commonly used throughout the world today. Yau construct a GregcrianCalendar object from a year, month, and day of the month, like this: P2.8 GregorianCalendar calnen GregorianCalendarToday's date GragorianCalendar eckertssirthday new GregorianCalendar(1919 Calendar,APRIL 9) Use the values CalendANUARY. . Calenda .DECEMBER tn specify the month The add method can be used to add a rumber of days to a GregorianCalendar object: cal.accalendar.DAY OF_MONTH, 10); Now cal is len days fm today This is a mutator method-it changes the cal objcet. The get method can be used to query a given GregorianCa1endar object int dayOfMonth cal.get(Calendar.DAY OF_MONTH); int month cal.get(Calendar.NONTH) inr ypar ra1. ger(Calendar YFAR); int weekday - cal get(Calendar.DY OF_WEEK) // l is Sunday, 2 sMulky. . ..71s Salusly Your task is to write a program that prints: The date and weekday that is 100 days from today - The wcckday of vour birth 213 Use the birthday of a computer scientist if you don't want to reveal your own. 215/2019 Hini: Tx Gregori anual dar n aafia al ra rANTo wrie a few test programs to expire the API before tacklirg he whole problem Start with a program that constructs coday's date, ads ten days, and prinis oat the day of the month and the weekday ancalendarStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started