首页 > 其他分享 >159.234 人工智能

159.234 人工智能

时间:2023-05-10 09:12:06浏览次数:35  
标签:rating 人工智能 items library your item 159.234 ID


159.234 OBJECT-ORIENTED PROGRAMMING S1, 2023
Assignment 2
Deadline: 11 May 2023, 11pm
Evaluation: 40 marks (15% of your final grade)
Late Submission: Deduct 5 marks per day late
Individual Work You must complete this assignment by yourself (you must NOT share your code
with others or use others’ code including the code generated by Artificial
Intelligence platforms such as ChatGPT)
Purpose: Reinforce Java OOP core concepts (abstraction, encapsulation, inheritance, and
polymorphism), collections framework and generics, exception handling, and
input and output streams.
1. System Description (Overview of Problem)
You are asked to write a program in Java to simulate a University Library System
Three types of items can be borrowed from the library—Books, Journals, and Movies. The library records
each item’s type, ID, title, year, average rating, number of reviews, and maximum borrowing time (28
days for Books, 14 days for Journals, and 7 days for Movies). Furthermore, for books, the library must
record author and number of pages; for movies, it must record director; and for journals, it must record
volume and number. Due dates must be recorded for all items out on loan.
2. Programming tasks to complete:
A. Read text file library.txt (supplied); for each line in this file, create a Movie/Book/Journal object and add
it to your ‘library’ object
B. List all items in the library, but only display its ID, type, and title
C. Prompt questions to allow users to do the following (refer to attached sample output at the end of this
document for expected prompts and display details):
a. Sort all the items first by average rating and then by ID
b. Search items by ID or phrase in title, and list the items found
c. Select an item from search results and display its details
d. Borrow the selected item if it is available, and display new due date, or
e. Return the selected item if it is on loan, or
f. Rate the selected item and display new average rating
3. Functions workflow (related tasks are marked as A, B, C-a, C-b, C-d, C-d, C-e, and C-f):
Run your program
Create and add library items to your system (A) and output all the items (B)
Search by ‘id’ or ‘phrase in title’ (C-b)
quit
enter ‘id’
Display selected item details (C-c)
Borrow or rate the item (C-d, C-f) Return or rate the item (C-e, C-f)
if item is available if item is on loan
Display item details after borrowed or rated
(C-d, C-f)
borrow rate, enter rate value
Display item details after returned or rated
(C-e, C-f)

2.编程任务完成:
A. 读取文本文件library.txt(提供); 对于此文件中的每一行,创建一个 Movie/Book/Journal 对象并添加
它到你的“图书馆”对象
B.列出图书馆的所有物品,但只显示其ID、类型和标题
C. 提示问题以允许用户执行以下操作(请参阅本文末尾附带的示例输出
预期提示和显示详细信息的文档):
A。 首先按平均评分对所有项目进行排序,然后按 ID 对所有项目进行排序
b. 按标题中的 ID 或短语搜索项目,并列出找到的项目
C。 从搜索结果中选择一个项目并显示其详细信息
d. 借用所选项目(如果可用)并显示新的到期日期,或者
e. 归还所选项目(如果是借出的),或者
F。 为所选项目评分并显示新的平均评分
3. Functions工作流程(相关任务分别标记为A、B、C-a、C-b、C-d、C-d、C-e、C-f):
运行你的程序
创建库项目并将其添加到您的系统 (A) 并输出所有项目 (B)
按“id”或“标题中的短语”搜索 (C-b)
辞职
输入“id”
显示所选项目的详细信息 (C-c)
借用或评价项目 (C-d, C-f) 归还或评价项目 (C-e, C-f)
如果物品可用 如果物品借出
借出或评价后显示物品详情


