Write a Java program that uses two classes (a Date class and a DateDriver class) to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Java program that uses two classes (a Date class and a DateDriver class) to display a date to the screen. You must write two classes using two separate files for full credit. Requirements Fields: Constructor: One 3-argument constructor Methods: Method: for the Date Class 1. integer to store the month 2. integer to store the day 3. integer to store the year Be sure to use the appropriate access modifier for each field. Purpose: Access: Parameter: Return value: Algorithm: The constructor uses three integer arguments representing the month, day, and year values. Use each argument to call the appropriate setter method. Getter and setter for each field listed above displayDate() Prints the date in the mm/dd/yyyy format public None None Use the fields to display the date to the screen using the format mm/dd/yyyy. Requirements for the DateDriver Class Fields: None Method: main() Algorithm: 1. Instantiate an object of type Date, passing any three integers to the constructor. Use integers that form a valid date. 2. Call the displayDate method of the Date object to display this date to the screen. 3. Prompt the user for three new integer values. Be sure to use prompts that explain what the user needs to do. 4. Call the appropriate setter methods of the Date object, using the three values input by the user. 5. Call the displayDate method of the Date object to display the new date to the screen. Sample Run Date is 8/28/2022 New month: 9 New day: 5 New year: 2022 Date is 9/5/2022 Write a Java program that uses two classes (a Date class and a DateDriver class) to display a date to the screen. You must write two classes using two separate files for full credit. Requirements Fields: Constructor: One 3-argument constructor Methods: Method: for the Date Class 1. integer to store the month 2. integer to store the day 3. integer to store the year Be sure to use the appropriate access modifier for each field. Purpose: Access: Parameter: Return value: Algorithm: The constructor uses three integer arguments representing the month, day, and year values. Use each argument to call the appropriate setter method. Getter and setter for each field listed above displayDate() Prints the date in the mm/dd/yyyy format public None None Use the fields to display the date to the screen using the format mm/dd/yyyy. Requirements for the DateDriver Class Fields: None Method: main() Algorithm: 1. Instantiate an object of type Date, passing any three integers to the constructor. Use integers that form a valid date. 2. Call the displayDate method of the Date object to display this date to the screen. 3. Prompt the user for three new integer values. Be sure to use prompts that explain what the user needs to do. 4. Call the appropriate setter methods of the Date object, using the three values input by the user. 5. Call the displayDate method of the Date object to display the new date to the screen. Sample Run Date is 8/28/2022 New month: 9 New day: 5 New year: 2022 Date is 9/5/2022
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Exercise 7-5 Incremental Analysis (16 points) Problem data follows: Annual number of customers surveyed Cost of survey if conducted by RBG Associates Costs related to the survey in the prior year....
-
You have now been asked to work with a textile startup business that your firm has just taken on as a client. The business is particularly in need of support and guidance with budgeting and how it...
-
Write a Java program that meets the followinga. It has a abstract class that contains a student nameb. Include get() and set() methods for the abstract class where the student number is set/get;c....
-
For each polynomial function, find (a) (-1), (b) (2), and (c) (0). f(x) = x + 5x
-
Pentane is burned with 120% theoretical air in a constant pressure process at 14.7 lbf/in 2. The products are cooled to ambient temperature, 70 F. How much mass of water is condensed per pound-mass...
-
What is it about post-sale follow-up that makes it one of the most important ways to enhance long-term customer relationships? What specific things can you do in follow-up to accomplish this?
-
Another published study of government-sponsored lotteries examined reasons why people purchase lottery tickets (Miyazaki, Langenderfer, \& Sprott, 1999). The researchers approached a number of people...
-
The Village of Delmar is preparing its government- wide statement of activities for the year ended December 31, 2013. Analysis of the data accumulated thus far shows the following expenses for each...
-
Lethe has borrowed $100 000 to purchase a drilling machine and promise to make 5 years of annual repayments at a fixed interest rate of 11.5% p.a. What is the annual repayment?
-
Westley Fong, manager of The Lucky 88 Motel, has a contract with Appraisers Associates to appraise his 150-room motel, which is located in beautiful downtown Wahiawa. The consultant on the job has...
-
I have chosen option two as I was recently been hired as CISO of a large, well-established company. I would approach the issue by assesting the situation, as working for a large company we need to...
-
Equilibrium price is $ _________; equilibrium quantity is _______.
-
You are willing to pay $25 (but not a penny more) for a half-hour massage. At the end of your session, the masseur offers a second half-hour session for $20. After thinking about it for little while,...
-
Practical Application: Lets say that you wanted to go into business for yourself. Your rich uncle offered to invest $100,000 in this business, but he had one provisionthat it must be a monopoly. What...
-
Youre in the desert on an extremely hot day and become quite thirsty. Luckily you come upon a stand where theyre selling bottled water. You would be willing to pay $10 for the fi rst bottle, $5 for...
-
Which statement is true? a) The monopolist and the perfect competitor both produce where MC equals MR. b) Neither the monopolist nor the perfect competitor produce where MC equals MR. c) The...
-
In reversed phase HPLC, there is a Select one: O a. All of the above O b. polar solvent/polar column O c. Polar solvent/ Non polar column O d. Non-polar solvent/polar column
-
Coastal Refining Company operates a refinery with a distillation capacity of 12,000 barrels per day. As a new member of Coastal's management team, you have been given the task of developing a...
-
Please answer the following questions regarding the taxability of Social Security: a. A 68-year-old taxpayer has $20,000 in Social Security income and $100,000 in tax-free municipal bond income. Does...
-
Cypress Corporation has regular taxable income of $170,000 (assume annual gross receipts are greater than $5 million) and regular tax liability of $49,550 for 2012. The corporation also has tax...
-
Olive Corporation was formed and began operations on January 1, 2012. The corporation's income statement for the year and the balance sheet at year-end are presented below. The corporation made...
-
In the second quarter of 2021, personal consumption expenditures, exports, and imports increased. Investment and government expenditure decreased. Real GDP increased by 6.5 percent following a 6.3...
-
When real GDP increased in the second quarter of 2021, consumption expenditure, exports, and imports increased. Fixed investment decreased, which included a decrease in business inventory investment....
-
Are U.S. exports part of U.S. induced expenditure or autonomous expenditure? Are U.S. imports part of U.S. induced expenditure or autonomous expenditure? U.S. imports are recovering thanks to the $2...
Study smarter with the SolutionInn App