Question: Create code in NetBeans java gui jframe form: Program Requirements: Create a program that has the ability to store and display integer values in an

Create code in NetBeans java gui jframe form: 

Program Requirements:

Create a program that has the ability to store and display integer values in an array. Create an array that is 20 elements long. Your program must be able to:

  • Add numbers (only positive) to the array using screen input.
  • Remove the first occurrence number from the array based on screen input.
  • List all of the elements in the array and compute the sum of all the elements.
  • List the even elements in the array and compute the sum of the even elements.
  • List the odd elements in the array and compute the sum of the odd elements.
    Tips:
  • Arrays are immutable, meaning that you can't actually delete an element from an array. So when you remove an element from an array it means that you are setting it back to zero. As such, for this program, the user should only be allowed to enter positive numbers.
  • This array is 20 elements long. Meaning that the user cannot add more than 20 numbers. Ensure that your program is coded in a way that gives the users feedback when they have reached the maximum and ensure that your program never crashes due to an attempt to access an index of the array that does not exist.
  • Even integers can be determined by dividing each number by two.
    • If the remainder is 0, the number must be even.
    • If there is a remainder, the number must be odd.

Sample Application Output:

Screen Shot 2023-08-02 at 10.37.25 PM.png 

List Screen Basic Application Example File Help Integer Sums Enter an Integer: 34 Add 2 3 Sum All 7 9 Sum Even 34 Sum Odd List Sum All Screen Basic Application Example File Help Integer Sums Remove Enter an Integer: 5 Add Remove 2 List 3 Exit 7 Sum All Exit 9 34 Sum Even The total of the entries is: 55 Sum Odd

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import javaawteventActionEvent import javaawteventActionListener import javaxswing public class ArrayOperations extends javaxswingJFrame private final int numberArray new int20 private int currentInde... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!