Create an abstract class Product  with following  Properties Price (Decimal), Code (string), Description (string) Create an interface ISellable with the following Method sell that takes the count of the products to sell and returns the cost   public decimal sell(int count); Create a concrete class Book that  Inherits from class Product and implements interface ISellable Has additional Property Author (string) Add a constructor with parameters, and ToString method to display all of data of class Book Similarly, create anot concrete class Software that  Inherits from class Product and implements interface ISellable Has additional Property Version (string) Add a constructor with parameters, and ToString method to display all of data of the class Software Finally, write a client code (main program) that will utilize the class and interface hierarchy you created. Create two Book objects for the following books C# 8.0 in a Nutshell, with price $50.99 and with ISBN 978-1492051138 by Jack Smith C#: Advanced Features and Programming Techniques, with price $2.99 and with ISBN 100-1492051000 by Jill Smith Ask the user how many of each book the user wants to buy and then display a report of how much the total cost is. Create a Software object for the following Software Microsoft 365 Personal with price $69.99 and version 16.0.10827 Ask the user how many of the Microsoft 365  the user wants to buy and then display a report of how much the total cost is.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
  • Create an abstract class Product  with following 
    • Properties Price (Decimal), Code (string), Description (string)
  • Create an interface ISellable with the following
    • Method sell that takes the count of the products to sell and returns the cost  

public decimal sell(int count);

    • Create a concrete class Book that 
      • Inherits from class Product
      • and implements interface ISellable
      • Has additional Property Author (string)
      • Add a constructor with parameters, and ToString method to display all of data of class Book
    • Similarly, create anot concrete class Software that 
      • Inherits from class Product
      • and implements interface ISellable
      • Has additional Property Version (string)
      • Add a constructor with parameters, and ToString method to display all of data of the class Software
    • Finally, write a client code (main program) that will utilize the class and interface hierarchy you created.
      • Create two Book objects for the following books
  • C# 8.0 in a Nutshell, with price $50.99 and with ISBN 978-1492051138 by Jack Smith
  • C#: Advanced Features and Programming Techniques, with price $2.99 and with ISBN 100-1492051000 by Jill Smith
        • Ask the user how many of each book the user wants to buy and then display a report of how much the total cost is.
      • Create a Software object for the following Software
  • Microsoft 365 Personal with price $69.99 and version 16.0.10827
      • Ask the user how many of the Microsoft 365  the user wants to buy and then display a report of how much the total cost is. 

 

 

Expert Solution
Explanation

NOTE - I have used the Java programming language.

Here I have created all the classes and interface as per the question.

Next, I have created the main method and inside the main method, I have created 2 objects of Book type.

Next, I have printed the book information and taken input from the user for the number of books of each type.

Then I have printed the total cost for the books.

Next, I have created the object of Software type and taken input from the user, and printed the total cost to the console.

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education