首页 > > 详细

讲解 data程序、辅导 Java,c/c++编程

Scripting Languages
Assignment 2.1: Portfolio 1
ASSIGNMENT BRIEF
Important points before you begin:
• Read this brief very carefully in full, and at the earliest opportunity
• If any of this brief’s stipulations are unclear to you, it is your responsibility to seek timely clarification
from the lecturer/unit coordinator well before the assessment’s due date
• Be aware that if you misinterpret this assignment brief, either in part or in full, this misinterpretation
will not be accepted as grounds for an appeal of the result you receive
Overview
In this assignment you will be required to write a script that demonstrates the extent to which you have
understood the shell script (bash) commands, programmatic techniques and concepts addressed in Modules
1 to 5 inclusive. This assignment is worth 20% (20 marks) of your unit grade and its completion will help you
build a subset of the skills you will require to successfully complete Portfolio 2 and Assignment 3.
Your Academic Integrity Obligations
Your tutor, lecturer, and unit coordinator all take Academic Integrity very seriously and it cannot be stressed
strongly enough how important it is that you fully understand your academic integrity obligations as a
student of the University. In regard to all of this unit's assessments, all suspected instances of academic
misconduct will be reported for investigation, which may result in substantial academic penalties for those
concerned. If you are unfamiliar with the University's Academic Integrity Policy as it applies to all
assignments you submit for this unit, you can familiarise yourself with it here. If you are unsure of anything,
please contact the Unit Coordinator for clarification before submitting this assessment.
AI Tool Utilisation
Whereas AI tools can serve as a very useful tool in the software engineering workplace, they are not to be
used to complete any of the assessments in this unit, either in-part or in totality. This is because the focus of
this unit is the development of authentic knowledge of, and skill in applying, various scripting languages to
achieve specific outcomes, and not the use of AI tools to act on a programmer's behalf. This acquisition of
authentic knowledge extends beyond the outcomes of this unit and is important to a student’s future ability
to be successful in obtaining a Work Integrated Learning placement, and ultimately, a job in industry.
Employers already use AI tools extensively and know what they can and cannot do – they see no value in
hiring graduates whose demonstrable skills do not exceed that of existing AI tools. Additionally, students
suspected of representing AI output as their own work may be called upon to demonstrate functional
knowledge of this work, which, if not forthcoming, may in turn lead to allegations of academic misconduct.
Please read the checklist below and watch the associated video before submitting this assignment.
Page 2 of 6
General Assignment Requirements
▪ Your script will be run/assessed in the Azure Linux VM provided at the beginning of semester. It is
expected that you will develop and test your script in this Azure environment to ensure full
compatibility.
▪ Your script must be a bash script and nothing else, i.e. the shebang line used is #!/bin/bash.
Scripts of any other type, e.g. #!/bin/sh will receive a grade of zero (0).
▪ Ensure the script you write is fully self-contained and is not configured to be dependent on external
files, libraries or resources to run. Non-observance of this requirement may cause your script to run
incorrectly or not at all.
▪ Carefully check your submission before uploading it to Canvas. What you submit is what gets
assessed! If you make a submission error, e.g. submit a wrong file, an empty .zip archive etc, no
further/subsequent submissions will be accepted, which may result in a substantial loss of marks, or
even a zero (0) result in some cases.
▪ You must only submit a single shell script (.sh) file named parsechars.sh contained within a .zip file
with the stipulated name in any individual upload action. Do not upload multiple files/zip archives in
the same upload action as all will be considered invalid and will not be assessed. Also note that only
the most recent individual submission made (as determined by the timestamp Canvas allocates) will
be assessed.
▪ If your script does not run for any reason, e.g. hard-coding of files/directories/paths, use of a
development environment not compatible with the Azure Linux VM provided at the beginning of
semester, only a partial mark may be awarded on a code-readthrough basis at the assessor’s
discretion. Your assessor will not fix non-functional, dysfunctional or incompatible scripts.
Page 3 of 6
Task – Parse Characters (20 marks)
Write a bash script that processes a list of strings contained in an external text file, and for each string in the
list, parses out characters that are allowed characters from those characters that are disallowed, printing a
report to the screen of total [T], allowed [A] and disallowed [D] characters found, and their counts.
Only the following characters are allowed:
• Uppercase vowels
• Even numbers within the range 0-9
• The following subset of special characters:
&#!$-
All other characters are disallowed.
Task Constraints
• You may only use commands, utilities and programmatic techniques addressed in Lectures 1-5
inclusive
• Ensure your script includes appropriate use of:
o IFS management when reading external files
o BRE and/or ERE to classify each string’s individual characters correctly
o The cut command to isolate each string’s individual characters for regex matching
o Indexed arrays to store sorted characters for final display to the terminal
o Loop structures to handle user input and external file processing
o Control structures for decision-making, i.e. if-else statements
o Command flags as required
o Piping as required
o Command substitution as required
Required Script Functionality
▪ When your script is run, it is to prompt the user for the name of a file in their current working
directory.
▪ If the file name provided does not exist in the user’s current working directory, or if it does exist but
contains no data (is empty), the user is to be accurate informed of what the error is and then reprompted for a valid file that contains data. The re-prompting process must not involve the script
terminating then restarting.
▪ If the file name entered by the user does exist and does contain data, your script is to process each
of the strings it contains and parse out its allowed and disallowed characters, with the results
reported to the screen precisely as shown in the screenshot below.
▪ Also ensure the user can exit the script at the prompt if they wish to by entering -q
Page 4 of 6
Example Output
Please note: Not all of the script’s required functionality is demonstrated in the screenshot below.

