{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lab 4 instructions - 1 Review the design recipe for...

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

View Full Document Right Arrow Icon
1. Review the design recipe for classes (attached below) 2. Using the design recipe for classes (attached below), write a class definition and a template for: a microwave; a shirt; an MS Word document; a sound (think of what a sound consists of...) 3. (You know I had to do it): Using the design recipe for classes, write a class definition for a checkbook. Write a template using your design recipe. Now, using the template, write a function that adds money to the balance of the checkbook. Using the template, write a function that with- draws money from the checkbook balance as follows: if the amount to be withdrawn is less than the current balance, adjust the balance accordingly. If, however, the balance is less than the amount to be withdrawn, a warning message is printed (saying something like, “Sorry, you can- not withdraw that amount because your balance is only...”) and the checkbook balance remains the same. 4. At any given moment, the weather consists of temperature (in Fahrenheit), the relative humid- ity, and wind speeds. Using the Design Recipe for classes, write a class definition for the weath- er. Write a template. Now, using the template, write a function that returns the wind chill temper- ature, which is calculated using 35.74 + 0.6215 x T – 35.75 x V 0.16 + 0.4275 x T x V 0.16 , where T is the current temperature and V is the current wind velocity (speed) in miles per hour.
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