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 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. 👍 0
  2. 👎 0
  3. 👁 604
  1. 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.

    1. 👍 0
    2. 👎 0
  2. 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

    1. 👍 0
    2. 👎 0

Respond to this Question

First Name

Your Response

Similar Questions

  1. Math

    The price of a stock, A(x), over a 12-month period decreased and then increased according to the question A(x)= 0.75x2-6x+20, where x equals the number of months. The price of another stock, B(x), increased according to the

    asked by Kendra on June 9, 2008
  2. English

    Select all that apply. If you are using an in-text citation for a book, what information needs to be put in parentheses? the author's name the author's last name the book's title the publisher the page number

    asked by Kyle on March 1, 2020
  3. managerial

    The demand curve for haircuts at Terry Bernard's Hair Design is P=20-0.20Q where Q is the number of cuts per week and P is the price of a haircut. Terry is condering raising her price above the current price of $15. Terry is

    asked by tina on August 8, 2010
  4. English

    On a Works Cited page, which of the following should be in italics? title of a book title of a webpage title of a short story title of a newspaper article I'm thinking book but I'm not sure:/

    asked by SkatingDJ on June 3, 2016
  5. math

    a shopkeeper sold a certain number of toys.the number of toys as well asthe price of each toy in rs was a two digit number.By mistake, he reversed the digits of both the number of toys he sold and price of each toy. as a result ,

    asked by neha sinha on September 23, 2018
  1. Writing Skills, Part 3

    6. You have found an article in the Readers' Guide that you want to locate. What information would be least important in finding it? A. Subject heading B. Volume and page numbers C. Author's name D. Title of the article Student

    asked by yes help me I'm an idiot on April 5, 2015
  2. ECON

    The demand curve for haircuts at Terry’s Hair Design is P=20-0.20Q Where Q is the number of cuts per week and P is the price of a haircut. Terry is considering raising her price above the current price of $15.00. Terry is

    asked by Anonymous on February 7, 2012
  3. 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

    asked by reem on July 16, 2014
  4. English

    1. A research paper has which of the following aspects in common with an essay? A. a title page B. a works cited list C. body paragraphs with topic sentences D. personal experience as a primary source 2. When citing all sources,

    asked by Jay on April 17, 2015
  5. English

    1. Your instructor assigned the class to write an essay about a famous artist. What is the first step you should take to begin this project? A. Construct your thesis statement B. Decide the exact number of sources you will use C.

    asked by Taj on February 9, 2018
  6. math

    A shopkeeper sold a certain number of toys.The number of toys as well as da price of each toy in Rs. was a two digit number. By mistake he reversed da digits of both the number of toys he sold and the price of each toy.As a

    asked by neha sinha on September 23, 2018

You can view more similar questions or ask a new question.