data are given by user, to the console and it should be saved in the output file
ID: 3801340 • Letter: D
Question
data are given by user, to the console and it should be saved in the output file.
My part is just to sort the item and create a report module.
output should be in the file and takes user input to funtion accordingly.
for example
1
book name: name of book
author name: name of author
ISBN : isbn number
price :price
date: date
2.
name: harry potter
author: JK rowling
ISBN: 123412341234
price: $200
date: 02/28/2016
database. The Report Module The Report module will analyze the information in the Inventory Database to produce any of the following reports: Inventory List. Alist of information on all books in the inventory. Inventory Wholesale Value. A list of the wholesale value of all books in the inventory and the total wholesale value of the inventory. Inventory Retail value. A list of the retail value of all books in the inventory and the total retail value of the inventory. List by Quantity. A list of all books in the inventory sorted by quantity on hand. he books with the greatest quantity on hand will be listed first. List by Cost. A list of all books in the inventory, sorted by wholesale cost. The books with the greatest wholesale cost will be listed first. List by Age. A list of all books in the inventory, sorted by purchase date. Th books that have been in the inventory longest will be listed first.Explanation / Answer
package chegg;
import java.io.FileWriter;
import java.util.Scanner;
public class ReportModules {
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
System.out.println("Enter Book name");
String bookName= sc.nextLine();
System.out.println("Enter Author Name");
String authorName= sc.nextLine();
System.out.println("Enter ISBN");
String ISBN =sc.nextLine();
System.out.println("Enter Price");
String price =sc.nextLine();
System.out.println("Enter date : DD/MM/YY");
String date= sc.nextLine();
try{
FileWriter fw=new FileWriter("C:/Users/Rahul.16.k/Desktop/New folder/A.txt");
fw.write("name: "+bookName+" ");
fw.write("author: "+authorName+" ");
fw.write("date:"+date+" ");
fw.write("ISBN"+ISBN);
fw.write("price"+price);
fw.flush();
fw.close();
}
catch(Exception e){
System.out.println(e);
}
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.