Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are given two values, c and n. c is the current day of the week - 0 is Sunday, 1 is Monday, 2 is

You are given two values, c and n. c is the current day of the week - 0 is Sunday, 1 is Monday, 2 is Tuesday, etc. n is the number of days that have elapsed since day c. Print out what day that will be.

Input Format

both c and n will be integers

Constraints

0 <= c <= 6 -2 billion <= n <= 2 billion

Output Format

Output the full name of the day of the week.

Sample Input 0

3 2 

Sample Output 0

Friday 

Explanation 0

Day 3 is Wednesday. 2 days after Wednesday is Friday

Sample Input 1

4 -1 

Sample Output 1

Wednesday 

Explanation 1

Day 4 is Thursday. 1 day before Thursday (previous day) is Wednesday. A negative value for n indicates we are looking for previous days.

Screenshot of the output

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_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

Based on Normal People persona.

Answered: 1 week ago

Question

differentiate the function ( x + 1 ) / ( x ^ 3 + x - 6 )

Answered: 1 week ago

Question

How should a consultant be selected?

Answered: 1 week ago

Question

Why is a consulting contract needed?

Answered: 1 week ago