KXO151 Programming & Problem Solving
Page 1 of 9
KXO151 Programming & Problem Solving
AIEN-SOU - 2019
Assignment 2
Deadline for Submission: 10pm (Shanghai) Friday, Week 9, 26 April, 2019
Maximum Marks Available: 15 (15% of the total assessment for KXO151)
Submission: Via MyLO
NOTE: All assignments will be checked for plagiarism by a specialist Java program that checks
your assignment against other student’s assignments as well as the Internet (including help
sites). For more information see:
www.ics.heacademy.ac.uk/resources/assessment/plagiarism/demo_jplag.html
Assignment Type: Individual
Requirements:
PLEASE NOTE: This assignment is to be completed by Students individually. If you need help, please
look at the textbook or ask your lecturer. Students who have been working through the tutorial
exercises should not have much difficulty in completing this assignment.
PLEASE NOTE: The submitted Java code must be able to be compiled from the command line using
Javac the Java programming language compiler command, or from a basic editor such as jGrasp. Be
aware that development programs such as Eclipse often use features only available when run using
their system, meaning that their code may not run on a system without their development program.
Programs that do not run from the command line using javac (to compile) and java (to run) because
of a missing development program feature will fail the assignment.
You are required to perform the following tasks:
Write a Java application program named Asst2.java which correctly implements some calculations
associated with a calendar. The details (specifications) of this task are given below. Note that the
correctness marks you receive for your program will depend on how well it matches this
specification. If you decide to implement something that is more elaborate than specified, you
should understand that:
There will be no marks awarded for the elaborations you have designed and penalties may
be applied for confusing/extraneous code.
Your program MUST STILL meet the basic specifications given below.
Background Information
Consider a calendar - for example:
(Go to next page)
KXO151 - AIEN-SOU – Assignment 2 - 2019
Page 2 of 9
A calendar displayed like this has many interesting properties. One of them forms the basis for this
assignment.
If you take any four dates that form a square - for example:
or
It is possible to work out which dates are in the square from a single piece of information: the total
of the dates in the square. The formula for this (for a calendar laid out with 7 days to the week) is as
follows:
get the total of the dates
divide this number by 4 (if the addition has been done correctly, it will divide evenly)
subtract 4 from this answer - this gives the earliest date in the square (the upper left hand
corner)
add one to the earliest date to get the date in the upper right hand corner
add 7 to this to get the date in the lower left hand corner
add 8 to this to get the date in the lower right hand corner
Work through these examples to convince yourself that this works. You are to write a program that
invites the user to enter a total (worked out by them from a calendar), and tells them the four dates
that they added together.
Notice that since the earliest date in any month is 1 and the latest possible date is 31 - there will be
a smallest and a largest possible total - work out what these are. For this assignment, you may
assume that all months have 31 days.
Functionality Required
Explain (very briefly) to the user what they are to do.
Ask the user to enter the name of the month they are looking at. (There is no need to check
that what they enter is really the name of a month.)
Accept a total from the user (this will be an integer).
If the user enters a total that is too small or too big, tell them this and end the program. You
may assume here that all months have 31 days.
Otherwise:
o work out the abbreviation for the month
o work out the four dates they must have added together
o show the user the abbreviation of the month in UPPERCASE letters
KXO151 - AIEN-SOU – Assignment 2 - 2019
Page 3 of 9
o show the user the four dates they must have added together (each one on a new
line) and end the program.
NOTE: If the user enters "impossible" values then display the message of “That is outside
the range of possible numbers”.
A sample output of the program is attached to the end of this document.
Program Style
The program you write for this assignment must be a single class called Asst2 with the code in a file
called Asst2.java. There should be a single method (the main() method) in this class.
Your program should follow the coding conventions introduced in this unit and shown in the
textbook, especially:
Variable identifiers should start with a lower case letter
Final variable identifiers should be written all in upper case and should be declared before
all other variables
Every if-else statement should have a block of code for both the if part and the else part (if
used)
Every loop should have a block of code (if used)
The program should use final variables as much as possible
The keyword continue should not be used
The keyword break should only be used as part of a switch statement (if required)
Opening and closing braces of a block should be aligned
KXO151留学生作业代做、代写Via MyLO作业、代写Java实验作业
All code within a block should be aligned and indented 1 tab stop (approximately 4 spaces)
from the braces marking this block
Commenting:
There should be a block of header comment which includes at least
o file name
o your name (in pinyin)
o student UTas id number
o a statement of the purpose of the program
Each variable declaration should be commented.
There should be a comment identifying groups of statements that do various parts of the
task.
There should not be a comment stating what every (or nearly every) line of the code does -
as in:
num1 = num1 + 1; // add 1 to num1
Save the Output
Run your program entering data via the keyboard and save the output of your program to a text file
using your UTas student id number as the name of the file, for example, 159900.txt (in jGrasp, right
mouse-click in the ‘Run I/O’ window and select ‘Save As Text File’).
KXO151 - AIEN-SOU – Assignment 2 - 2019
Page 4 of 9
Important Notes:
Changing a few variable names, adding different data and / or adding your name to the top
of someone else’s code does not make it your own work. See the section on ‘Plagiarism’
below.
You need to submit 2 files: your Asst2.java
o a text file containing the output of your program using your UTas id number as the
name of the file, for example, 159900.txt.
o See the section on ‘Submission’ below for more information.
Before you submit your assignment through the KXO151 MyLO website, it is suggested that
you make sure the final version of your Java program file compiles and runs as expected –
do not change the names of the java file – submit it exactly as you last compiled and ran it.
Programs that do not compile and / or run will fail the assignment. If in doubt, you can
click on the submitted files, download them from MyLO, and check that they are the files
you think they should be.
NOTE: The higher marks are reserved for solutions that are highly distinguished from the rest and
show an understanding and ability to program using Java that is well above the average.
KXO151 - AIEN-SOU – Assignment 2 - 2019
Page 5 of 9
Guide to Assessment and Expectations:
The assessment of Assignment 2 is based on the following criteria:
Criteria High Distinction Distinction Credit Pass Fail
Working Java
Program
Fully working set of
Java classes that
satisfy the
requirements stated
in the assignment
requirements.
Fully working set of
Java classes that
satisfy the
requirements stated
in the assignment
requirements.
Fully working set of
Java classes that
satisfy the
requirements stated
in the assignment
requirements.
Fully working set of
Java classes that
satisfy the
requirements stated
in the assignment
requirements.
A set of Java classes
that fail to satisfy the
requirements stated
in the assignment
requirements & / or
fail to compile & / or
run
Documentation
Complete
documentation of all
significant & relevant
aspects of those
classes.
Reasonably complete
documentation of
significant & relevant
aspects of those
classes.
Good documentation
of significant &
relevant aspects of
those classes.
Some documentation
of significant &
relevant aspects of
those classes.
No documentation of
significant & relevant
aspects of those
classes.
Program
Correctness
Evidence of thorough
testing of the revised
& written classes.
Evidence of thorough
testing of the revised
& written classes.
Evidence of some
testing of the revised
& written classes.
Evidence of some
testing of the revised
& written classes.
No evidence of
testing of the revised
& written classes.
Understanding
of Java
Demonstrated clear
understanding of the
nature of Java classes,
of Java class methods,
of data variables, & of
the use of the main
method.
Demonstrated good
understanding of the
nature of Java classes,
of Java class methods,
of data variables, & of
the use of the main
method.
Demonstrated
reasonable
understanding of the
nature of Java classes,
of Java class methods,
of data variables, & of
the use of the main
method.
Demonstrated basic
understanding of the
nature of Java classes,
of Java class methods,
of data variables, & of
the use of the main
method.
Failure to
demonstrate
adequate
understanding of the
nature of Java classes,
of Java class methods,
of data variables, &
/or of the use of the
main method.
Note The High Distinction grade is reserved for solutions that fully meet the requirements & are highly distinguished from
other assignments by their high quality work & their attention to detail (usually only 10% of students).
PLEASE NOTE: The assignment will receive a single composite mark. The assignment will be
accessed from the point of view of the requirements: “Does it meet the requirements, and how well
does it do it?” Where there is some inconsistency in that the work does not completely match every
sub-criteria within a particular criteria, then the grade reflects the value of the work ‘on average’.
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
submitted by the deadline. Assignments must be submitted electronically via KXO151 MyLO
website as files that can be read by a text editor such as Microsoft Notepad (submit the *.java file -
not the *.class file). Follow the following steps to create a package for your assignment files and
then submit your package file:
1. On your computer desktop, create a new folder using your name and UTAS ID number. For
example, if you name is Jianwen CHEN and your UTAS ID number is 159900, then the new folder
must be named Chen_Jianwen_159900;
2. Copy your 2 assignment files into the new folder;
3. Use the WinRAR application to compress the new folder and name it as *.rar. For example,
Jianwen CHEN would name it as Chen_Jianwen_159900.rar.
4. Submit your *.rar file to the unit MyLO “Assignments” folder.
Details of the actual submission procedure are available through the MyLO webpages.
KXO151 - AIEN-SOU – Assignment 2 - 2019
Page 6 of 9
Students who believe that this method of submission is unsuitable given their personal
circumstances must make alternative arrangements with their Lecturer prior to the submission
date.
Extensions will only be granted under exceptional conditions, and must be requested with
adequate notice on the Request for Extension forms.
In submitting your assignment you are agreeing that you have read the ‘Plagiarism’ section below,
and that your assignment submission complies with the assignment requirement that it is your own
work.
KXO151 - AIEN-SOU – Assignment 2 - 2019
Page 7 of 9
Plagiarism
While students are encouraged to discuss the assignments in this unit and to engage in active
learning from each other, it is important that they are also aware of the University’s policy on
plagiarism. Plagiarism is taking and using someone else's thoughts, writings or inventions and
representing them as your own; for example downloading an essay wholly or in part from the
internet, copying another student’s work or using an author’s words or ideas without citing the
source.
It is important that you understand this statement on plagiarism. Should you require clarification
please see your unit coordinator or lecturer. Useful resources on academic integrity, including
what it is and how to maintain it, are also available at: www.academicintegrity.utas.edu.au/.
Acknowledgement
This assignment has been adapted from a programming project developed by Robyn Gibson. The assignment template was
written by Dr Dean Steer.
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's words without putting them in quotation marks and citing the source, using
an author's ideas without proper acknowledgment and citation or copying another
student’s work.
If you have any doubts about how to refer to the work of others in your assignments,
please consult your lecturer or tutor for relevant referencing guidelines, and the
academic integrity resources 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
punishable by penalties that may range from a fine or deduction/cancellation of marks
and, in the most serious of cases, to exclusion from a unit, a course or the University.
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 to submit assignments to plagiarism detection
software, and might then retain a copy of the assignment on its database for the
purpose of future plagiarism checking.
KXO151 - AIEN-SOU – Assignment 2 - 2019
Page 8 of 9
Sample Outputs of Assignment 2, 2019
Run 1 of the program (user input is bold)
I can read your mind!
Look at a calendar - choose any 4 dates that form a square
Enter the month you are looking at
january
Add up the dates and enter the total now
20
Here is the part of the calendar you were looking at
Run 2 of the program (user input is bold)
I can read your mind!
Look at a calendar - choose any 4 dates that form a square
Enter the month you are looking at
May
Add up the dates and enter the total now
52
Here is the part of the calendar you were looking at
Run 3 of the program (user input is bold)
I can read your mind!
Look at a calendar - choose any 4 dates that form a square
Enter the month you are looking at
xzcv
Add up the dates and enter the total now
5
That is outside the range of possible numbers
Run 4 of the program (user input is bold)
I can read your mind!
Look at a calendar - choose any 4 dates that form a square
Enter the month you are looking at
APRIL
Add up the dates and enter the total now
999
That is outside the range of possible numbers
KXO151 - AIEN-SOU – Assignment 2 - 2019
Page 9 of 9
Run 5 of the program (user input is bold)
I can read your mind!
Look at a calendar - choose any 4 dates that form a square
Enter the month you are looking at
a
Add up the dates and enter the total now
52
Here is the part of the calendar you were looking at
(The End)
因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com
微信:codinghelp
KXO151 Programming & Problem Solving的更多相关文章
- AST11103 Problem Solving
AST11103 Problem Solving with Programming SkillsAdditional Individual Assignment: Min-Game Programmi ...
- 【BZOJ1700】[Usaco2007 Jan]Problem Solving 解题 动态规划
[BZOJ1700][Usaco2007 Jan]Problem Solving 解题 Description 过去的日子里,农夫John的牛没有任何题目. 可是现在他们有题目,有很多的题目. 精确地 ...
- HDU-4972 A simple dynamic programming problem
http://acm.hdu.edu.cn/showproblem.php?pid=4972 ++和+1还是有区别的,不可大意. A simple dynamic programming proble ...
- hdu 4972 A simple dynamic programming problem(高效)
pid=4972" target="_blank" style="">题目链接:hdu 4972 A simple dynamic progra ...
- 学习笔记之Problem Solving with Algorithms and Data Structures using Python
Problem Solving with Algorithms and Data Structures using Python — Problem Solving with Algorithms a ...
- 【BZOJ】1700: [Usaco2007 Jan]Problem Solving 解题
[题意]给定n道题,每月末发放工资m,要求从1解到n,每道题需要在当月初付费ai,下月初付费bi,多道题可以安排在同月,求最少月数. [算法]DP [题解]参考自:[bzoj1700]Problem ...
- bzoj 1700 Problem Solving 解题 dp
[Usaco2007 Jan]Problem Solving 解题 Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 492 Solved: 288[Sub ...
- Autel MaxiSys Elite Diagnostic Tool Common problem solving methods
1. updating MaxiFlash Elite to firmware 3.21? My maxisys communicate with the MaxiFlash J2534 but Ma ...
- BZOJ 1700 [Usaco2007 Jan]Problem Solving 解题(单调DP)
[题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=1700 [题目大意] 共有p道题目要做,每个月收入只有n元,用于付钱做题之外的部分都会吃 ...
随机推荐
- gcc 8.2.1 / MCF thread 简介
gcc 8.2.1 下载 地址 https://gcc-mcf.lhmouse.com/ MCF threadhttps://github.lhmouse.com/ MCF thread 简介MCF ...
- greenplum加密
--如下为greenplum5.0数据库加解密--加密函数select encrypt('123456','aa','aes');--加解密函数select convert_from(decrypt( ...
- Object.freeze(); 方法冻结一个对象。
Object.freeze() 方法可以冻结一个对象.一个被冻结的对象再也不能被修改: 冻结了一个对象则不能向这个对象添加新的属性,不能删除已有属性,不能修改该对象已有属性的可枚举性.可配置性.可写性 ...
- java基础学习总结——面向对象1
目录 一.面向过程的思想和面向对象的思想 二.简单理解面向对象 三.面向对象的设计思想 四.对象和类的概念 五.如何抽象出一个类? 六.类(对象)之间的关系 七.Java与面向对象 八.为什么使用面向 ...
- 点击页面上的元素,页面删除removeChild()
简单描述:最近做了一个图片上传,上传完成回显图片的时候,需要用到点击图片,从页面删除的效果,然后就找到了removeChild()方法,说实话,我刚看到的时候,就觉得这个问题已经解决了,但是却发现这个 ...
- 怎么给PDF文件交换页面
在使用PDF文件的时候有文件页面的排版错误的时候,这个时候就需要交换页面了,那么怎么给PDF文件交换页面呢,在使用PDF文件的时候需要交换页面的时候要怎么做呢,下面小编就为大家分享一下PDF文件交换页 ...
- DO、DTO和VO分层设计的好处
2016年10月23日 20:11:03 阅读数:10646 在Java中 VO. PO.DO.DTO. BO. QO.DAO.POJO的概念中介绍过Java中的各种模型概念.在这里简单再总结一下 ...
- 微信小程序语音与讯飞语音识别接口(Java),Kronopath/SILKCodec,ffmpeg处理silk,pcm,wav转换
项目需求,需要使用讯飞的语音识别接口,将微信小程序上传的录音文件识别成文字返回 首先去讯飞开放平台中申请开通语音识别功能 在这里面下载sdk,然后解压,注意appid与sdk是关联的,appid在初始 ...
- python全栈开发day111-flask路由及其参数,Flask配置,蓝图,几个装饰器、闪现、send_file、jsonify
1.endpoint参数,解决视图函数重名问题(包括装饰后重名问题) http://www.cnblogs.com/eric-nirnava/p/endpoint.html 每个应用程序app都有一个 ...
- stm32位操作详解
stm32位操作详解 STM32位操作原理 思想:把一个比特分成32位,每位都分配一个地址,这样就有32个地址,通过地址直接访问. 位操作基础 位运算 位运算的运算分量只能是整型或字符型数据,位运算把 ...