Page 1 of 9
KXO151 Programming &ProblemSolving
AIEN-SHOU- 2024
Assignment2
DeadlineforSubmission: 9PM(Shanghai)Wednesday,Week8,17 April2024
MaximumMarksAvailable: 15(15%ofthetotalassessmentforKXO151)
Submission: Via MyLO
NOTE: Allassignmentswillbecheckedforplagiarism by a specialist Java program that checks
your assignment against other student’s assignments as well as the Internet (including help
sites).
AssignmentType: Individual
Requirements:
PLEASENOTE: Thisassignment istobecompleted byStudentsindividually.If you need help, please
look at the textbook or ask your lecturer. Students who have been working through the tutorial
exercisesshouldnothave much difficulty in completingthisassignment.
PLEASENOTE: Thesubmitted Java codemustbeabletobecompiled from thecommand line using
Javac the Java programminglanguagecompiler command,orfrom a basic editor such asjGrasp.Be
aware that development programs such asEclipse oftenusefeaturesonlyavailablewhen run using
theirsystem,meaningthattheircode may notrunon a system without their development program.
Programs that donotrunfrom thecommand line using javac (to compile) and java (torun)because
of a missing development program feature will failthe assignment.
Youarerequiredto perform the following tasks:
Write a Java application program named Asst2.java which implements a simple 'Healthcheck'
program.Thedetails(specifications) ofthistaskaregivenbelow.Note that thecorrectness marks
youreceiveforyour programwilldependonhowwellitmatchesthisspecification.If you decideto
implement something that is more elaborate than specified, you should understand that:
• Therewillbe nomarksawardedfortheelaborationsyouhavedesignedandpenaltiesmay
beappliedforconfusing/extraneouscode.
• YourprogramMUSTSTILLmeet thebasic specifications given below.
Theprogramistoimplement asimple' Healthcheck’ program.Theuserwillbe askedfour questions
aboutthemselves:
• TheirWeight(inkilograms),(tobestoredinanintvariable).
• Systolicbloodpressure(inmmHg),(tobestoredinanintvariable).
• Diastolicbloodpressure(inmmHg),(tobestoredinanintvariable).
• Heartrate(inbeatsperminute),(tobestoredinanintvariable).
Theanswers to these questions will be used togeneratea'Healthcheck' for the user, this will be
displayedonthescreen.
Specifications oftheProgram
Page 2 of 9
Prompttheuserforthe4 pieces ofinformationaboutthemselves(seeabove)andstoretheanswers
intheprogram.Thereisnoneedtocheckwhethertheanswersarereasonable- thatis,iftheuser
enters1000fortheirage,500 fortheirsystolicordiastolicbloodpressure, -and10 fortheirheart
rate. The program will accept these values and continue. Do not ask the user for any other
information.
1. After receiving input from the user, the program should displaya summary of the health
metricsenteredbytheuser.
2. Theprogramshouldcategorize theuser's bloodpressurebased ontheenteredsystolicand
diastolicreadings.Bloodpressurecategories shouldinclude:
LowBlood Pressure (Hypotension):
Ifthesystolicbloodpressureis lessthan90mmHgAND thediastolicbloodpressureisless
than60mmHg,itindicateslowbloodpressure.
NormalBloodPressure:
Ifthesystolicbloodpressureis between 90and120mmHgAND the diastolic blood pressure
isbetween60and80mmHg,it indicates normal blood pressure.
ElevatedBloodPressure(HypertensionStage1):
Ifthesystolicbloodpressureisbetween120and129mmHgAND thediastolicbloodpressure
isbetween60 and 80 mmHg,it indicates elevated bloodpressure,which isthefirststageof
hypertension.
HighBloodPressure(HypertensionStage2):
Ifthesystolicbloodpressureis between 130 and 139 mmHgORthediastolicblood pressure
isbetween80and89mmHg,it indicates high bloodpressure,which isthesecond stageof
hypertension.
HypertensiveCrisis:
Ifthesystolicbloodpressureis140mmHgorhigherORthediastolicbloodpressureis90
mmHgorhigher,itindicatesahypertensivecrisis,requiringimmediatemedicalattention.
3. Theprogramshouldprovidefeedbackontheuser'sheartrate,consideringnormalresting
heartrateranges.
HeartRateLower ThanNormalRestingHeartRate:
Iftheheartrateislessthan60beatsperminute(bpm),itindicatesthattheheart rate is
lowerthanthenormalrestingheartrate.Thiscould beindicative ofbradycardiaorother
underlyinghealthconditions wheretheheart beatsslowerthanusual.
HeartRateHigherThan NormalRestingHeart Rate:
Iftheheartrateisgreaterthan100bpm, itindicatesthattheheart rate is higherthanthe
normalrestingheartrate.Thiscouldbeindicativeoftachycardiaorother underlying health
conditionswheretheheartbeatsfasterthanusual.
HeartRateWithinNormalRange:
Iftheheartratefallsbetween60and100bpm(inclusive),it indicatesthattheheart rate is
within the normal range fora restingheart rate. This range is generally considered normal
formost adults at rest.
4. Theprogramshouldasktheuseriftheywanttomonitortheirhealthagainafterdisplaying
thehealthmetricssummary,bloodpressurecategory,andheartratefeedback.Iftheuser
choosestomonitortheirhealthagain,theprocessshouldrepeat (thequestionswillthenbe
askedagain). Iftheuserchoosestodonotwanttomonitorthehealthagain,thenprogram
shouldshowamessagewithtotalnumberofhealthchecksdoneinthesession.
Asampleoutputoftheprogramisattachedtotheendofthisdocument.
Page 3 of 9
ProgramStyle
Theprogramyouwriteforthisassignment must beasingleclasscalledAsst2 withthecodeinafile
calledAsst2.java. Thereshouldbeasinglemethod(themain()method)inthisclass.
Your program should follow the coding conventions introduced in this unit and shown in the
textbook,especially:
• Variableidentifiersshouldstartwithalowercaseletter
• Finalvariableidentifiersshouldbewrittenallinupper case and shouldbedeclaredbefore
allothervariables
• Everyif-else statement should have a blockof code forboththeif part and the elsepart(if
used)
• Everyloopshouldhaveablockofcode (ifused)
• Theprogramshouldusefinalvariablesasmuchaspossible
• Thekeywordcontinue shouldnotbeused
• Thekeywordbreak shouldonlybeusedaspartofaswitchstatement (ifrequired)
• Openingandclosingbracesofablockshouldbealigned
• Allcodewithinablockshouldbealignedandindented1tabstop(approximately4spaces)
fromthebracesmarkingthisblock
Commenting:
• Thereshouldbeablock ofheadercommentwhichincludesatleast
o filename
o yourname (inpinyin)
o studentUTasidnumber
o astatementof thepurposeoftheprogram
• Eachvariabledeclarationshouldbecommented.
• Thereshouldbeacomment identifying groupsofstatementsthatdovariouspartsofthetask.
• Thereshouldnot beacomment statingwhatevery(ornearlyevery)lineofthecodedoes-
asin:
num1 = num1 + 1; // add 1 to num1
SavetheOutput
Runyourprogramenteringdataviathekeyboardandsavetheoutputofyourprogramtoatextfile
usingyourUTas studentidnumberasthenameofthefile,for example,159900.txt (injGrasp,right
mouse-clickinthe‘RunI/O’windowandselect‘SaveAsTextFile’).
ImportantNotes:
• Changingafewvariablenames,addingdifferentdataand/oraddingyournametothetop
ofsomeoneelse’scodedoesnotmake ityourownwork.Seethesectionon‘Plagiarism’below.
• Youneedtosubmit2 files:
o yourAsst2.java
o atextfilecontainingtheoutputofyourprogramusingyourUTasid numberasthe
nameofthefile,forexample,159900.txt.
o Seethesectionon‘Submission’below formoreinformation.
• BeforeyousubmityourassignmentthroughtheKXO151 MyLO website,itissuggestedthat
youmakesurethefinalversionofyourJavaprogramfilecompilesandrunsasexpected– do
Page 4 of 9
notchangethenames ofthejava file – submitit exactlyasyoulastcompiledandranit.
Programsthatdonotcompileand/orrunwillfailtheassignment.Ifindoubt,youcan
clickonthesubmittedfiles,downloadthemfromMyLO,andcheckthattheyarethefilesyou
thinktheyshouldbe.
NOTE: Thehighermarksarereservedforsolutionsthatarehighlydistinguishedfromtherestand
showanunderstandingandabilitytoprogramusingJavathatiswellabovetheaverage.
Page 5 of 9
Submission:
Your completed solution (your Asst2.java file, plus a text file containing the output of your
program using your UTas id number as the name of the file, for example, 159900.txt) must be
submittedbythedeadline.AssignmentsmustbesubmittedelectronicallyviaKXO151 MyLOwebsite
asfilesthatcanbereadbyatexteditorsuchasMicrosoftNotepad(submitthe*.javafile- notthe
*.classfile).Followthefollowingstepstocreateapackageforyourassignmentfilesandthensubmit
yourpackagefile:
1. On your computer desktop, create a new folder using your name and UTAS ID number. For
example,ifyounameisJianwenChenandyourUTASIDnumberis159900,thenthenewfoldermust
benamedJianwen_Chen_159900;
2.Copyyour2assignmentfilesintothenewfolder;
3.UsetheWinRARapplicationtocompressthenewfolderandnameitas*.rar.Forexample,Jianwen
ChenwouldnameitasJianwen_Chen_111222.rar.
4.Submityour*.rarfiletotheunitMyLO“Assignments”folder.
5. If WinRAR application is not available on your computer, try to use a similar application to
compressthenewfolderandnameitas*.zip,andthensubmitthe*.zipfile.
DetailsoftheactualsubmissionprocedureareavailablethroughtheMyLOwebpages.
Students who believe that this method of submission is unsuitable given their personal
circumstancesmustmakealternativearrangementswiththeirLecturerpriortothesubmissiondate.
Extensionswillonlybegrantedunderexceptionalconditions,andmustberequestedwithadequate
noticeontheRequestforExtensionforms.
Insubmittingyourassignmentyouareagreeingthatyouhavereadthe‘Plagiarism’sectionbelow,
andthatyourassignmentsubmissioncomplieswiththeassignmentrequirementthatitisyourown
work.
Page 6 of 9
Plagiarism
Whilestudentsareencouragedtodiscusstheassignmentsinthisunitandtoengageinactivelearning
fromeachother,itisimportant that theyarealsoawareof theUniversity’spolicyonplagiarism.
Plagiarism is taking and using someone else's thoughts, writings or inventions and representing
themasyourown;forexampledownloadinganessaywhollyorinpartfromtheinternet,copying
anotherstudent’sworkorusinganauthor’swordsorideaswithoutcitingthesource.
Itisimportant thatyouunderstand thisstatementonplagiarism.Shouldyourequireclarification
pleaseseeyourunitcoordinatororlecturer.Usefulresourcesonacademicintegrity,includingwhat
itisandhowtomaintainit,arealsoavailableat:www.academicintegrity.utas.edu.au/.
Acknowledgement
ThisassignmenthasbeenadaptedfromaprogrammingprojectdevelopedbyDrJulianDermoudy.The assignmenttemplate
waswrittenbyDrDeanSteer.BothauthorsaremembersofSchoolofEngineeringandICT,UniversityofTasmania,Australia.
Plagiarism is a form of cheating. It is taking and using someone else's thoughts,
writings or inventions and representing them as your own; for example, using an
author'swordswithoutputtingtheminquotationmarksandcitingthesource,using
an author'sideaswithout proper acknowledgment and citation or copying another
student’swork.
Ifyouhaveanydoubtsabouthowtorefertothe work of others in your assignments,
please consult your lecturer or tutor for relevant referencing guidelines, and the
academicintegrityresources on the web at:www.academicintegrity.utas.edu.au/.
The intentional copying of someone else’s work as one’s own is a serious offence
punishablebypenalties thatmayrangefromafineordeduction/cancellation ofmarks
and, in the mostserious of cases, to exclusion from a unit, a courseor theUniversity.
Details of penalties that can be imposed are available in the Ordinance of Student
Discipline – Part 3 Academic Misconduct, see:
www.utas.edu.au/universitycouncil/legislation/
The University reserves the right tosubmit assignments to plagiarismdetection
software,andmightthen retainacopyoftheassignmentonitsdatabaseforthe
purposeof future plagiarism checking.
Page 7 of 9
SampleOutputofAssignment2,2024
C:\KXO151>java Asst2
Welcome to Health Monitor!
Please enter your weight (Kg): 66
Please enter your systolic blood pressure (mmHg): 120
Please enter your diastolic blood pressure (mmHg): 80
Please enter your heart rate (bpm): 80
Health Metrics Summary:
Weight: 66 kg
Blood pressure: 120/80 mmHg
Heart Rate:80 bpm
Blood Pressure Category: Normal Blood Pressure
Heart Rate Feedback: Your heart is within the normal range.
Do you want to monitor your health again (y/n):
Welcome to Health Monitor!
Please enter your weight (Kg): 50
Please enter your systolic blood pressure (mmHg): 100
Please enter your diastolic blood pressure (mmHg): 60
Please enter your heart rate (bpm): 150
Health Metrics Summary:
Weight: 50 kg
Blood pressure: 100/60 mmHg
Heart Rate:150 bpm
Blood Pressure Category: Normal Blood Pressure
Heart Rate Feedback: Your heart is higher than normal resting heart
rate.
Do you want to monitor your health again (y/n):
Welcome to Health Monitor!
Please enter your weight (Kg): 100
Please enter your systolic blood pressure (mmHg): 150
Please enter your diastolic blood pressure (mmHg): 90
Please enter your heart rate (bpm): 150
Health Metrics Summary:
Weight: 100 kg
Blood pressure: 150/90 mmHg
Heart Rate:150 bpm
Blood Pressure Category: Hypertensive Crisis (Seek medical attention
immediately)
Heart Rate Feedback: Your heart is higher than normal resting heart
rate.
Do you want to monitor your health again (y/n): n
Thank you for using Health Monitor. I provided 3 Health check(s),
Goodbye!
Page 8 of 9
GuidetoAssessmentandExpectations:
TheassessmentofAssignment2isbasedonthefollowingcriteria:
Criteria HighDistinction Distinction Credit Pass Fail
Programming
Requirement
Excellent
programming ability
to correctly prompt
the user for inputs
and store them
appropriately. The
program employs a
loop structure to
repeatedly prompt
the user until they
choose to exit. The
program accurately
assesses and provide
theinformationasper
the requirements. It
accurately calculates
anddisplays the total
numberof timesuser
asks to run the
program during the
session.
Reasonable
programming ability
to correctly prompt
the user for inputs
and store them
appropriately. The
program employs a
loop structure to
repeatedly prompt
the user until they
choose to exit. The
program reasonably
assesses and provide
theinformationasper
the requirements. It
accurately calculates
anddisplays the total
numberof timesuser
asks to run the
program during the
session.
Good programming
ability to correctly
prompt the user for
inputsandstorethem
appropriately. The
program employs a
loop structure to
repeatedly prompt
the user until they
choose to exit. The
program assessesand
provide the
informationasperthe
requirements. It
calculates and
displays the total
numberof timesuser
asks to run the
program during the
session.
Some userinputs are
prompted or stored
incorrectly. Loop
structure is partially
implemented or
containsminorissues.
The program
accurately assesses
some of the
requirements and
provide the
informationasperthe
requirements. It
partially calculates
anddisplays the total
numberof timesuser
asks to run the
program during the
session.
User inputs are not
prompted or stored
correctly. Loop
structure is not
implemented or does
notfunctionproperly.
The information
assessment is
incorrect or
incomplete. Total
number of program
runsisnotcalculated
ordisplayed.
General
Requirement
Excellent evaluation
of the program's
organization and
visual presentation.
Assessment of
adherence to coding
standards such as
naming conventions,
use of constants, and
in-line comments.
Check if the program
includes the
necessary
information in its
header.
Reasonable
evaluation of the
program's
organization and
visual presentation.
Assessment of
adherence to coding
standards such as
naming conventions,
use of constants, and
in-line comments.
Check if the program
includes the
necessary
information in its
header.
Good evaluation of
the program's
organization and
visual presentation.
Assessment of
adherence to coding
standards such as
naming conventions,
use of constants, and
in-line comments.
Check if the program
includes the
necessary
information in its
header.
Some evaluation of
the program's
organization and
visual presentation.
Assessment of
adherence to coding
standards such as
naming conventions,
use of constants, and
in-line comments.
Check if the program
includes the
necessary
information in its
header.
No evaluation of the
program's
organization and
visual presentation.
Assessment of
adherence to coding
standards such as
naming conventions,
use of constants, and
in-line comments.
Check if the program
includes the
necessary
information in its
header.
Note TheHighDistinctiongradeisreserved forsolutions that fullymeet therequirements&arehighlydistinguished from
otherassignmentsbytheirhigh-qualitywork&theirattentiontodetail(usuallyonly10%ofstudents).
PLEASENOTE: Theassignmentwillreceiveasinglecompositemark.Theassignmentwillbeaccessed
fromthepointofviewoftherequirements:“Doesitmeettherequirements,andhowwelldoesitdo
it?”Wherethereissomeinconsistencyinthattheworkdoesnotcompletelymatcheverysub-criteria
withinaparticularcriteria,thenthegradereflectsthevalueofthework‘onaverage’.
KXO151 Assignment Two Marking Scheme (2024)
Student Name: UTAS ID:
Programming Requirements (for each item there are only 3 possible marks: 100% or 50% or 0%)
Requirement Item (Total 10 marks) Mark
Out of
PR1. Correctly obtain and store user inputs (weight, systolic blood pressure,
diastolic blood pressure, heart rate)
4
PR2. Correctly construct a loop structure 3
PR3. Correctly make the health monitor. 2
Page 9 of 9
PR4. Correctly calculate and display the total number of health checks when a
user chooses to exit.
1
General Requirements (for each item there are only 3 possible marks: 100% or 50% or 0%)
General Item (Total 5 marks) Mark
GR1. Program structure and layout
Clear and tidy (1). Somewhat messy but understandable (0.5). Messy (0)
2
GR2. Good compliance with programming conventions (naming convention,
proper use of constants, in-line comments, etc)
2
GR3. Include name, ID, and brief introduction in the program’s header 1
Assignment Raw Total: /15
Lateness Penalty:
Assignment Final: /15
UTAS lateness penalty policy:
“Assignments submitted after the deadline will receive a late penalty of 5% of the original available mark
for each calendar day (or part day) that the assignment is late. Late submissions will not be accepted more
than 10 calendar days after the due date, or after assignments have been returned to other students on a
scheduled date, whichever occurs first.”
版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:821613408 微信:horysk8 电子信箱:[email protected]
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。