1. Homepage
  2. Programming
  3. EBU4201 Introductory Java Programming - Mini Project 2023: SumItUp

EBU4201 Introductory Java Programming - Mini Project 2023: SumItUp

Engage in a Conversation
UKQMULQueen MaryEBU4201Introductory Java ProgrammingSumItUpJava

EBU4201 Introductory Java Programming 2022/23 CourseNana.COM

Mini Project CourseNana.COM

Task 1 [30 marks] CourseNana.COM

SumItUp is a simple application for children where they can practise their counting and adding skills (see Figure 1). CourseNana.COM

Figure 1 First launch with some input values entered CourseNana.COM

A random number of Rabbit 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: CourseNana.COM

Case 1: all three input values are correct i) the text changes to ‘"Correct! Have another go?" ’. ii) the number of Rabbit 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 made empty). CourseNana.COM

2/5 Case 2: at least one of the input values entered is incorrect i) the text changes to ‘Wrong! Try again!’. ii) the num ber of Rabbit images displayed does NOT change. iii) the text fields do NOT change. CourseNana.COM

Figure 2 Action following Case 1 Implement SumItUp 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 SumItUp !’. b) The initial text should be ‘Enter two operands, result and click on 'Check!'’. See Figure 1. c) There should be no more than 4 Rabbit images per row . 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 set s of Rabbit 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, th e number of displayed Rabbit 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. CourseNana.COM

3/5 CourseNana.COM

Hint 1: Use a n array of JLabel components for the Rabbit images. The following constructor may be helpful for the ‘plus sign’ icon. CourseNana.COM

public JLabel(Icon image) CourseNana.COM

A Rabbit image and ‘plus sign’ image are provided. You must use these images. CourseNana.COM

Hint 2: Consider using containers within other containers and using layouts intelligently. CourseNana.COM

Hint 3: Suggested approach for displaying images: l ook up the following method in the class javax.swing.JLabel . CourseNana.COM

public void setIcon(Icon icon) CourseNana.COM

Hint 4: Suggested a pproaches for displaying a variable number of images: classes java.util.Random OR java.lang.Math. CourseNana.COM

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 structu re. Also note that your application must run as expected from the command line on OpenJDK 19.0.2. CourseNana.COM

Figure 3 GUI Resized CourseNana.COM

Task 2 [10 marks] CourseNana.COM

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 i nput values, i.e. a CourseNana.COM

4/5 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. CourseNana.COM

Hint: Use another appropriate component in place of the text field. CourseNana.COM

Note: All the necessary files (including any reused ones from Task 1) should be placed in a directory called Task2. CourseNana.COM

Documentation [10 marks] CourseNana.COM

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). CourseNana.COM

Note: All documentation files should be placed in a directory called Documentation . CourseNana.COM

Extra Credit [5 marks] CourseNana.COM

Extra marks from this section can be used to top up y our final grade for this project. Maximum mark is still 50. CourseNana.COM

Further improve your application such that the maximum number of Rabbit images displayed for each operand can be any number between 10 and MAX (inclusive), specified as a command line argument. E.g. assuming your class is called SumItUpExtra , the command CourseNana.COM

Java SumItUpExtra 20 will launch a GUI similar to Figure 1 where the maximum number of Rabbit images displayed per operand will be 2 0. Whenever a correct answer is entered, the number of Rabbit images per operand will change to any number between 1 a nd 20 (inclusive). There should be no more than 5 Rabbit images per row. CourseNana.COM

MAX must be calculated as follows. If the last digit of your QM student number is 0 -4, MAX = 20 If the last digit of your QM student number is 5 -9, MAX = 25 CourseNana.COM

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 t he argument. CourseNana.COM

Note: All the necessary files (including any reused ones from Task 1 and Task 2) should be placed in a directory called ExtraCredit . CourseNana.COM

5/5 Important notes: CourseNana.COM

  1. All three directories must be included in a zip file. The filename must be your QM Student Number . CourseNana.COM

  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 mi nimum (i.e. use methods), do NOT use static methods unless there is a good reason. There will be marks allocated for good design. CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
UK代写,QMUL代写,Queen Mary代写,EBU4201代写,Introductory Java Programming代写,SumItUp代写,Java代写,UK代编,QMUL代编,Queen Mary代编,EBU4201代编,Introductory Java Programming代编,SumItUp代编,Java代编,UK代考,QMUL代考,Queen Mary代考,EBU4201代考,Introductory Java Programming代考,SumItUp代考,Java代考,UKhelp,QMULhelp,Queen Maryhelp,EBU4201help,Introductory Java Programminghelp,SumItUphelp,Javahelp,UK作业代写,QMUL作业代写,Queen Mary作业代写,EBU4201作业代写,Introductory Java Programming作业代写,SumItUp作业代写,Java作业代写,UK编程代写,QMUL编程代写,Queen Mary编程代写,EBU4201编程代写,Introductory Java Programming编程代写,SumItUp编程代写,Java编程代写,UKprogramming help,QMULprogramming help,Queen Maryprogramming help,EBU4201programming help,Introductory Java Programmingprogramming help,SumItUpprogramming help,Javaprogramming help,UKassignment help,QMULassignment help,Queen Maryassignment help,EBU4201assignment help,Introductory Java Programmingassignment help,SumItUpassignment help,Javaassignment help,UKsolution,QMULsolution,Queen Marysolution,EBU4201solution,Introductory Java Programmingsolution,SumItUpsolution,Javasolution,