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

  How a simple backward chaining interpreter could be used

Describe how a simple backward chaining interpreter could be used to go through the possible diagnoses, asking the user questions about their symptoms.

  Find the number rounded to the nearest hundredth

For each value read, the program should display the original value, the number rounded to the nearest integer, the number rounded to the nearest tenth, the number rounded to the nearest hundredth and the number rounded to nearest thousandth.

  Find and correct the errors in your program

Unfortunately, errors in transmission sometimes occur. Thus, your program should first attempt to find and correct these errors.

  You will write an extensive research paper on an

you will write an extensive research paper on an entrepreneurship failure. as you may be aware 80 of all small

  Between an open-source or freeware license distribution

As a business owner you are preparing to release a new software game. What factors must you consider to choose between an open-source or freeware license distribution.

  Describe an action plan for acquiring more skills

Describe, in your summary, an action plan for acquiring more skills to add to your qualifications in the future.

  Write a program that implements the given algorithm

Write a program that implements this algorithm. The user should supply an 8-digit number, and you should print out whether the number is valid or not.

  How would computers operated if there were no stored program

What is the difference between a programmable calculator and a personal computer? How would computers be operated if there were no stored programs?

  How the theory designates the team member roles

define how participation, leadership, and motivational skills would be demonstrated according to this theory.

  Write down a 700- to 1050-word paper by using the

choose one of the project development methodologies to guide your analysis of club it.write a 700- to 1050-word paper

  Write a test program that prompts the user to enter

Write a test program that prompts the user to enter a, b, c, d, e, and f and displays the result.

  Prepare an 8-10-page report in word this report should

prepare an 8-10-page report in word. this report should include a project history of your recent trillo apparel

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