Post a New Question


posted by .

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.

  • programming -

    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.

  • programming -

    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

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

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

    public void setAuthor(string author) = author

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

    //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


Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

More Related Questions

Post a New Question