programming

posted by hazy

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 and write the pseudocode that defines the class.

Design a class named TextBook that is a child class of Book. Include a new data field for the grade level of the book. Override the Book class methods that set and print the data so that you accommodate the new grade-level field. Create the class diagram and write the pseudocode that defines the class.

  1. hazy

    Very basic pseudo code is what we're dealing with. New to OOP and I do not understand it. I'm not asking anyone to simply solve these problems but rather help walking me through them if possible. These are not assignments, just exercises from the book that I'm trying to do on my own time.

  2. Ralph Return

    class Book
    // Declarations
    private num stockNumber
    private num price
    private num bookPageNum
    private string author
    private string title

    //Methods to set the values.
    public void setStockNumber(num stockNumber)
    this.stockNumber = stockNumber
    return

    public void setPrice(num price)
    this.price = price
    return

    public void setBookPageNum(num bookPageNum)
    this.bookPageNum = bookPageNum
    return

    public void setAuthor(string author)
    this.author = author
    return

    public void setTitle(string title)
    this.title = title
    return


    //Methods to get the values.
    public num getStockNumber()
    return stockNumber

    public num getPrice()
    return price

    public num getBookPageNum()
    return bookPageNum

    public string getAuthor()
    return author

    public string getTitle()
    return title

    endClass

Respond to this Question

First Name

Your Answer

Similar Questions

  1. C#

    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 …
  2. programming

    Design a class named Book that holds a stock number, author, title, price, and number of pages for a book. Include methods to set and get the values for each data field. Also include a displayInfo() method that displays each …
  3. Python: Named tuples

    I've been trying to print a list of the book titles within the named tuple in alphabetical order, but I don't know what I'm doing wrong. I've set up my named tuple as so: Book = namedtuple('Book', 'author title genre year price instock') …
  4. Design

    Design a class named StockTransaction that holds a stock symbol (typically one to four characters), stock name, number of shares traded, and price per share. Include methods to set and get the values for each data field. Create the …
  5. pseudocode

    Create a class named Year that contains data fields to hold the number of months in a year and the number of days in a year. Include a constructor that sets the number of months to 12 and the number of days to 365, and get and set …
  6. Programming Logic and Design

    Create a class named Year that contains data fields to hold the number of months in a year and the number of days in a year. Include a constructor that sets the number of months to 12 and the number of days to 365, and get and set …
  7. Program Design and Development

    Help on Design a class named Book that holds a stock number, author, title, price, and number of pages for a book. Include methods to get and set the values for each data field. Write the pseudocode that defines the class?
  8. Program Design and Development

    Help on Design a class named StockTransaction that holds a stock symbol (typically one to four characters), stock name, number of shares traded, and price per share. Include methods to set and get the values for each data field. Create …
  9. Program Design and Developmen

    Design a class named TextBook that is a child class of Book. Include a new data field for the grade level of the book and get and set methods for the new field. Provide the pseudocode for the TextBook class Very basic pseudo code is …
  10. math

    Book 1 255 book 2 235 book 3 178 book 4 299 book 5 150 book 6 67 book 7 82 book 8 267 book 9 188 book 10 142 book 11 281 book 12 138 book 13 326 book 14 264 book 15 103 ^ number of pages What would be the best graph or display to represent …

More Similar Questions