C#

posted by .

The Peterman Publishing Company has decided that no published book should cost more than 10 cents per page. Create a BookException class whose constructor requires three arguments: a string Book title, a double price and an int number of pages. Create an error message that is passed to the Exception class constructor for the [I]message[I] property when a Book does not meet the price-to-pages ratio. For example an error message might be:

For Goodnight Moon,raio is incalid
...Price is $12.99 for 25 pages

Create a Book class that contains fields for title, author, price , and number of pager. Include properties for each fields. Throw a BookException if a client program tries to construct a Book object for which the price is more than 10 cents per page. Create a program that creates at least four Book objects- some were the ration is acceptable and the others where it is not. Catch any thrown exceptions and display the BookException Message.

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. english

    hi! nedd some help.i am writing a book report and have question.how does my cover page has to look like?
  2. book report

    what do i have to write on a cover page of book report?
  3. Computer Science

    I need help with these assignments. "Write a program to read a list of exam scores (integers in the range 0 to 100) and to output the total number of grades and the number of grades in each letter-grade category (90 to 100 = A, 80 …
  4. English

    Can someone please tell me the format of a COVER page in MLA. I'm looking in my 6th edition book and I find title page but not cover page. I beleive the title goes 1/3 page down, then may 10 lines or so your name, then at the bottom …
  5. programming

    Design a class named Book that holds a stock number, author, title, price, and number of pages for a book. Include a method that sets all the data files and another that prints the values for each data field. Create the class diagram …
  6. math

    08.03)Esther wants to know if the number of words on a page in her language arts book is generally more than the number of words on a page in her social studies book. She takes a random sample of 25 pages in each book and then calculates …
  7. Economics

    I really do not know what to do!:((( You are the marketing manager of the Bloomsbury Publishing that distributes the Harry Potter series. A new book is to be issued and you need to decide at which price it should be offered in US and …
  8. Math

    Hi I'm having some trouble with this question: The selling price of a mathematics textbook is related to the number of pages in the text. A 300 page book sells for $25 and each additional 10 pages increases the price by $1. - What …
  9. English

    On a Works Cited page, which of the following should be in italics?
  10. maths

    It costs a publishing company $50000 to make books. The $50000 is a fixed cost or a cost that cannot change. To help the publishing company sell the books, a marketing company charges $4 for each book sold. If the company sells the …

More Similar Questions