Questionday of the yearassume that a year has 365 days

Assignment Help Computer Engineering
Reference no: EM13348282

Question


Day of the Year
Assume that a year has 365 days, write a class named DayOfYear that gets an integer representing a day of year and translates it to a string consisting of month followed by day of month. Such as-
Day 2 would be January 2
Day 32 would be February 1
Day 365 would be December 31

The constructor for class have to take as parameter an integer representing the day of the year, and class must have a member function print() that prints the day in the month-day format. Class ought to have an integer member variable to represent day and should have static member variables of type string to assist in translation from the integer format to the month-day format.

Test your class by inputting a variety of integers representing days and printing out their symbol in the month-day format.

Day of the Year Modification
Modify the DayOfYear class, written in an earlier Programming Challenge, to add the constructor that takes two parameters- a string representing a month and an integer in range 0 through 31 representing day of the month. A constructor has to then initialize the integer member of the class to represent the day specified by the month and day of month parameters. The constructor has to terminate the program with an appropriate error message if the number entered for a day is outside the range of days for the month given.

Add following overloaded operators-
++ prefix and postfix increment operators. These operators must modify DayOfYear object so that it represents next day. If the day is previously the end of year, the new value of object will represent the first day of the year.

-- prefix and postfix decrement operators. These operators should modify DayOfYear object so that it represents the earlier day. If the day is already the first day of the year, new value of the object will signify last day of the year.

 

Reference no: EM13348282

Questions Cloud

Questionassume a client host m wants to obtain secure : questionassume a client host m wants to obtain secure connections with a web server n. they use the certificate
Questiongeneral mills nyse gis is a large distributor and : questiongeneral mills nyse gis is a large distributor and manufacturer of package consumer food products. benoit
Questionhome wireless network and securitymethodology- : questionhome wireless network and securitymethodology- review topics covered in lecture hours from textbook reference
Question in each of the given scenarios evaluate in regards : question in each of the given scenarios evaluate in regards to the exchange with xaas amount realized bas loss or gain
Questionday of the yearassume that a year has 365 days : questionday of the yearassume that a year has 365 days write a class named dayofyear that gets an integer representing
Questionthere are eight cars in every team called chevy and : questionthere are eight cars in every team called chevy and ford. one car from each team races its opponent on drag
Questionillustrate a memory map for a system with a memory : questionillustrate a memory map for a system with a memory capability of 512mb. each memory location in system is 8
Questionyou use a 1 ghz system with paged virtual memory : questionyou use a 1 ghz system with paged virtual memory for doing a real-time application. no other application is
Questionpurchased merchandise from blue company under the : questionpurchased merchandise from blue company under the given terms 3700 price invoice dated april 2 credit terms of

Reviews

Write a Review

Computer Engineering Questions & Answers

  Designing an inventory management system

Xhemrock is a brake pad manufacturing company. This company utilizes the raw materials, like carbon powder, ash, iron, and resin. It wishes to design an inventory management system which will have the following attributes: The system must store th..

  Discuss information technology profession and ethics

Discuss the Information Technology profession and professional ethics in this profession.How would professional ethics be implemented in an organization.

  Analyzing the business case

We require a corporate goal for SCR which refers to our new training activity. Construct a draft to show Jesse. Jesse wants my opinion on whether or not SCR requires a systems review committee. Need to prepare a recommendation and the reasons.

  What devices use to get efficient network communication

CNT Books has expanded considerably as you first got network up and running three years ago. It at the present occupies an entire floor in building, and its LAN has full-grown to contain several servers and more than 60 workstations.

  What are the benefits of networked computers

What are the advantages and drawbacks of email communication, or what if the email system went down in a major company. how will this impact productivity? Do companies rely on heavily on electronic communication today.

  Image smoothing with gaussian masks and c++

Implement the image smoothing utilizing the convolution with Gaussian masks with C++. You must utilize 2 input images which are pgm files. First, implement 2D Gaussian convolution utilizing the 1D Gaussian masks.

  Design a script that will allow the user to enter one

make a script that will allow the user to enter one of several choices from the command line.

  Develop an internet strategy

Prepare functional specifications for the company's use of the Web and the Internet. Include links to and from other sites in your design.

  What are the major problems of nrz

What are the major problems of NRZ (Non-Return to Zero) encoding/signaling? Is there any case where it's use could be acceptable? explain.

  Write down a program that requests an integer

The Twelve Days of Christmas. Each year, PNC Advisors of Pittsburgh publishes a Christmas Price List. See Table 6.11. Write a program that requests integer from 1 through 12 and then lists the gifts for that day along with the day's cost.

  Program calculates and displays the mortgage payment amount

make a procedural C++ program that calculates and displays the mortgage payment amount that will display mortgage amount, the term of the mortgage, and the interest rate of the mortgage.

  Give snmp help to monitor a network

What are some of the factors other then network itself that can cause the network to seem slow.

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