首页 > 编程语言 >EBU4201 Introductory Java Programming 2023/24Mini Project(⼉童练习乘法表 下个文章发布源码)

EBU4201 Introductory Java Programming 2023/24Mini Project(⼉童练习乘法表 下个文章发布源码)

时间:2024-05-27 17:30:56浏览次数:14  
标签:files Task Java should Note 源码 乘法表 your must

Task 1 [25 marks]

SuperHeroTT is a simple Graphical User Interface (GUI) application for children where they can practise their times tables (see Figure 1).

When launched, your app should look like Figure 1 - First launch of SuperHeroTT. The drop-down box at the top should consist of numbers from 1-12 (inclusive). The superhero image (superhero.jpg1 ) has been provided to you. The flow of the program is as follows: 1) User selects a number from the drop-down list and clicks on the Start button. 2) The label Product is replaced by a product of the form x * n where x is the selected value from the drop-down list and n is a random number in the range 1-12 (inclusive) AND the Start button text is changed to Next. 3) User enters their answer for the product and clicks on Next. 4) If the answer is correct, Answer is replaced by Correct; otherwise Answer is replaced by Wrong! x * n = y where y is the correct answer. See Figure 2. 5) Regardless of the answer being right or wrong, a new product should appear AND the answer box (i.e. text-field) should be cleared. 6) At the end of a round, i.e. after 5 product questions, the label Rating should be replaced by You got m correct! where m is the number of correct responses AND the Next button should change back to Start. 7) The above process can be repeated any number of times. Note 1: If the user wishes, they can change their selection from the drop-down list during a round. Note 2: If the user clicks Next with no text entered, there must be no run-time exceptions generated AND the product question must not change to the next one. Note 3: The button or image must not resize when the GUI is resized.
Hint: Consider using containers within containers and using layouts intelligently. 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 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 on OpenJDK 21.0.2 without the markers having to alter any code, file locations etc. Otherwise, it will not be possible to award marks for any of the functionalities.
Task 2 [15 marks]

Your second task is to enhance the application developed in Task 1, to allow the user to select more than one multiplicand, i.e. x (of the product x * n) at the same time. The application must still function as specified in Task 1, the only difference being that x will be one of the selected numbers, chosen randomly, during each of the 5 questions that make up a round. For example, say the user selected the following multiplicands: 2, 5, 6 and 12. The set of product questions can be: 5 *12 6 * 11 2 * 1 12 * 4 2 * 10 Note 1: It is possible that not all selected multiplicands will appear in a given round. Note 2: The program must ensure that the users select at least one multiplicand. There is no maximum limit so users can select any number of multiplicands (up to 12). Hint 1: Use another appropriate component in place of the drop-down list that was used in Task 1. Note: All the necessary files (including any reused ones from Task 1) should be placed in a directory called Task2Documentation [10 marks] Your submitted work must include: a. Generated Javadocs (for all Java files) b. Internal comments in your code (for all Java files) c. User Manual. This should be no more than 2 pages and describe, in your own words, 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. The maximum mark you can achieve is still 50. Further enhance your application in the following two ways: a) Include a timer, i.e. at the end of a round, replace Answer with You took t seconds where t is the time taken to complete the round, in seconds. See an illustrative example in Figure 3Hint: You are provided with the Java code (TimerDemo.java) for a simple timer using javax.swing.Timer. Make use of this code in your program. Note: if you wish you can visually display a countdown on your GUI. Alternatively you can simply print out to the console, similar to TimerDemo.java. b) Set the answer box (i.e. text-field) in focus every time the user is expected to type an answer so that they do not need to click on the answer box. Hint: look up methods of the text-field (e.g. JTextField) class in the Java API. 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. This is an individual piece of work. 2. All three directories must be included in a zip file. The filename must be your QM Student Number. 3. 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 for good program design

标签:files,Task,Java,should,Note,源码,乘法表,your,must
From: https://blog.csdn.net/weixin_54749748/article/details/139243140

