求助一道Java作业题,挺急的 多谢
要求是写一个程序 读入产品描述,输出产品数据
例如以下output
Description
Here is a sample transcript of the output of this program:
Enter database filename: lab1_input.txt
Product Summary Report
------------------------------------------------------------
Title: The Shawshank Redemption (***)
Product Type: DVD
Price: 19.95
Title: The Dark Knight (***)
Product Type: DVD
Price: 19.95
Title: Casablanca (****)
Product Type: DVD
Price: 9.95
Title: The Girl With The Dragon Tattoo (***)
Product Type: Book
Price: 14.95
Title: Vertigo (**)
Product Type: DVD
Price: 9.95
Title: A Game of Thrones (**)
Product Type: Book
Price: 8.95
------------------------------------------------------------
Total products in database: 6
Highest average score: 4
Highest average ranked product: Casablanca
Lowest average score: 2
Lowest average ranked product: Vertigo
------------------------------------------------------------
具体要求是
1. Ask the user to enter the name of the file that contains the product database
2. Input the product information from the file and store it in 6 separate arrays – one array of Strings containing the product name, one array of Strings containing the product type, one array of doubles containing the product price, and 3 separate arrays of integers containing user ratings (see below for the input file format)
3. Compute the average user rating for each product. Note that you do not need to convert this average from an integer to a double for this assignment.
4. Output a well-formatted report as described above. Note that the stars in parentheses after the product name in the report above is a representation of the average rating for that product as computed from the individual user ratings in the file.
5. Output the total number of products, the highest average score, the product with that score (with the product type in parentheses), the lowest average score and the product with that score. NOTE: For this assignment if multiple products have the same average score it is acceptable to report any one of those product names when reporting the movie with the lowest average score or the movie with the highest average score. In the example above, either “Vertigo” or “A Game of Thrones” would be acceptable solutions.
最后给你了Input File Format
The input file for this assignment uses the following format:
<number of products>
<product name>
<product type>
<product price>
<user 1 score>
<user 2 score>
<user 3 score>
<product name>
<product type>
<product price>
<user 1 score>
<user 2 score>
<user 3 score>
…
如有高手帮忙 感激不尽!