Question: Define a class named Library with following characteristics Data members: int acc_num-stores the accession number of the book. String title - stores the title
Define a class named Library with following characteristics Data members: int acc_num-stores the accession number of the book. String title - stores the title of the book. String author-stores the name of the author. Member Methods: setValues() - To set values of accession number, title and author. This function return type is void. compute() - This method accepts late Days (number of days late the book returned) and calculates the fine at the rate of $ 2 per day. void display() To display the details in the following format: "Accession-Number Title Author" Note: Print Accession number, title and author separated by a single space. Input 1001 Java Programming Language Ken Arnold, James Gosling, David Holmes 4 where, First line represents the Accession Number. . Second line represents the title of the book. Third line represents the author of the book. Fourth line represents the number of days late. Output 1001 Java Programming Language Ken Arnold, James Gosling, David Holmes 8 where, First line represents output of display call. Second line display calculated fine amount.
Step by Step Solution
3.31 Rating (157 Votes )
There are 3 Steps involved in it
Libraryjava public class Library data members private int accnum private String ... View full answer
Get step-by-step solutions from verified subject matter experts