相关文章

  • JAVA面试中,面试官最爱问的问题。
     请用wait-notify写一段代码来解决生产者-消费者问题。生产者-消费者问题是一个经典的并发问题,它描述的是两类并发操作的问题:生产者将数据放入缓冲区,消费者从缓冲区取出数据。使用wait()和notify()方法可以在Java中实现这个问题的解决方案。以下是一个简单的示例,其中包含一......
  • JAVA面试中,面试官最爱问的问题。
    Java中的final关键字有什么作用?在Java中,final关键字具有多种用途,它可以被应用于类、方法和变量。以下是final关键字的具体作用:修饰变量:当final用于修饰一个变量时,意味着这个变量只能被赋值一次,即它是一个常量。对于基本数据类型,final使变量的值不可变;对于引用类型,final使......
  • java面试,面试官最爱问的问题。
    什么是Java中的多线程?如何实现多线程?Java中的多线程:在Java中,多线程指的是同时执行多个线程以完成不同的任务。线程是程序执行流的最小单元,一个进程可以包含多个线程,这些线程共享进程的内存空间和资源,它们可以并发或并行地执行任务,从而提高程序的执行效率和响应速度。如何实......
  • JAVA面试中,面试官最爱问的问题。
    什么是不可变对象?Java中如何创建一个不可变对象?不可变对象(ImmutableObject)是一种在创建之后其状态就不能被修改的对象。这意味着一旦不可变对象被创建,它的所有字段的值都不能再被改变。不可变对象在多线程环境下是线程安全的,因为它们的状态不会因并发访问而改变。在Java中,要......
  • java list分组并对bigdecimal属性求和
    JavaList分组并对BigDecimal属性求和在Java中,我们经常需要对一个List进行分组,并对其中的BigDecimal属性进行求和操作。这种需求在实际项目中非常常见,比如在处理财务数据、统计数据等场景中。本文将介绍如何使用Java来实现这一功能,同时会提供代码示例来帮助读者更好地理解。1.使......
  • 基于SpringBoot的酒店订房系统-82159(免费领源码+数据库)可做计算机毕业设计JAVA、PHP、
    springboot酒店订房系统摘 要随着科学技术的飞速发展,社会的方方面面、各行各业都在努力与现代的先进技术接轨,通过科技手段来提高自身的优势,酒店订房系统当然也不能排除在外。酒店订房系统是以实际运用为开发背景,运用软件工程开发方法,采用springboot技术构建的一个管理系统......
  • 公司刚入职了一名 Java 中级开发,短短 4 行代码居然凑齐了 3 个 bug!我哭了~~
    作者:l拉不拉米链接:https://juejin.cn/post/7031445206152577061一、前言公司刚入职了一名中级Java开发,经过一个星期的适应学习,各方面表现还不错,于是分配了一个小的迭代给新人做。需求很简单,把从第三方拉取的数据匹配到自身公司后台设置的渠道后,聚合到一个列表中,批量入库。然......
  • 【Java】短 URL 生成器设计:百亿短 URL 怎样做到无冲突?
    一、问题解析在社交媒体上,人们经常需要分享一些URL,但是有些URL可能会很长,比如:https://geek.qq.org/hybrid/pvip?utm_source=geek-pc-discover-banner&utm_term=geek-pc-discover-banner这样长的URL显然体验并不友好。我们期望分享的是一些更短、更易于阅读的短URL,比如像http......
  • 在JavaScript中如何移除数组中的特定项
    在日常开发中,我们经常需要从数组中移除某个特定的元素。在JavaScript中,存在多种不同的方法来完成这一任务,本文将总结几种常见的处理方式,并介绍它们的优缺点。常规情况1.使用.splice()方法按值移除数组元素是否修改原数组:是是否移除重复项:是(使用循环),否(使用i......
  • 代码雨(coderain)源码(html5+css3+javascript,原创)
     大家看过黑客帝国的代码雨吗?本人自己写了一个,效果还可以。演示效果请见https://www.lanbaoshi.site/coderain.htm下面上代码:<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="htt......