Problem Statement.
Design a ‘book’ class with title, author, publisher, price and author’s royalty as instance
variables. Provide getter and setter properties for all variables. Also define a method
royalty() to calculate royalty amount author can expect to receive the following royalties:10%
of the retail price on the first 500 copies; 12.5% for the next 1,000 copies sold, then 15% for
all further copies sold.
Then design a new ‘ebook’ class inherited from ‘book’ class. Add ebook format (EPUB, PDF,
MOBI etc) as additional instance variable in inherited class.
Override royalty() method to deduct GST @12% on ebooks
Imagine a publishing company that markets both books and audio-cassette versions of its works. Create a class publication that stores the title (a string) ad price (type float) of a publication. From this class derive two classes: book, which adds a page count (type int); and tape, which adds a playing time in minutes (type float). Each of these three classes should have a getdata() function to get its data from the user at the keyboard, and a putdata() function to display its data. Write a main() program to test the book and tape classes by creating instances of them, asking the user to fill in their data with getdata(), and then displaying the data with putdata()Read more on Sarthaks.com - https://www.sarthaks.com/436087/imagine-publishing-company-markets-both-books-audio-cassette-versions-works-create-class
Problem Statement
Design a ‘book’ class with title, author, publisher, price and author’s royalty as instance
variables. Provide getter and setter properties for all variables. Also define a method
royalty() to calculate royalty amount author can expect to receive the following royalties:10%
of the retail price on the first 500 copies; 12.5% for the next 1,000 copies sold, then 15% for
all further copies sold.
Then design a new ‘ebook’ class inherited from ‘book’ class. Add ebook format (EPUB, PDF,
MOBI etc) as additional instance variable in inherited class.
Override royalty() method to deduct GST @12% on ebooks
Write a menu driven program that depicts the working of a library. The menu options
should be:
1. Add book information
2. Display book information
3. List all books of given author
4. List the title of specified book
5. List the count of books in the library
6. List the books in the order of accession number
7. Exit
Create a structure called library to hold accession number, title of the book, author
name, price of the book, and flag indicating whether book is issued or not.
Write a program which uses the concept of Hierarchical Inheritance
Write a program which uses the concept of Single Inheritance
Write a C++ Programme in which Car Parking Reservation System is based on a concept to generate and maintain parking details with their total charge. Before stepping into the main system a user has to pass through a login system to get access, then only he/she can use all the features of the system which includes maintaining arrival car, view all cars, parking charges, and another one is Departure of the car.
Car Arrival
1. Total number of cars arrived.
2. Total parking charges for each car based on the time parking area is used
3. Car Departure
4. VIP Discount
A publishing company markets both books and audiocassette versns of its works. Create a class called publicasn that stores the title (a string) and price (type float) of a publicsn. From this class derive two classes: book, which adds a page count (type int); and tape, which adds a playing time in minutes (type float). Each of the 3 class should have a getdata() funsn to get its data from the user, and a putdata() funsn to display data. Also include two constants publisher name (a string) and address (type int) in the class publication. These constants should be initialized at the time of instantiating an object of class publicasn.
Wap main() that creates an array of pointers to publication. In a loop ask the user for data about a particular book or tape, and use new to create an object of type book or tape to hold the data. Put the pointer to the object in the array. When the user has finished entering the data for all books and tapes, display the resulting data for all books and tapes entered using a loop.
M, N = input().split(' ')
M, N = int(M), int(N)
matrix = []
for i in range(M):
row = [int(j) for j in input().split(' ')]
matrix.append(row)
values = [j for row in matrix for j in row]
values.sort()
output = matrix
for i in range(M):
for j in range(N):
output[i][j] = values[i * M + j]
print(output)
input:
3 3
1 20 3
30 10 2
5 11 15
output:[[1, 2, 3], [5, 10, 11], [15, 20, 30]]the output should be like this:
1 2 3
5 10 11
15 20 30 so, can anyone please give the correct code?
(iii). Data coherence problem and starvation cause a lot of havoc in computer systems. As an Operating System designer and/or developer, you are required to do the following: (α)…Distinguish between data coherence problem and starvation in the context of concurrency in operating systems. Give practical examples to illustrate your answer. (β).…Discuss how the two problems in (α) can be solved in computer systems.