Question
Create a Eclipse Java project. The project must contain a class BookCreater.java . It must have EXACTLY the same content as follows: import java.util.ArrayList; import
Create a Eclipse Java project. The project must contain a class BookCreater.java. It must have EXACTLY the same content as follows:
import java.util.ArrayList; import java.util.Scanner;
public class BookCreater { public static void main(String[] args) { Scanner input = new Scanner(System.in); String entry; System.out.print("Enter title of a book or \"q\" to quit >> "); entry = input.nextLine(); while (!entry.equals("q")) { String title = entry; System.out.print("How many authors >> "); int numAuthors = Integer.parseInt(input.nextLine()); ArrayList } } |
Study the above code carefully and then create another class CommercialBook.java in the same project. The CommercialBook.java may contain any methods, but MUST contain the following instance variables ONLY:
- String title;
- ArrayList
- double price;
When running the program (i.e., main method in BookCreater.java), the program will get the title, authors and price of a book from user, then save the record in the MS Access DB file CSIS2175002Quiz02.accdb. The following shows a sample run of the program (Green text refers to user input):
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started