Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java for PC please Day Of Week Write Dayofweek.java, a program to compute the day of the week (number) on which a specific date

in java for PC please image text in transcribed
Day Of Week Write Dayofweek.java, a program to compute the day of the week (number) on which a specific date falls. Your program should take three command-line arguments: month, day, and year. The number of the month will be given, for example, 1 for January. Use the following formulas, for the Gregorian calendar: yo = y - (14 - m) / 12 x = yo + Lyo/4 - Lyo/100) + L/400 NO = m + 12 (14 - m) / 12 - 2 do = 1d + x + 31 mo/12 mod 7 For example, on what day of the week was August 2, 1953? y = 1953 -0 =1953 X = 1953 + 1953/4 - 1953/100 + 1953/400 - 2426 m = 8 + 12x - 2 = 6 d = (2+2426+ (31x6)/12) mod 7-2443 mod 7 - 0 (Sunday) Example command-line of use: Java DayOfheek 8 2 1953 The example above should produce the following output: 8/2/1953 falls on . Remember that [x/y] means to perform integer division, just like Java normally does. You will need to learn about Integer.parseInt() to convert strings to integers. Problem taken from "Introduction to Programming in Java" by Robert Sedgwick and Kevin Wayne be

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Navigating The Supply Chain Maze A Comprehensive Guide To Optimize Operations And Drive Success

Authors: Michael E Kirshteyn Ph D

1st Edition

B0CPQ2RBYC, 979-8870727585

More Books

Students also viewed these Databases questions

Question

Discuss the Rights issue procedure in detail.

Answered: 1 week ago

Question

Discuss the Rights issue procedure in detail.

Answered: 1 week ago

Question

Explain the procedure for valuation of shares.

Answered: 1 week ago

Question

Which months of this year 5 Mondays ?

Answered: 1 week ago

Question

Define Leap year?

Answered: 1 week ago