NumDays.cpp - NumDays.cpp PA#9 Created by Jada Mitchell on...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// // NumDays.cpp // PA #9 // // Created by Jada Mitchell on 9/19/16. // Copyright © 2016 Jada Mitchell. All rights reserved. /* Design a class called NumDays. The class’s purpose is to store a value that represents a number of work hours and convert it 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 would be converted to 2.25 days. The class should have a constructor that accepts a number of hours, as well as member functions for storing and retrieving the hours and days. */ #include "NumDays.h" using namespace std; #include <iostream> // first we want to access the number of hours the user gave us by storing it NumDays::NumDays(int hvalue) { hoursworked = hvalue; } // have to access the value stored inside the number of hours worked from above and multiply it by 8 since we know 1 day = 8 hours NumDays::NumDays(double hcalc)
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern