Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Problem

(a) Write a program that will print the calendar of the current year.

(b) Modify the program so that it will read a year number and print the calendar for that year. A year is a leap year (that is, February has 29 instead of 28 days) if it is a multiple of 4, except that century years (multiples of 100) are leap years only when the year is divisible by 400. Hence the year 1900 is not a leap year, but the year 2000 is a leap year.

(c) Modify the program so that it will accept any date (day, month, year) and print the day of the week for that date.

(d) Modify the program so that it will read two dates and print the number of days from one to the other.

(e) Using the rules on leap years, show that the sequence of calendars repeats exactly every 400 years.

(f) What is the probability (over a 400-year period) that the 13th of a month is a Friday? Why is the 13th of the month more likely to be a Friday than any other day of the week? Write a program to calculate how many Friday the 13ths occur in this century

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92675728

Have any Question?


Related Questions in Computer Engineering

Question suppose you are tasked with designing the security

Question : Suppose you are tasked with designing the security system for a new web browser that supports rendering web pages with embedded web page scripts. What checks would you need to implement to ensure that executin ...

What is the broadcast domain and ports for hubs and

What is the Broadcast Domain and Ports for hubs and bridges?

Use the management studio to create a new database called

Use the Management Studio to create a new database called the default settings(If the database already exists, use the Management Studio to delete it and than create it.

Mary kate is a project manager in the it department for a

Mary Kate is a project manager in the IT department for a university. She has been asked to manage a project to create faculty intranet. The university has multiple campuses in various locations, and professors and other ...

We say that a binary tree t is perfectly balanced if for

We say that a binary tree T is perfectly balanced if, for each node n in T , the number of keys in the left and right subtrees of n differ at most by 1. Write an algorithm called Is-Perfectly-Balanced that, given a binar ...

Question you are in a social situation talking with

Question : You are in a social situation talking with coworkers, friends, or family members who are not familiar with the concept of networking, except for the idea that they turn on their computer and surf the World Wid ...

Assembly programs use 32 bits to address memory and can

Assembly programs use 32 bits to address memory and can access up to 4gb of memory. If an assembly code for a system uses 16 bits to address memory, how many bytes of memory can the program access? Is it as simple as 2^1 ...

Refer to the figure on the previous page now assumed host a

Refer to the figure on the previous page. Now assumed Host A has a file that has been broken down into 2001 packets, of size 20Kb each. How long would it take to transmit the file if each link has a capacity of 10Mbs, pr ...

Suppose we have a collection of n different subsets of the

Suppose we have a collection of n different subsets of the set { 1, 2, ..., n } and they are in some arbitrary order, that is, we have subsets S1, S2, ..., Sn, but how many and which elements are in each of these subsets ...

Suppose that one person in 750 people has a rare genetic

Suppose that one person in 750 people has a rare genetic disease. There is an excellent test for the disease; 99% of people with the disease test positive and only 0.01% who do not have the disease test positive. (a) Wha ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As