Skip to content

This project was for implementing Arrays and ArrayLists in java, while studying a java object oriented programming course.

Notifications You must be signed in to change notification settings

OrdoGeek/Arrays-ArrayLists

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Arrays-ArrayLists

This project was for implementing Arrays and ArrayLists in java, while studying a java object oriented programming course.

INSTRUCTIONS

In this assignment, you will implement a class called ​ ArrayAndArrayList​ . This class includes some interesting methods for working with Arrays and ArrayLists.

For example, the ​ ArrayAndArrayList​ class has a “findMax” method which finds and returns the max number in a given array. For a defined array: int[] array = {1, 3, 5, 7, 9}, calling findMax(array) will return 9.

There are 4 methods that need to be implemented in the ArrayAndArrayList​ class:

  • howMany(int[] array, int element) - Counts the number of occurrences of the given element in the given array.
  • findMax(int[] array) - Finds the max number in the given array.
  • maxArray(int[] array) - Keeps track of every occurrence of the max number in the given array.
  • swapZero(int[] array) - Puts all of the zeros in the given array, at the end of the given array. The method updates the array itself

CODE - SOLUTION

you can find the script right here on this repository

IMPLEMENTATION

Format:

  1. Main code for being run
  2. Output

A.

Screenshot from 2023-08-02 11-57-23 Screenshot from 2023-08-02 11-57-42

B.

Screenshot from 2023-08-02 11-58-12

Screenshot from 2023-08-02 11-58-25

C.

Screenshot from 2023-08-02 12-14-09

Screenshot from 2023-08-02 12-14-22

D.

Screenshot from 2023-08-02 12-32-18 Screenshot from 2023-08-02 12-32-32

About

This project was for implementing Arrays and ArrayLists in java, while studying a java object oriented programming course.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages