Design a class called numdays

Assignment Help Computer Engineering
Reference no: EM132084377

Number of Days. Design a class called NumDays. The class's purpose is to store a value that will convert the number of worked hours to a number of days.

For example, 8 hours would be converted to 1 day, 12 hours would be converted to 1.5 days and 18 hours converted to 2.25 days.

The class must have a constructor that accepts a number of hours. There must also be member function to set and get the hours and days. The class should have 2 data members, hours and days.

The class will also overload several operators:

the addition operator. This operator will add the hours of the two objects and return a new instance of the NumDays with its hour's data member set to the sum of the other two objects.

the subtraction operator will also be overloaded which will subtract the two objects and return a new instance of the NumDays class.

the prefix and postfix increment operator. These operators should increment the number of hours stored in the object. It will return an instance of the NumDays object.

the prefix and postfix decrement operator. These operators should decrement the number of hours stored in the object. It will return an instance of the NumDays object.

Note that when the number of hours changes, the number of days should always be updated. The user of this class should be able to use the object in a statement like C = A + B; where A, B and C are instances of the NumDays class. Main must show that the class and all the operators work correctly.

Reference no: EM132084377

Questions Cloud

What is the break-even level of ebit : All of the money raised from the debt issue would be used to repurchase stock. What is the break-even level of EBIT between the two structures?
What are some budget benefits : What are some budget benefits that might come from both emergent threat priority and Salary and operating increases and decreases?
Stepping into the banking and finance industry : What are the key points to take note of when stepping into the banking and finance industry.
Accounting and economic definition of profit : Explain what is the differences between accounting and economic definition of profit.
Design a class called numdays : Design a class called NumDays. The class's purpose is to store a value that will convert the number of worked hours to a number of days.
How much will you have after two years : If you deposit ?$1,400 in a bank CD that pays interest of 8?% per? year, how much will you have after two years?
Find the market capitalization : By looking around this site, you should be able to find the market capitalization (E) as well as the ß for any publicly traded company.
Corporate overhead among cost centers : What is the best way to distribute corporate overhead among cost centers?
How many shares outstanding does flex have : They issued these shares at $40 and they are now trading at $50. How many shares outstanding does Flex have?

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