代做Engineering 265作业、代写Python编程作业、代做Python作业、代做via Gitlab作业
Software Engineering 265
Software Development Methods
Fall 2018
Assignment 3
Due: Sunday, November 25th, 11:55 pm by submission via Gitlab
Due: Sunday, December 2nd, 11:55 pm by submission via Gitlab
(no late submissions accepted)
Programming environment
For this assignment you must ensure your work executes correctly on the Linux
machines in ELW B238 (i.e., these have Python 3 installed). You are free to do some
of your programming on your own computers; if you do this, give yourself a few
days before the due date to iron out any bugs in the Python script you have
uploaded to the lab machines.
Individual work
This assignment is to be completed by each individual student (i.e., no group work).
Naturally you will want to discuss aspects of the problem with fellow students, and
such discussion is encouraged. However, sharing of code fragments is strictly
forbidden without the express written permission of the course instructor. If
you are still unsure regarding what is permitted or have other questions about what
constitutes appropriate collaboration, please contact me as soon as possible. (Code—
similarity analysis tools may be used to examine submitted programs.)
Objectives of this assignment
Continue to learn features of the Python 3 language. (To enable this in your
environment when logged into the lab, type in the following command at the
start of your session at the shell prompt: setSENG265
Use some of the object—oriented features of Python 3.
Use some of the error—handling features of Python 3.
Use some of the regular—expression functionality in Python 3.
Use Gitlab to manage changes in your source code and annotate the
evolution of your solution with “messages” provided during commits.
Test your code against the ten provided test cases.
Be prepared to justify your script’s handling of errors for this assignment.
Page 2 of 5
This assignment: “sengfmt2.py” & “formatter.py” for object–oriented features
For this assignment you will be wrapping a solution to the formatting problem
into a class. The class constructor will be given either a filename or a list as a
parameter. The formatted output will be available from the class instance via the
“get_lines()” method.
The class must be named “Formatter” and appear in a file named
“formatter.py” which contains most of the methods you previously
developed in “sengfmt.py”.
The script that uses this class will be in a new file named “sengfmt2.py”.
(similar to driver.py but can handle fileinput, rather than a static long
string).
o If a non–blank filename is provided to the sengfmt2.py script, then
that file will be opened and its contents formatted.
o If no name is provided to the sengfmt2.py script, then the contents of
stdin will be formatted.
If the formatter.py object is used without being called from sengfmt2.py, and
no filename is provided to the constructor (i.e., None is passed as filename
argument), then the lines in the list provided as a parameter will be
formatted. Put differently, the Formatter constructor will accept (besides
“self”) a string and a list as parameters. Have a look at the code in
driver.py in the a3_files directory to find out how a list is passed to the
constructor in sengfmt2.py. (driver.py must therefore work with your
code!)
The formatting specifications from the second assignment are, for the most
part, to be used for this assignment. However, there are two small changes:
two “?mrgn” commands may appear right after each other in an input file;
and a file may have more than one “?maxwidth” command.
Here are the two new commands you need to implement in this assignment:
replace pattern1 pattern2: Each line following the command will be
formatted such that any matched sub-strings with the first argument
pattern1 will be replaced by the second argument pattern2. You need to
use the “re” module in Python 3 and complete the replacement before
applying any other formats. You can consider both pattern1 and
pattern2 can be generalized to formal regular expressions and they are
separated by a single white space.
Page 3 of 5
Example1:
Example2:
Input:
[
"maxwidth 24",
"mrgn 4",
"replace acknowledgment know",
"What must acknowledgment shall be"
]
Output:
[
" What must know",
" shall be"
]
Input:
[
"maxwidth 24",
"mrgn 4",
"replace What You",
"What must acknowledgment shall be"
]
Output:
[
" You must",
" acknowledgment ",
" shall be"
]
Page 4 of 5
monthabbr [off/on]: Each line following the command will be
formatted such that any recognizable date in the format of
“mm/dd/yyyy” or “mm-dd-yyyy” or “mm.dd.yyyy” (not a regular
expression, you need to create one) will be replaced with the new date
format “MMM. dd, yyyy” in which “MMM” stands for the month
abbreviation. You can import and use the calendar module to convert
the month number to month abbreviation. You can only focus on the
above three variants and ignore other date formats like “yyyy-mm-dd”.
You can show your concerns in the error handling file.
>>> import calendar
>>> month_number = 1
>>> print(calendar.month_abbr[month_number])
‘Jan’
Example3:
Note that if “?fmt” command is turned off, then all the formatting will NOT
apply.
You must now provide some error handling.
Your task is to enumerate the things that could go wrong when faced with
such a formatting task in a plain text file named “error_handling.txt”, and to
either provide or suggest the code for handling each error item.
The solution must be written in Python 3 and work correctly on the
workstations in the ELW B238 laboratory.
Input:
[
"maxwidth 24",
"mrgn 4",
"monthabbr on",
"I dropped the course on 12/07/2018"
]
Output:
[
" I dropped the course",
" on Dec. 07, 2018"
]
Page 5 of 5
% python3 ./sengfmt2.py /home/seng265/assign3/in11.txt > ./myout11.txt
% cat ~/seng265/assign3/in11.txt | python3 ./sengfmt2.py > ./myout11.txt
With your completed “sengfmt2.py” script, the input would be transformed into the
output (here redirected to a file) via one of the two following UNIX commands:
where the file “myout11.txt” would be placed in your current directory.
Exercises for this assignment
1. Within your Gitlab project create an “A3” subdirectory. Use the test files in
a3_files.zip. (Files in01.txt through to in20.txt are based on those from the
second assignment, but letters with diacritics have been transliterated into
two separate characters.) Your “sengfmt2.py” and “formatter.py” script files
must appear here. Ensure the subdirectory and files are added to Gitlab
version control.
2. Reasonable run—time performance of your script is expected. None of the test
cases should take longer than 15 seconds to complete on a machine in ELW
B238.
What you must submit
Python 3 files named “sengfmt2.py” and “formatter.py” within your
subversion repository (i.e., containing a solution to Assignment #3).
A text file named “error_handling.txt” which enumerates the errors that are
addressed by your submission.
Evaluation
Our grading scheme is relatively simple.
Requirement Marks
File “sengfmt2.py” and “formatter.py” runs without errors. 2
The program is clearly written and uses functions appropriately
(i.e., is well structured).
3
Errors have been enumerated and are either suitably handled or a
sensible response strategy has been suggested.
3
Program can handle both stdin and file inputs. 2
Code passes the first set of test cases for multiple “?mrgn” (1 to 3) Bonus
+1
Code passes the second set of test cases for multiple “?maxwidth”
(4 to 6)
Bonus
+1
Code passes the third set of test cases for “replace” (7) 5
Code passes the second set of test cases for “replace” combined
with “mrgn” and “?maxwidth” (8)
Bonus
+1http://www.daixie0.com/contents/3/2142.html
Page 6 of 5
Code passes the third set of test cases for “monthabbr”(9) 5
Code passes the second set of test cases for “monthabbr”
combined with “?mrgn” and “?maxwidth” (10)
Bonus
+1
Total 20
+ (4)

因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com

微信:codinghelp

转载于:https://www.cnblogs.com/writejava/p/10028550.html

Software Engineering 265相关推荐

  1. Software Engineering at Google

    Google的Fergus Henderson在Software Engineering at Google中介绍了Google的软件工程实践. 软件开发 源码仓库 单一源代码仓库,除了核心配置和安全 ...

  2. 加州大学欧文计算机工程硕士,UCI加州大学尔湾分校软件工程硕士Master of Software Engineering...

    软件工程硕士Master of Software Engineering是加州大学尔湾分校研究生申请的热门专业,下面由美英港新教育重点介绍软件工程硕士研究生的课程设置.培养目标.申请要求及学费. 培养 ...

  3. SoftWare Engineering -- WEEK.3

    SoftWare Engineering – WEEK.3 2022.3.18 @Raoquan WEEK.3 List 0. Coursework some details 1. Requireme ...

  4. Software Engineering at Google翻译-III-11-Testing overview(测试概述)

    参考: https://github.com/daizhenhong/swe-at-google/blob/main/Part_III_Processes/total/Chapter-11-total ...

  5. 软件工程(Software Engineering)

    软件工程(Software Engineering) GTI-分布式版本控制系统 查看已有的git配置信息 DVOS运维一体化 单分支模型 exit git --version git clone u ...

  6. Something about Software Engineering

    文章目录 软件工程 定义 Definition 软件危机 Software Crisis 软件生命周期 软件工程知识体系 SWEBoK(Software Engineering Body of Kno ...

  7. 【北邮国院大三下】Software Engineering 软件工程 Week1

    北邮国院大三电商在读,随课程进行整理知识点.仅整理PPT中相对重要的知识点,内容驳杂并不做期末突击复习用.个人认为相对不重要的细小的知识点不列在其中.如有错误请指出.转载请注明出处,祝您学习愉快. 编 ...

  8. 论文阅读:Empirical software engineering experts on the use of students and professionals in experiments

    题目:Empirical software engineering experts on the use of students and professionals in experiments ES ...

  9. 个人阅读作业2—《No Silver Bullet: Essence and Accidents of Software Engineering》读后感

    在进行了一次结对编程.一次团队编程和一次个人编程项目后,读了<No Silver Bullet: Essence and Accidents of Software Engineering> ...

最新文章

  1. Semtech与Lacuna从太空接收信息
  2. 2021年春季学期-信号与系统-第十四次作业参考答案
  3. python新手项目-Python 的练手项目有哪些值得推荐?
  4. python零基础怎么学-零基础如何入门Python
  5. Python股票分析系列——基础股票数据操作(二).p4
  6. 打开程序时固定位置_新手入门第五课:免费开源图像处理程序GIMP之矩形选择工具...
  7. SVG 动画实现弹性的页面元素效果
  8. Go Web 编程--应用 ORM
  9. 输入法快捷键_[秒杀必备]搜狗输入法自定义短语快捷键设置
  10. CyclicBarrier底层实现和原理
  11. wav格式的音频文件 16位转化成8位的
  12. 【Python】利用Python拟合函数曲线
  13. BLP读书摘录和笔记——make
  14. python3 模拟键盘_python3 模拟鼠标和键盘操作
  15. win7/win10系统防火墙禁止单个应用联网步骤
  16. 两台笔记本一台连接不上wifi
  17. 2015关于第十一届蓝狐网络杯湖南省大学生计算机程序设计竞赛的总结
  18. 一加nfc门禁卡录入_一加7T手机如何开启NFC、复制门禁卡等功能
  19. Java代码实现点赞功能
  20. JS将对象转为字符串

热门文章

  1. 如何用视频云技术,搞一个爆红的 “反应视频” 项目?
  2. 探秘RocketMQ源码——Series1:Producer视角看事务消息
  3. 逸仙电商Seata企业级落地实践
  4. Java如何支持函数式编程?
  5. 如何写出让同事好维护的代码?
  6. 程序员:你真的该养生了
  7. Flashback Data Archive(转)
  8. 连号区间数(2013年第四届c/c++ b组第10题)
  9. 微信小程序家庭记账本开发进度二
  10. Swift5.1 语言指南(一) 关于Swift