An array (or list) is a collection that contains multiple pieces of data. Generally, an array has indices (a sequence in the collection of data) that start from 0. To declare an array, you can add square brackets "[]" after the variable name and initialize it with curly braces "{}," separating each data element with a comma ",".
A multidimensional array is an array that has more than one dimension. It is commonly used to create matrices, graphs, and other complex data structures.
Create a list of names and implement a menu that can display, edit, and delete the list items, allowing the program to run repeatedly. Here is the expected output:
Menu 1. Create 2. Display 3. Edit 4. Delete 0. Exit Enter Menu: 8 (User input) Invalid Input
Menu 1. Create 2. Display 3. Edit 4. Delete 0. Exit Enter Menu: 1 (User input) Index 0: Azhar (User input) Index 1: Jordie (User input) Index 2: Ridho (User input) Index 3: Ardi (User input) Index 4: Clementius (User input) Index 5: Jasmine (User input) Index 6: (User input) Data Succesfully Added
Menu 1. Create 2. Display 3. Edit 4. Delete 0. Exit Enter Menu: 2 (User input) Index 0: Azhar Index 1: Jordie Index 2: Ridho Index 3: Ardi Index 4: Clementius Index 5: Jasmine Data Successfully Displayed
Menu 1. Create 2. Display 3. Edit 4. Delete 0. Exit Enter Menu: 3 (User input) Enter the index you want to edit: 2 (User input) Enter the new name: Dian (User input) Data in the list has been successfully changed
Menu 1. Create 2. Display 3. Edit 4. Delete 0. Exit Enter Menu: 1 (User input) Index 0: Azhar Index 1: Jordie Index 2: Dian Index 3: Ardi Index 4: Clementius Index 5: Jasmine Data Successfully Displayed
Menu 1. Create 2. Display 3. Edit 4. Delete 0. Exit Enter Menu: 4 (User input) Enter the index you want to delete: 4 (User input) Data Successfully Deleted
Menu 1. Create 2. Display 3. Edit 4. Delete 0. Exit Enter Menu: 1 (User input) Index 0: Azhar Index 1: Jordie Index 2: Dian Index 3: Ardi Index 4: Jasmine Data Successfully Displayed
Menu 1. Create 2. Display 3. Edit 4. Delete 0. Exit Enter Menu: 0 (User input) Thank you for using my program