Two Dimensional array

Write a program that:

  • Queries the user to enter two integer numbers; one representing the number of rows in a two dimensional array and the other the number of columns. Dynamically create the two dimensional array Iterate through this array and:
    • if the row index = 0, place a '0' in the element
    • if the column index = 0, place an 'a' in the element
    • if both the row index and column index are even place an 'x' in the element
    • if both the row index and column index are odd place a 'y' in the element
    • place a 'b' in all other elements
  • Iterate through the array and count and present to the user the number of each value ('0','a','b','x','y') present in the array.
  • Iterate through the array and display its contents in a logical manner on the standard output device

Utility Class Homework

create a Utility class containing three methods that can be called without instantiation. The three classes are:

  • String queryUserForString(String title, String message) A method that displays the message message in a JOptionPane dialog having the title title and returns the string entered by the user.
  • long queryUserForInteger(String title, String message) A method that displays the message message in a JOptionPane dialog having the title title and returns the integer value entered by the user.
  • double queryUserForDouble(String title, String message) A method that displays the message message in a JOptionPane dialog having the title title and returns the floating point value entered by the user.

Accumulator Object

Create the class definition for this accumulator object. Make sure you:

  • have a constructor that initializes the accumulator to 0
  • an appropriate mutator method for each instance variable
  • an appropriate accessor method for each instance variable
  • a method called with the prototype void add(int value) that adds the value value to the accumulator only if value is > 0
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.