159.234 OBJECT-ORIENTED PROGRAMMING S1, 2023
4. Design and Implementation Guidelines
Note: You will receive credit for correctness, completeness, no code duplication, and clear on-screen outputs.
Also, the following OOP and general software development guidelines will be checked while marking
your program:
1) Encapsulation design and implementation—proper use of modifiers
a. Private/Protected/Public
b. Must make use of getters and setters wherever appropriate.
2) Inheritance design and implementation
a. Reasonable class hierarchies
b. Proper data-fields separation in base and derived classes
c. Proper methods separation/overloading/overriding in base and derived classes
d. Proper use of base and derived class constructors
3) Polymorphism and implementation
a. Write generic code that targets the base class whenever possible
b. Appropriate use of overriding in derived classes to realize polymorphism
4) Collections framework and generics
a. Use ArrayList or another Java collection class to store information
b. Implement Comparable/Comparator Interface(s) to sort items
5) Exception handling
a. Throw exceptions when an error occurs (e.g., an invalid piece of data is entered)
b. Use “try/catch/finally” or “try/catch” block to handle exceptions
5. Other Specifications
You must follow the next five specifications when completing this assignment:
1) Create the method displayInfo to provide appropriate information as shown below.
The content of displayInfo should be the first thing that displays onscreen
2) Place appropriate comments in your program – e.g.:
/** explain what the program file is doing . . . */
// explain what a part/method of the program is doing…
3) DO NOT add any file path for ‘library.txt’ (put it directly in your project folder when you test your
code)
4) DO NOT add your own package name(s) to the beginning of your .java file
5) DO NOT use any function to clean the screen at any stage of your program
3
159.234 OBJECT-ORIENTED PROGRAMMING S1, 2023
6. Submission Requirements:
1) Zip all your source code (.java files) and submit as a single zip file to Stream
7. Test data and sample outputs:
Task A: Input test data from library.txt file (supplied) into your system
Task B: List all items in the library
Record of movie:
Type, ID, title,
year, director
Record of book: Type,
ID, title, year, author,
number of pages
Record of journal:
Type, ID, title, year,
volume, number
4
159.234 OBJECT-ORIENTED PROGRAMMING S1, 2023
Task C: Prompt questions to allow the user to select all the functions:
The initial value of ‘Average rating’; number of reviewers’
should be set to 0 for all items at beginning
The initial value of ‘Status’ should be set to
‘available’ for all items (none out on loan yet)
As the initial value of ‘Average rating’ is 0 for all items, list is sorted by ‘ID’
5
159.234 OBJECT-ORIENTED PROGRAMMING S1, 2023
Only one rating is available so the user
entered rating value (7 in this example) equal
to the ‘Average rating’
‘Number of reviewers’ changed from 0
to 1 after item received its first rating
Multiple ratings for an item are allowed from one user, so after
their second rating, ‘Average rating’ is: (8+7)/2=7.5
‘Number of reviewers’ changed from 1 to 2 after item’s second rating
6
159.234 OBJECT-ORIENTED PROGRAMMING S1, 2023
The item’s status changed to ‘on loan’
after being borrowed
Due date is current date + max number of
days for borrowing
To calculate date in Java, you may use java
library java.util.Calendar,
java.text.SimpleDateFormat, etc.
‘Status’ becomes ‘available’
after an item is returned
There are two items
whose titles include
‘lord’ (searching
should not be casesensitive); see ‘*1’
and ‘*2’
7
159.234 OBJECT-ORIENTED PROGRAMMING S1, 2023
This round, sort first by ‘average
rating’(descending order) and then
by ‘ID’ (ascending order)

 WX:codehelp

标签:rating,人工智能,items,library,your,item,159.234,ID
From: https://www.cnblogs.com/wolfjava/p/17386951.html

