Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Write a class called Book having the following data members:
title (String), author1 (String), author2(String), publisher (String), yearPublication (int),
isbn (String), accessionNum (long), issuedTo (LibMember).
Include following public methods in the class:
Default constructor (without any parameters), constructor with 6 parameters (except for issuedTo – initialize issuedTo to null), set and get methods for all attributes, equals and toString.
NOTE: The ISBN is a unique 13 digit number assigned by the publisher. It is like barcode. As there can be multiple copies of a book in a library, the libraries assign a unique number, called accession number, to every book in the library to keep track of the books in the library. Assume that accession number starts from 1001.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps
Knowledge Booster
Similar questions
- Given this class, please add the requested methods in the designated spaces provided. Instance methods: a) Write two constructors that will initialize the instance variables for a Student instance as follows: 1) Write a constructor that takes in three parameters – an int, a String, and a double. The constructor will assign them to the ID, name, and GPA instance variables respectively. 2) Write a no-argument (zero-parameter) constructor that will set the ID to - 1, the name to “No name assigned”, and the GPA to –1.0. b) Write an accessor method for the name variable. c) Write a mutator method for the GPA variable. d) Write a toString() method that will display all three instance variables on a single line, with a | (vertical bar) character between each one. e) Write an equals() method that returns true only if all three instance variables are equal. public class Student { // declare instance variables here private int ID; private String name; private double GPA;arrow_forwardMake C# (Sharp): console project named MyPlayList. Create an Album class with 4 fields to keep track of title, artist, genre, and copies sold. Each field should have a get/set property. Your Album class should have a constructor to initialize the title (other 3 variables should default to null or 0). In addition, create a public method in the Album class to calculate amount sold for the album (copies sold * cost_of_album). You determine the cost of each album. Also create a method in the Album class to display the information. Print out of information should look something like this: The album Tattoo You by the Rolling Stones, a Rock group, made $25,000,000. In the main method, create 3 instances of the Album class with different albums, use setters to set values of the artist, genre, and copies sold. And then use getters to display information about each on the console.arrow_forwardin the date classOverload the constructor method as the class diagram showsIn the main program, create three objects of class date, one from each of the constructors.In the main program, overload the showdate method to display the date in the following formatsThe date in dd/mm/yy formatThe date in dd/mm formatThe date in “d of month” formatIn the main program, make use of each of the showdate methods, one with each of the created objects.Send your two files, the date file and the main program where you use the date constructor overload and the showdate method overload.arrow_forward
- Create a class called Staff that has the following attributes: Staff String - FirstName String - LastName String - Department String - Title Integer - UIN Staff() Staff(FirstName, LastName, Department, Title, UIN) getFirstName() - String setFirstName(String) - void getLastName() - String setLastName(String) - void getDepartment() - String setDepartment(String) - void getTitle() - String setTitle(String) - void getUIN() - Integer setUIN(Integer) - void toString() - String compareTo(Staff) - Integer equals(Staff) - Boolean PreviousNextarrow_forwardWhich statement is true? Question 14 options: An abstract method is a method that appears in a base class but expects to be overridden in a derived class. An abstract method has only a header and no body. When an abstract method appears in a class, it must be overridden in any class that is derived from the class. All of the above.arrow_forwardCreate a Class called Transaction with: instance variables: stock - your stock class type - char -> b or s (buy/sell) quantity - can be fractional price - buy/sell price when - LocalDate constructors: constructor with parameters for stock, type and quantity. - sets the price from the stock price instance variable - sets when from LocalDate getters and setters for each instance variablearrow_forward
- In C++, Create a class called Date that includes three data members: amonth(type int), a day(type int), and a year(type int). The Date class willhave a constructor with three parameters to initialize the three data members.You may assume the values provided for the year and day are correct, but makesure that the month value is in the range 1-12; if it isn't, set the month to1. Provide set and get functions for each data member. Provide a memberfunction displayDate that displays the date in format MM/DD/YYYY.Write a test program that prompts the user to input the month, the day,and the year and uses your Date class to output the formatted date.arrow_forwardDesign a class named octopus that holds attributes for an octopus named weight and color. Include methods to set and get each of these attributes. Create the class diagram and write the class pseudocode that defines the class. Create a small program that declares two octopus objects and set the octopus's name weight and color attributes the program must also output each octopus's name weight and color after they are set. Please write out the pseudocode. I have a hard time with this.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY