1/4
Java Programming 2014
Course Code: EBU4201
Mini Project
Task 1 [30 marks]
SmileyCount is a simple application used by children to practise their counting and adding skills (see Figure 1).
Figure 1 First launch with some input values entered
A random number of Smiley images ranging from 1 to 10 are displayed for each operand and the user is expected to enter the values of the two operands and the result of adding the two operands, in the given text fields. When the user clicks on the button ‘Check!’, one of two things can happen:
Case 1: all three input values are correct
i) the text changes to ‘"Correct! Have another go?"’. ii) the number of Smiley images displayed for each of the two operands changes. See Figure 2 for an example.
iii) the three text fields are reset (i.e. they are left empty). Case 2: at least one of the input values entered is incorrect i) the text changes to ‘Wrong! Try again!’. ii) the number of Smiley images displayed does NOT change. iii) the text fields do NOT change.
2/4
Figure 2 Action following Case 1
Implement SmileyCount as a Java application. You application must satisfy ALL the specific requirements given below:
a) The title of the top-level container must be ‘Welcome to SmileyCount!’.
b) The initial text should be ‘Enter two operands, result and click on 'Check!'’. See Figure 1.
c) The maximum number of Smiley images per row is FOUR. See Hint 1.
d) The text fields should be wide enough to display at least TWO characters.
e) The button ‘Check!’ must not resize when the GUI is resized. See Hint 2 and Figure 3.
f) The ‘plus sign’ icon should appear vertically centered between the two sets of smiley images and must not resize when the GUI is resized. See Hint 2 and Figure 3.
g) When first launched and whenever a correct answer is given, the number of displayed Smiley images for each operand should change to any number between 1 and 10 (inclusive). See Hint 3 and Hint 4.
Note: It is possible for the next number(s) to be the same as the current number(s).
h) Nothing should happen if the user clicks the ‘Check!’ button while at least one of the text fields are empty, i.e. no errors should be thrown in this case. Note: You can assume that only a numeric value will be entered into the text fields.
Hint 1: Use an array of JLabel components for the Smiley images. The following constructor may be helpful for the ‘plus sign’ icon.
public JLabel(Icon image)
A Smiley image and ‘plus sign’ image will be provided. You must use these images.
Hint 2: Consider using containers within other containers and using layouts intelligently.
Hint 3: Suggested approach for displaying images: look up the following method in the class javax.swing.JLabel.
public void setIcon(Icon icon)
Hint 4: Suggested approaches for displaying a variable number of images: classes java.util.Random OR java.lang.Math.
3/4
Note: All the necessary files should be placed in a directory called Task1.You can choose whether to place the image files directly under Task1 or within a sub-directory. Whichever approach you take, the images must be displayed on the GUI without the markers having to move the image files to different locations within your directory structure. Also note that your application must run as expected from the command line.
Figure 3 GUI Resized
Task 2 [10 marks]
You may notice that entering a non-numeric value and clicking the ‘Check!’ button will cause a run-time error on the console. Therefore, your second task is to improve the application developed in Task 1 to ensure the user is only allowed to supply valid input values, i.e. a number between 1 and 10 (inclusive). The application must still function as specified in Task 1 although you may remove the ‘Check!’ button if you wish.
Hint: Use another appropriate component in place of the text field.
Note: All the necessary files (including any reused ones from Task 1) should be placed in a directory called Task2.
4/4
Documentation [10 marks]
You must include:
a. Generated Javadocs
b. Internal comments in your code.
c. User Manual. This should be no more than 2 pages and include how to run the program (both how to start and how to use it).
Note: All documentation files should be placed in a directory called Documentation.
Extra Credit [5 marks]
Extra marks from this section can be used to top up your final grade for this project. Maximum mark is still 50.
Further improve your application such that the maximum number of Smiley images displayed for each operand can be any number between 10 and 20 (inclusive), specified as a command line argument. E.g. assuming your class is called SmileyCountExtra, the command
Java SmileyCountExtra 25
will launch a GUI similar to Figure 1 where the maximum number of Smiley images displayed per operand will be 25. Whenever a correct answer is entered, the number of Smiley images per operand will change to any number between 1 and 25 (inclusive). The maximum number of images per row must now be FIVE.
If no command line argument is given OR a number outside the valid range is given, the program must terminate printing out an appropriate error message to the console. You can assume only a numeric value will be given as the argument.
Note: All the necessary files (including any reused ones from Task 1 and Task 2) should be placed in a directory called ExtraCredit.
Important notes:
1. All three directories must be included in a zip file. The filename must be your QM Student Number.
2. You should design your classes properly, following object oriented principles. E.g. do NOT write everything in the main method, keep code repetition to a minimum (i.e. use methods), do NOT use static methods unless there is a good reason. There will be marks allocated to good design.
- 浏览: 1018971 次
文章分类
最新评论
-
18335864773:
很多公司项目 都在使用pageoffice 来操作word,e ...
用java生成word文档 -
Gozs_cs_dn:
请问下博主, 怎样将sitemesh3.xsd绑定 sitem ...
SiteMesh3配置 -
Rose_06:
springside4.0quick-start.bat报错原因 -
ilemma:
我也是刚参见工作啊,经理让自学这个,有些东西不太懂,能不能发个 ...
Apache Shiro在Web中的应用 -
shanbangyou:
你废了
程序员上班打酱油的方法
发表评论
-
递归归并排序
2016-02-11 20:26 355/* MergeSort.java CSC 225 - ... -
java冒泡排序对布尔类型进行排序
2015-12-11 23:06 649QQ 928900200 程序代写 java不能对 ... -
判断宏是否是“安全”的
2014-11-22 22:54 569给了一系列C++的宏定义,问你一个表达式是否是“安全”的。 ... -
C语言求平均值
2014-11-19 19:14 569木其工作室:QQ928900200 Computing I ... -
C语言连连看
2014-11-18 16:34 608(1)定义一个矩阵,随机产生字符布置地图,例如下面这个4x ... -
The Monty Hall Problem
2014-10-19 12:58 650GNG1106 Lab 3The Monty Hall Pro ... -
java类
2014-10-16 08:27 311木其工作室 qq 928900200 You are ... -
ECE/CPSC 3520
2014-10-13 09:49 551ECE/CPSC 3520Fall 2014Software ... -
计算机安全
2014-10-07 14:52 447CS461 MP 1: Due Wednesday 09/17 ... -
java星球机器人建模UML
2014-10-06 22:29 411Your task is to design and imp ... -
数据库sql
2014-10-06 22:25 625service QQ 928900200 ... -
C语言 cgi(3)
2014-08-04 09:17 3611cs3157 – Advanced ProgrammingS ... -
C语言 cgi(2)
2014-08-04 09:10 3131Columbia Universitycs3157 – Ad ... -
C语言cgi(1)
2014-08-04 09:08 3441Columbia Universitycs3157 – Ad ... -
c++ input,output
2014-08-04 08:37 485You should be comfortable w ... -
Array of Objects
2014-08-04 08:30 674You should be comfortable w ... -
bat脚本打开网页
2014-07-13 09:54 893start iexplore "http://ww ... -
java 汉诺塔实现自动演示
2014-07-10 11:53 5171、增加计时功能,显 ... -
代写java程序qq:928900200
2014-06-18 12:46 3学校为全面提升学校教学质量,提高管理水平,决定开发一套小型成 ... -
基于MVC的系统代写
2014-06-16 12:13 452人力资源管理系统 完成系统静态页面设计,页面数 ...
相关推荐
plc程序代写 代做 代编,plc程序设计,plc编程,西门 plc程序代写 代做 代编,plc程序设计,编程,西门子plc,三菱plc,台达plc,信捷plc,基恩士plc,变频器调试,变频器联动调试,485通讯,Modbus通信协议,微型...
plc程序代写 代做 代编,plc程序设计,plc编程,西门 plc程序代写 代做 代编,plc程序设计,编程,西门子plc,三菱plc,台达plc,信捷plc,基恩士plc,变频器调试,变频器联动调试,485通讯,Modbus通信协议,微型...
西门子1200plc程序实例,TCP IP及modbus通讯,版本V15,如有需要也可代写程序。 功能如下: 1,西门子1200控制4台步进电机; 2,西门子1200与4台MS300变频器modbus485轮询读写参数; 3,西门子1200与上位机TCP IP通讯...
为您提供最贴心的服务,小泽竭诚为您服务. 定制,代写都是十元起价,小泽保证在能力范围内,尽量为您提供最精良的代码. ------DreamDimension
松下FP-XHC60T中型程序框架:含触摸屏操作及轴定位功能,PLC通讯主从站设计,标准逻辑结构清晰,可代写PLC程序,松下FP-XHC60T 标准可带18轴中型程序,总共逻辑1万多步,含昆仑通态触摸屏程序(触摸屏附带配方功能,...
标题和描述中提到的文件是一份与Java程序设计相关的留学生作业资料。该作业主要涉及构建一个专门用于天体对象(Astronomical Objects,简称AOs)的索引式网络浏览器项目。以下是这份作业资料中所涉及的IT知识点: 1...
4. **JDBC**:Java数据库连接(JDBC)是Java访问数据库的标准API,虽然MyBatis等高级框架已经封装了JDBC,但理解JDBC基础对于数据库操作仍然至关重要。 5. **Servlet和JSP**:Servlet是Java Web服务器端编程的基础...
代写C程序 C++ Linux Unix 数据结构 操作系统
Qt结合C++技术实现截屏,在Qt5.4下实现编译通过,并实现截屏功能,如果对代码有不懂或者编译错误,请联系QFGL(代写软件:2120263292 )!
该程序例子为用户提供了如何有效利用SIWAREX FTC模块进行失重秤控制的参考。 首先,我们要理解SIWAREX FTC的核心功能。它是一个集成在SIMATIC自动化系统中的称重技术组件,能够提供高精度的重量测量和控制。FTC代表...
程序代开发,代写程序。 通讯配置,辅助测试。 信捷PLC无程序网络通讯实现。 常用功能一网打尽。 1.命令帧读写。 2.支持 I16 I32 Float 批量读写。 3.支持字符串读写。 4.支持XYMBool批量读写。 5.支持YM单点读写。 ...
程序代开发,代写程序。 通讯配置,辅助测试。 信捷PLC无程序网络通讯实现。 常用功能一网打尽。 1.命令帧读写。 2.支持 I16 I32 Float 批量读写。 3.支持字符串读写。 4.支持XYMBool批量读写。 5.支持YM单点读写。 ...
1. **Java编程**:Java是一种跨平台的面向对象的编程语言,适合开发大型分布式应用。在这个系统中,Java用于编写业务逻辑、控制层、数据访问层等模块,利用其强大的类库和面向对象特性来实现功能。 2. **Oracle...
此程序已经实际设备上批量应用,程序成熟可靠,借鉴价值高,程序简单几百步、有注释、非常适合用来三菱plc新手学习,包括三菱plc程序和触摸屏程序,用的三菱FX系列plc和步进电机,此程序为自己代写的纸厂非标设备...
代写个人述职报告.docx
程序代开发,代写程序。 通讯配置,辅助测试。 FX3U无程序网络通讯实现。 常用功能一网打尽。 1.命令帧读写。 2.支持 I16 I32 Float 批量读写。 3.支持字符串读写。 4.支持XYMBool批量读写。 5.支持YM单点读写。 ...
西门子S1200 PLC程序实例:步进电机控制、Modbus通讯变频器读写参数、TCP IP控制相机与多工位联动控制(附威纶通人机界面参考),西门子1200plc程序实例,TCP IP及modbus通讯,版本V15,如有需要也可代写程序。...
松下FP-XHC60T 标准可带18轴中型程序,总共逻辑1万多步,含昆仑通态触摸屏程序(触摸屏附带配方功能,以及产能统计:), 项目功能完整主站与两个从站采用PLC链接通讯,该程序为标准框架...(另外本人可以代写松下plc程序:)
MATLAB、Python程序修改、代写,深度学习,机器学习。 只需替数据即可,提高效率。 回归,分类,优化算法等,(lssvm、svm、rf、elm、bp、rbf、pnn、grnn、sae、dbn、dbn-elm、dbn-svm)等。 ,核心关键词:算法分类...