相关文章

  • 转行去做人工智能之 初试C语言
    C语言学习大纲:C语言基础变量、数据类型、运算符控制流语句(if、for、while)函数数组、指针C语言进阶结构体动态内存分配文件操作预处理器C语言高级特性多线程编程指针高级应用系统编程推荐学习资源:https://github.com/moocstudent/c_mooc_learning_from_w......
  • 人工智能学习入门学习笔记 1
    目前人工智能算法分哪几类,哪些是需要训练的?人工智能算法通常可以分为以下几类:1. 监督学习(SupervisedLearning):需要有标注数据,即输入数据与输出结果是已知的,算法通过学习这些数据来建立一个输入到输出的映射模型。例如,图像分类、自然语言处理和预测等任务。2. 无监督学习(Unsupervi......
  • OushuDB 小课堂 丨产品开发的人工智能伦理与创新
    更多内容请关注OushuDB小课堂人工智能伦理是负责任的产品开发、创新、公司发展和客户满意度的一个因素。然而,在快速创新的环境中评估道德标准的审查周期会在团队之间造成摩擦。公司经常错误地在客户面前展示他们最新的AI产品以获得早期反馈。但是,如果反馈非常好并且用户现在想......
  • 《花雕学AI》AI 人工智能伙伴关系的指南:遵循原则,实现实践,展望未来
    引言:人工智能(AI)是指由人造的机器或系统所展现出的智能,它可以模拟或扩展人类的认知功能,如学习、推理、感知、交流等。人工智能的发展和应用已经深刻地影响了社会、经济、文化和政治等各个领域,同时也带来了一系列的伦理和社会问题,如隐私、安全、责任、公平、透明等。为了应对这些......
  • 【Call for papers】2023年CCF人工智能会议信息汇总(持续更新)
    本博文是根据2022年CCF会议推荐的人工智能领域相关会议目录撰写。一、截稿时间总览截稿时间的总时间轴内容将会持续更新......往年投稿及录用情况及链接详见图片后面的内容。二、会议详细目录由于一些会议的投稿时间还没公开,因此根据往年投稿时间在表格中使用 ~符号表示大概的投......
  • 极速进化,光速转录,C++版本人工智能实时语音转文字(字幕/语音识别)Whisper.cpp实践
    业界良心OpenAI开源的Whisper模型是开源语音转文字领域的执牛耳者,白璧微瑕之处在于无法通过苹果M芯片优化转录效率,Whisper.cpp则是Whisper模型的C/C++移植版本,它具有无依赖项、内存使用量低等特点,重要的是增加了CoreML支持,完美适配苹果M系列芯片。Whisper.cpp的张量运算......
  • “人工智能教父”从谷歌离职!称后悔发展AI,为世人敲响警钟?
       在加入谷歌的第十年、深度学习迎来爆发式发展的当下,被誉为“人工智能教父”的GeoffreyHinton已从谷歌离职,只是为了告诫人们AI已经变得很危险。    公开资料显示,GeoffreyHinton在2013年加入谷歌,曾任副总裁,研究机器学习算法十多年,把深度学习技术带进了谷歌的多项业务,直接......
  • 将设计思维应用于人工智能
    选择正确的项目管理方法对于您的项目开发至关重要。它将帮助您避免错误,加速整个过程,并支持发现目标群体的问题。只有在深入了解目标群体的需求后,您才能制定解决他们问题的解决方案。人工智能正在成为我们生活中更大、更重要的一部分。基于人工智能的产品和服务将无处不在,从自动驾......
  • COMP30024人工智能
    ProjectPartBPlayingtheGameCOMP30024ArtificialIntelligenceApril20231OverviewInthissecondpartoftheproject,wewillplaythefulltwo-playerversionofInfexion.Beforeyoureadthisspecificationyoushouldre-readthe‘RulesfortheGame......
  • 人工智能心得体会
    人工智能是一门十分有发展前景的同时对我来说具有挑战性的科学,想要学好这门课程必须要懂得计算机知识以及基本的算法认识。人工智能研究的主要目标是使机器能够胜任一些通常需要人类智能才能完成的复杂工作。虽然这个课程中上机题并不完全是自己独立完成的,在网上找到了一些代码,学......