Page 5 of 6
Other Compulsory Requirements
▪ Call the script parsechars.sh.
▪ Your full name and student number must be placed at the top of your script (as comments)
immediately after the shebang line.
▪ Immediately after your name and student number, provide an explanation of no more than 220
words that articulates your thinking in regard to how you approached the design and construction of
your script to solve for the stipulated task. Be sure to provide a rationale for the way in which you
have utilised the commands, utilities and programmatic techniques your script employs, and the role
each serves in the context of the script’s overall functionality. This statement is of course to take the
form of comments. Please split the statement over multiple lines for easy readability. [IMPORTANT
NOTE: AI-generated explanations will receive a mark of zero (0) in this part of the rubric]
▪ To construct your script, use a carefully considered combination of commands, utilities and
programmatic techniques sourced from Lectures 1-5 inclusive) including those listed in the Task
Constraints section above. Do not use bash/shell script commands, utilities and programmatic
techniques not addressed in Lectures 1-5 inclusive as this will result in a lower mark (see rubric for
details).
▪ Your script must contain concise ‘in-situ’ comments that accurately explain all of the code elements
it contains in your own words. Note: Comments that are not relevant and accurate in regard to the
code they describe, or a complete lack of comments, will not only attract a lower marks, but may be
viewed as suggestive of possible academic misconduct. [IMPORTANT NOTE: AI-generated comments
will receive a mark of zero (0) in this section of the rubric]
▪ Any temporary files and/or folders created by your script in the course of its execution must be
programmatically removed from the assessor’s system when the script terminates.
▪ The efficiency and correctness with which the commands, utilities and programmatic techniques
within your script have been utilised will also form part of your mark, so please pay close attention
to this aspect of your code as well. For example, your parsechars.sh script is expected to make use of
appropriately selected and correctly applied commands/options, including everything listed in the
Task Constraints section above. The total lines-of-code your script employs will also be considered,
with deductions applicable should this significantly exceed the total deemed necessary to achieve
the stipulated outcomes.
▪ To assist you in the development and testing of your script, you have been provided with three (3)
test files named rpl1.txt, rpl2.txt, and rpl3.txt, each of which contains a list of random strings of
varying lengths and character combinations. Important Note: Your assessor will not use any of these
test files for the marking process so do not hard code any of them into your script. Your assessor will
use a different set of test files (.txt) files, that have different names and that contain different lists of
random strings. Also note that the space character may also be present in the strings your assessor
uses, which need to be treated just like any other character, so make sure your bash script allows for
this.
ASSESSMENT RUBRIC
Go to Assignment 2.1: Portfolio 1 on Canvas to see the applicable rubric for this assessment
Page 6 of 6
How to submit your portfolio to Canvas
Submit a single shell script (.sh) file named parsechars.sh contained within a .zip archive to Canvas with the
following naming format (use your surname/student number):
[surname]_[student-ID]_CSI6203_PF1.zip
Do not submit any files other than that stipulated above. Further, even though there is no restriction on how
many times you make individual submissions (each of which gets its own unique timestamp in Canvas), do
not upload multiple files/zip archives in the same upload action as all will be considered invalid and not be
marked.
END OF ASSIGNMENT BRIEF

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!