Write a program that will accept two days of the same year

Assignment Help Computer Engineering
Reference no: EM132084667

One of the most frustrating aspects of using the Gregorian calendar is that it is difficult to communicate compute elapsed time.

For example, if I tell you that something is experiencing its 2-month anniversary, you don't know the exact number of days that have elapsed unless I tell you which 2 months February 3rd to April 3rd is 59 days (in a non-leap year), while April 3rd to June 3rd is 61 days.

For this problem, you need to write a program that will accept two days of the same year in month-day form) and output the elapsed time between the two days (not including the last day!).

To keep it simple, the program should first ask the user for the month of the first day, then the date of the first day, then the month of the second day, and lastly the date of the second day (so four total prompts).

For example, if you wanted to know the elapsed number of days between September 4th and November 18th, you would enter 9 into the first prompt, 4 into the second prompt, 11 into the third prompt, and 18 into the fourth prompt. Assume that it is not a leap year! For example, January 4th is the 4th day of the year, and February 6th is the 37th day of the year. If I subtract 4 from 37, I find that 33 days elapse between those two dates.

Reference no: EM132084667

Questions Cloud

What work did newton draw from : What work did Newton draw from, and what did he unify? How did he lay the foundation for some of the concepts that came later?
Copernicus in overturning the ptolemaic system : What kinds of motivations were important to Copernicus in overturning the Ptolemaic system? In what ways was Kepler similar to Copernicus, and in what ways was
Should the two systems be run in parallel : Should it a direct cut over deployment be attempted? It is the cheapest and most direct? Should the two systems be run in parallel?
Write a program in python that requests a user to enter : Write a program in Python that requests a user to enter: percentage of students who received higher than 90 points.
Write a program that will accept two days of the same year : One of the most frustrating aspects of using the Gregorian calendar is that it is difficult to communicate compute elapsed time.
Status of mathematics in the greek conception of science : What was the status of mathematics in the Greek conception of science? In what ways has the Greek conception been preserved, and in what ways has it changed?
Demonstrate how the pseudocode you wrote : Rewrite the above pseudocode so that it takes into account that T is actually an array.
Challenges of the reformation : Did Catholicism mainly benefit from "grassroots" beliefs and practices or because of official responses to the challenges of the Reformation, such as the Counci
How do you write an equality operator : Question: How do you write an equality operator (call it =/) that determines if two yearday instances are equal?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd