

Additional info is this will use a total of four classes Book, BookApp, TextBook, and TextBookApp.
Also uses Super in the TextBook Class section.
Here I am providing the answers for above questions:
Problem 1:
class Book
{
String title;
double price;
public Book() //first constructor(default consructor)
{
this.title="";
this.price=0.0;
}
public Book(String title,double price) //second constructor with
parameters
{
this.title=title;
this.price=price;
}
public String getTitle() //getTitle method to return the
title
{
return this.title;
}
public void setTitle(String title) //setTitle method to assign the
title
{
this.title=title;
}
public double getPrice() //getPrice method to return the
price
{
return this.price;
}
public void setPrice(double price) //setTitle mehtod to assign the
price
{
this.price=price;
}
public String toString() //toString method to print details
{
return "\nTitle:"+this.title+"\nPrice:"+this.price;
}
}
public class BookApp
{
public static void main(String args[])
{
Book b1=new Book(); //creating the first object b1 by calling
default constructor
b1.setTitle("John Doe");
b1.setPrice(8.5);
System.out.println(b1.toString()); //calling toString method to
print details of book1
Book b2=new Book("Ann Smith",9.7); //creating the second object b2
by calling parameter constructor.
System.out.println(b2.toString()); //calling toString method to
print details of book2
}
}
Output:

Problem 2:
class TextBook extends Book //TextBook class extending the Book
Class
{
int courseID;
public TextBook() //first constructor(default consructor)
{
super("",0.0);
this.courseID=0;
}
public TextBook(String title,double price,int courseID) //second
constructor with parameters
{
super(title,price);
this.courseID=courseID;
}
public int getCourseID() //getCourseID method to return the
courseID
{
return this.courseID;
}
public void setCourseID(int courseID) //setCourseID method to
assign the courseID
{
this.courseID=courseID;
}
public String toString() //toString method to print details
{
return super.toString()+"\nCourseID:"+this.courseID;
}
}
public class TextBookApp
{
public static void main(String args[])
{
Book b=new Book("Ann Smith",9.7); //creating the book object b by
calling parameter constructor
System.out.println(b.toString()); //printing the details by calling
toString method.
TextBook tb1=new TextBook(); //creating the first object tb1 by
calling default constructor
tb1.setTitle("John Doe");
tb1.setPrice(8.5);
tb1.setCourseID(2050);
System.out.println(tb1.toString()); //printing the details
TextBook tb2=new TextBook("Ann Smith",9.7,3090); //creating the
second object t2 by calling parameter constructor.
System.out.println(tb2.toString()); //printing the details
}
}
Output:

Hoping that the above answers will help you...Thank you...
Additional info is this will use a total of four classes Book, BookApp, TextBook, and TextBookApp....
Book: - title: String - price: double +Book() +Book(String, double) +getTitle(): String +setTitle(String): void +getPrice(): double +setPrice(double): void +toString(): String The class has two attributes, title and price, and get/set methods for the two attributes. The first constructor doesn’t have a parameter. It assigns “” to title and 0.0 to price; The second constructor uses passed-in parameters to initialize the two attributes. The toString() method returns values for the two attributes. Notation: - means private, and + means public. 1....
1- Create the base class Book that has the following instance variables, constructor, and methods title ( String) isbn ( String) authors (String) publisher (String) edition ( int) published_year (int) Constructor that takes all of the above variables as input parameters. set/get methods ToString method // that return sting representation of Book object. 2- Create the sub class New_Book that is derived from the base class Book and has the following instance variables, constructor, and methods: title ( String) isbn...
C# programming
50 pts Question 2:2 1- Create the base class Book that has the following instance variables, constructor, and methods title (String) isbn (String) authors (String) publisher (String) edition ( int) published year (int) Constructor that takes all of the above variables as input parameters. set/get methods ToString method// that return sting representation of Book object. 2-Create the sub class New_Book that is derived from the base class Book and has the following instance variables, constructor, and methods: title...
Implement the classes in the following class diagram. The Book class implements the Comparable interface. Use implements Comparable<Book> in the class definition. Now, all book objects are instances of the java.lang.Comparable interface. Write a test program that creates an array of ten books. 1. Use Arrays.sort( Book[]l books) from the java.util package to sort the array. The order of objects in the array is determined using compareTo...) method. 2. Write a method that returns the most expensive book in the...
JAVA This PoD, builds off the Book class that you created on Monday (you may copy your previously used code). For today’s problem, you will add a new method to the class called lastName() that will print the last name of the author (you can assume there are only two names in the author name – first and last). You can use the String spilt (“\s”) method that will split the String by the space and will return an array...
Java Program: Design a class “Book” with the data attributes title - String, author - String, yearPublished - integer and price - double. Write a parameterized constructor that initializes the attributes. Write accessor and mutator methods, and a print method that prints all of the attributes. In the main method, create a single object and give it values of your choice. Call the print method to print the values. Sample Run: The Book is: The Art of Computer Programming Donald...
Programming language: Java
Design an application that has three classes. The first one, named Book describes book object and has title and number of pages instance variables, constructor to initialize their values, getter methods to get their values, method to String to provide String representation of book object, and method is Long that returns true if book has over 300 pages, and returns false othewise. Provide also method char firstChard) that returns first cahracter of the book's title. The second...
Code should be in C# Create a class called SavingsAccount. Use a static variable called annualInterestRate to store the annual interest rate for all account holders. Each object of the class contains a private instance variable savingsBalance, indicating the amount the saver currently has on deposit. Provide method CalculateMonthlyInterest to calculate the monthly interest by multiplying the savingsBalance by annualInterestRate divided by 12 – this interest should be added to savingsBalance. Provide static method setAnnualInterestRate to set the annualInterestRate to a new value....
re-implement the Bookshelf class using a linkedlist and a Node class. Implement the above add, remove, and search methods again. here is the code for that: public class Book { private String title; private double price; public Book() { title=""; price=0; } public Book(String title, double price) { this.title = title; this.price = price; } public void setTitle(String title) { this.title = title; } public void setPrice(double price) { this.price = price; } public...