首页 > 其他分享 >COMP2401A Pokemon 问题

COMP2401A Pokemon 问题

时间:2023-08-20 11:33:46浏览次数:70  
标签:partitioning script type COMP2401A 问题 file csv Pokemon


COMP2401A – Assignment 5
Prerequisites
Please review the lectures up to and including Module 15 – Scripting.
Download the csv file containing Pokemon descriptions.
Learning Objectives
• Convert a set of requirements into the program design and implement running code
• Manipulate file data using a Linux Bourne (sh) shell script
Learning Outcomes
1. You will learn how to augment your applications with shell scripts
Pokemon Partitioning Script
The goal of this assignment is to develop a Bourne shell script that helps gamers explore the
properties of Pokemon:
You are a Programmer/System Administrator. Gamers really like Pokemon games and
trading cards. In order to improve thier Pokemon gaming abilities Gamers need to
explore the properties of different Pokemon. A CSV file listing all Pokemon and their
properties is available in the public domain. Earlier you developed a C application that
allows Gamers to query the CSV file, but they are unhappy with the application
performance. To help improve the performance of your application you want to introduce
a pre-processing step to partition the CSV file by Pokemon type. Partitioning the data
often improves the speed of queries. Because this step is not performed very often, and to
save coding effort, you decided to implement the partitioning step using a Bourne shell
script.
© Copyright: Mikhail Genkin, 2021
Legal Disclaimer
Pokemon and all related images, trademarks and copyrights are property of their rightful owners.
This assignment is intended as a fun learning exercise and is not intended to infringe on any of
these copyrights and trademarks. Please consult this site for legal obligations regarding
Pokemon: https://www.pokemon.com/us/
Functional Requirements
Use Case 1 – Administrator runs the partitioning script.
Actor: System Administrator (for the assignment this is the same person as the developer - you)
Steps:
1. The System Administrator starts the partitioning script using Linux terminal.
2. The partitioning script reads the pokemon.csv file and:
a. For each unique Pokemon type (Type 1) creates a sub-directory (in the directory
containing pokemon.csv - you can assume that the script will be run in that
directory) named as the Pokemon type – e.g. if Type 1 is Electric, then a subdirectory named Electric is created
b. In the Pokemon type sub-directory it creates a file named after the pokemon
type and gives it the csv extension – e.g. if Type 1 is Electic, then the name of the
file will be Electric.csv
c. The partitioning script writes all lines from pokemon.csv that describe the
Pokemon of that type into the matching type partition csv file – e.g. if Type 1 is
Electic, then all lines that contain Type 1 = Electric Pokemon into the
Electric/Electric.csv file
d. The source pokemon.csv file is not moved or modified by the partitioning script
e. The partitioning script deletes any temporary or intermediate files (if any)
NFR1 – Performance
The query program must be very fast – especially when Pokemon are queried by type.
Deliverables
This assignment will have two deliverables and will use the same grading approach as the
previous assignments (please refer to the previous announcement in Brighspace for details):
1. Design document (3 pages maximum length).
a. Submitted in PDF format.
b. For full marks it should:
© Copyright: Mikhail Genkin, 2021
i. Include pseudo-code and/or flow chart(s) that explain how your script
will work.
ii. Explain which Linux commands/programs you chose to use and why
iii. Use headings to organize the document
iv. Be legible and easy to follow
2. Bourne shell script code.
a. For full marks the script should:
i. Run without error and correctly create the artifacts described in Use Case
1 (it can be assumed that the grader has the required Linux permissions
to run the script successfully).
ii. Include helpful comments and follow the recommended style guidelines
described in Module 15 – Scripting.

 

标签:partitioning,script,type,COMP2401A,问题,file,csv,Pokemon
From: https://www.cnblogs.com/longtimeagos/p/17643769.html

相关文章

  • CTP tick数据合成K线的问题
    各个交易所的tick数据上海期货交易所(SHFE):以rb2310为例日盘收盘15:00:00的tick是有效数据,今收盘ClosePrice和结算价SettlementPrice也在15:00:00推送。中间休息前的收盘10:15:00是有效数据,夜盘收盘23:00:00是有效数据。这些时间的整点不属于新K线,而是上1分钟的K线。怎么知道是有......
  • 动态规划--最长公共子序列( LCS 问题)
    博客地址:https://www.cnblogs.com/zylyehuo/#-*-coding:utf-8-*-#最长公共子序列的长度deflcs_length(x,y):m=len(x)n=len(y)c=[[0for_inrange(n+1)]for_inrange(m+1)]foriinrange(1,m+1):forjinr......
  • 安装容器遇到的问题
    windows系统上安装docker先要下载安装包下载页面为:https://docs.docker.com/desktop/install/windows-install/ 有时候打不开,导致无法下载docker安装包,可以试试将下载连接放到迅雷中试试https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe......
  • 《区间最值操作与历史最值问题》(吉如一)阅读笔记
    A.基础区间最值操作问题描述给定一个序列\(A\),需要支持以下操作:给定区间,将内部所有元素对\(X\)取最大值。询问区间和。解法首先,传统的线段树区间操作时间复杂度为\(\Theta(\logn)\),这是基于任何一个区间在线段树上作拆解,最终得到的所有节点个数为\(\logn\)级别。......
  • 动态规划--钢条切割问题
    博客地址:https://www.cnblogs.com/zylyehuo/#-*-coding:utf-8-*-importtimedefcal_time(func):defwrapper(*args,**kwargs):t1=time.time()result=func(*args,**kwargs)t2=time.time()print("%s......
  • 解决达梦数据库密码复杂性导致的数据导出问题 - 问题记录
    问题描述在使用达梦数据库时,遇到了以下问题:密码过于复杂,无法进行数据库的导出备份操作。数据库导出时存在表数据导出不全的情况。本文旨在记录并解决这些问题的过程。问题解决过程问题1:密码过于复杂导致无法导出备份解决方法:使用管理员账户连接到达梦数据库,并修改数......
  • C++问题汇总
    一、执行C++程序报错1、现象#现象./gtest_W:/lib64/libstdc++.so.6:version`GLIBCXX_3.4.20'notfound(requiredby./gtest_W)./gtest_W:/lib64/libstdc++.so.6:version`CXXABI_1.3.9'notfound(requiredby./gtest_W)./gtest_W:/lib64/libstdc++.so.6:version......
  • 收藏~Dropbox 是如何解决 Android App 的内存泄漏问题的?
    当应用程序为对象分配内存,而对象不再被使用时却没有释放,就会发生内存泄漏。随着时间的推移,泄漏的内存会累积,导致应用程序性能变差,甚至崩溃。泄漏可能发生在任何程序和平台上,但由于活动生命周期的复杂性,这种情况在Android应用中尤其普遍。最新的Android模式,如ViewModel和Life......
  • 将正确答案,放到对应单选题的括号内,这个问题太考验职场人了!
    1职场实例小伙伴们大家好,今天我们来解决一个互助交流群内的一位群友提出的一个Excel职场需求:如何将正确答案,放到对应单选题的括号内。这个问题给小编的第一感觉就是“无从下手”,但是通过观察原始数据,小编发现还是规整且有规律的表格数据。Excel对“有规律的数据”基本上都能通过一......
  • 贪心算法--活动选择问题
    博客地址:https://www.cnblogs.com/zylyehuo/#-*-coding:utf-8-*-defactivity_selection(a):res=[a[0]]foriinrange(1,len(a)):ifa[i][0]>=res[-1][1]:#当前活动的开始时间小于等于最后一个入选活动的结束时间#不冲......