Question

In: Computer Science

The late fee for a book at the Palm Beach State College library is accessed on...

The late fee for a book at the Palm Beach State College library is accessed on a sliding scale depending upon how many days late the book is. For books less than 5 days late, the fee is 10 cents per day. If the book is late 5 through 20 days, the late fee is 25 cents a day, and if the book is more that 20 days late, the student must pay the full cost for the book. Write a program that prompts the user to enter the number of days late for a book and the book's purchase price. Based on the input, output what the fee will be for the late book.

This is C++ class. Thank you.

Solutions

Expert Solution

#include<iostream>
using namespace std;

class Book{

private:
    int late_days;
    float price;
    float fee;

public:
    void getInput(){
        cout<<"Please enter the number of late days :";
        cin>>late_days;
        cout<<"Please enter the actual price of the book :";
        cin>>price;
    }
    void calculateFee(){
    if (late_days <5)
        fee=10*late_days;
    else if (late_days >= 5 && late_days <= 20)
        fee = 25*late_days;
    else if (late_days > 20)
        fee = price;
    cout<<"Late Fee to be charged is : "<<fee<<" Cents";
    }
};

int main(){

Book b;                         //object creation
b.getInput();                 //Function for taking inputs from user
b.calculateFee();         //Function for calculating fee

}


Related Solutions

1. To estimate the mean triglyceride levels of people in West Palm Beach, a blood test...
1. To estimate the mean triglyceride levels of people in West Palm Beach, a blood test on 30 randomly selected people was conducted and yielded a mean triglyceride level of 220, with a standard deviation of 12. Construct a 95% confidence interval for the true average triglyceride level of people in West Palm Beach. Round your answer to three decimal places. a. (218.868, 229.132) b. (215.519, 224.481) c. (214.967, 233.033) d. (219.741, 230.259)
Jim Connor is the owner of Wave Riders, a surf shop located in West Palm Beach,...
Jim Connor is the owner of Wave Riders, a surf shop located in West Palm Beach, Florida. Jim has just received his end of the year financial statements from his accountant. When he sees his gross and net income he is dismayed. With almost $250,000 in gross profit he just doesn’t understand why he is always short on cash to pay his employees and suppliers. One of his largest suppliers of surf boards notified him just last month that they...
Discussion topic 2: Research – Asset Misappropriation Conduct research in the Library accessed through the home...
Discussion topic 2: Research – Asset Misappropriation Conduct research in the Library accessed through the home area of the course room and locate an article on noncash asset misappropriation. Discuss the article in terms of prevention and detection.
Scenario: You and Sam have been in touch since the Palm Beach Business Development Luncheon, and...
Scenario: You and Sam have been in touch since the Palm Beach Business Development Luncheon, and he has expressed interest in your working on his business audit. The two of you make plans to meet for lunch, but this time at his deli in Boca. Sam would like a proposal for the services you (T&M) can offer. If he likes the proposal, he is prepared to sign a follow-up engagement letter. You go back to the office to start work...
Scenario: You and Sam have been in touch since the Palm Beach Business Development Luncheon, and...
Scenario: You and Sam have been in touch since the Palm Beach Business Development Luncheon, and he has expressed interest in your working on his business audit. The two of you make plans to meet for lunch, but this time at his deli in Boca. Sam would like a proposal for the services you (T&M) can offer. If he likes the proposal, he is prepared to sign a follow-up engagement letter. You go back to the office to start work...
Read “New IASB Leader Embraces Challenges” which can be accessed through the DeVry online library. Choose...
Read “New IASB Leader Embraces Challenges” which can be accessed through the DeVry online library. Choose a country that has already adopted IFRS. In 2-3 pages (12-pt type, double-spaced) answer the following questions: 1. Describe the process that your selected country went through to adopt IFRS, such as how long it took for the country to fully adopt IFRS. 2. Did the country adopt IFRS or did they make changes to IFRS to adapt to their country’s culture or regulations?...
Read “It's Time for Principles-Based Accounting Ethics” which can be accessed through the DeVry online library....
Read “It's Time for Principles-Based Accounting Ethics” which can be accessed through the DeVry online library. In 3-4 pages (12-pt type, double-spaced) answer the following questions: Do you agree with the authors that a code of ethics should do more than establish minimum acceptable standards? Why or why not? Describe the five cardinal virtues of professional accountants that the article’s authors discuss. We’ve talked about rules-based versus principles-based accounting standards. Should we have rules-based ethics standards? Why or why not?...
A physics book was thrown from the top of a library with a speed of 8.0...
A physics book was thrown from the top of a library with a speed of 8.0 m/s at angle 60o with the horizontal. After 5 seconds, the book hits the ground: (a) Find the height of the library above the ground. (b) Find the distance of the point where the book falls on the ground from the base of the library. (c) Just before the book hits the ground, find the horizontal and vertical components of its velocity.
Seven hundred and seventy-one distance learning students at Long Beach City College, located in Long Beach,...
Seven hundred and seventy-one distance learning students at Long Beach City College, located in Long Beach, California (part of the Los Angeles metropolitan area) responded to surveys in the 2010-11 academic year. Highlights of the summary report are listed in the table below: Have computer at home 96% Unable to come to campus for classes 65% Age 41 or over 24% Would like LBCC to offer more DL courses 95% Took DL classes due to a disability 17% Live at...
The director of library services at a college did a survey of types of books (by...
The director of library services at a college did a survey of types of books (by subject) in the circulation library. Then she used library records to take a random sample of 888 books checked out last term and classified the books in the sample by subject. The results are shown below. Subject Area Percent of Books on Subject in Circulation Library on This Subject Number of Books in Sample on This Subject Business 32% 237 Humanities 25% 226 Natural...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT