日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Software Engineering 265

發布時間:2024/7/5 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Software Engineering 265 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

代做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)

?

因為專業,所以值得信賴。如有需要,請加QQ99515681 或郵箱:99515681@qq.com?

微信:codinghelp

轉載于:https://www.cnblogs.com/writejava/p/10028550.html

總結

以上是生活随笔為你收集整理的Software Engineering 265的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 青青草国产一区二区三区 | 新版红楼梦在线高清免费观看 | 国产一二三 | 女同一区二区三区 | 免费看日韩av | 国产精品图片 | 乳女教师の诱惑julia | av福利网 | 女人的天堂av | 黄色片日韩 | 女生扒开腿让男生操 | 好男人资源| xxxx精品| 伊人久久五月 | 日本三级日本三级日本三级极 | 日韩在线视频一区二区三区 | 免费在线播放视频 | 精品一区二区三区视频 | 亚洲国产福利视频 | 中文字幕一区二区人妻电影 | 亚洲免费三区 | 欧美大黄 | 涩涩网站在线看 | www男人天堂 | 亚洲欧美亚洲 | 久久永久免费视频 | 菲律宾av| 亚洲最大成人av | 我不卡一区二区 | 免费观看黄色一级片 | 伊人色综合久久久 | 天天干国产 | 欧美熟妇乱码在线一区 | 激情综合一区二区三区 | 深爱激情久久 | 日本免费一区二区三区四区 | 午夜精品福利一区二区蜜股av | 中文字幕乱码人妻一区二区三区 | 67194少妇| 国产理论片 | 日韩无码专区 | 成人免费入口 | a天堂资源在线观看 | 国产在线精品自拍 | 亚洲伦理自拍 | 99精品在线播放 | 伊人成人在线 | 青草久久久久 | 韩国三级bd高清中字2021 | 中日韩午夜理伦电影免费 | 国产免费99 | 国产a国产片国产 | 亚洲三级网站 | 韩国三级在线看 | 国产一区二区精品在线观看 | 五月婷婷综合激情网 | 日本体内she精高潮 男女视频在线免费观看 | 日批视频免费观看 | 日本一区二区精品 | av国产片 | 欧美xxxx视频 | 污视频在线观看免费 | 麻豆av剧情 | 国模视频在线 | 99久久国产热无码精品免费 | 久久男女视频 | 日本成人精品在线 | 欧美爱爱免费视频 | 草草影院在线观看视频 | 婷婷久久综合 | 日韩国产精品一区二区 | 少妇人妻好深好紧精品无码 | 少妇野外性xx老女人野外性xx | 性饥渴的农村熟妇 | 日韩精品一区二区三区不卡 | 欧美大片在线 | 丁香婷婷一区二区三区 | 激情播播网| 99re在线观看| 精品一区二区久久久久蜜桃 | 无码精品一区二区三区在线播放 | 免费在线观看黄视频 | 欧美日韩国产成人 | 国产青青草视频 | 午夜日韩在线 | 久草免费在线观看视频 | 亚洲一区人妻 | 久久麻豆精品 | 日本熟女毛茸茸 | 国产女合集 | 日本三级吃奶头添泬 | 天天狠天天插天天透 | 亚洲黄色小说网 | 你懂的在线免费观看 | 国产女人18毛片水真多18精品 | 国产一级大片在线观看 | 久久新 | 久久久久亚洲色欲AV无码网站 | 三叶草欧洲码在线 |