Skip to main content

Creating your own ArrayList in Java

Wanted to show that certain data structures in Java can be created by you. In this example, we'll go ahead and create an ArrayList data structure that has some of the methods that the built in ArrayList class has.

We'll create 2 constructors:

  • The default constructor that creates an ArrayList with a default size of 10.
  • Constructor that allows an initial size to be passed to the array.
We'll also create a number of methods:
  • void add(Object x); A method that allows you to place an Object at the end of the ArrayList.
  • void add(int index, Object x); A method that allows you to place a value at a given location.
  • Object get(int index): Allows you to retrieve a value of the arrayList array from a given location.
  • int size(); Allows you to get the number of elements currently in the Arraylist.
  • boolean isEmpty(); Tests to see if the Arraylist is empty.
  • boolean isIn(Object x); A method that sees if a particular object exist in the arrayList.
  • int find(Object x); Returns the location of first occurrence of an Object starting from location 0.
  • void remove(Object x); Removes the first occurrence of an Object starting from location 0.
I encourage you not to look at the ArrayList built in class. See if you can figure it out on your own. The only other restriction will be to store the Objects in an array data field. Create a test class to test the ArrayList class. Name your ArrayList class ArrayList.java so that it overwrites the built in class.


/**
* Author: Dino Cajic
*
* Purpose: To create a resizable array implementation.
*
* Data Structures used: Array
*
* Solution to the problem: The arrayList array data field will be created and
* will store objects passed to it. The ArrayList class will have methods to:
* 1). add Objects to the end of the arrayList array: void add(Object x)
* 2). add Objects to a specific index location: void add(int index, Object x)
* 3). get the object from a specific index location: Object get(int index)
* 4). check to see how many elements are in the arrayList: int size()
* 5). check to see if the arrayList is empty: boolean isEmpty()
* 6). check to see if an object exists within the array: boolean isIn(Object ob)
* 7). get the index location of a specific object: int find(Object n)
* 7). remove the object from the array: void remove(Object n)
*
* To use the class: Instantiate the ArrayList class and either pass an initial
* size or leave blank for a default size of 10. Use the methods provided to
* store/remove elements from ArrayList class.
*/
public class ArrayList {
/**
* Stores the objects in an array
*/
private Object[] arrayList;
/**
* The current amount of elements in the arrayList array
*/
private int elementsInArray;
/**
* The default constructor that creates an arrayList with a default size of 10.
* Precondition: Must instantiate the class without passing a value.
* Postcondition: Initializes the arrayList array with a default size of 10.
*/
public ArrayList() {
this(10);
}
/**
* Constructor that allows an initial size to be passed to the array.
* Precondition: Parameter n must be larger than 0.
* Postcondition: The constructor initializes the arrayList data field with size n
* and initializes the elementsInArray to 0.
* @param n | The size of the arrayList array.
*/
public ArrayList(int n) {
if (n <= 0) {
System.out.println("The size must be greater than 0. Try again.");
return;
}
this.arrayList = new Object[n];
this.elementsInArray = 0;
}
/**
* A method that allows you to place an Object at the end of the ArrayList.
* Precondition: Must pass a parameter x of type Object.
* Postcondition: The method checks to see if the array is full. if it is,
* a "double" argument is passed to the copyArray() method to double the arrayList's
* capacity. The Object x is added to the arrayList array. The size, elementsInArray,
* is incremented by 1.
* @param x | The object to be added to the arrayList array.
*/
public void add(Object x) {
if (checkIfArrayFull()) {
copyArray(0, "double");
}
this.arrayList[this.elementsInArray] = x;
this.elementsInArray++;
}
/**
* A method that allows you to place a value at a given location.
* Precondition: Must pass the index location that's within the
* arrayList array bounds; Also must pass the Object to insert
* at a given index location.
* Postcondition: Checks to see if the array arrayList is full.
* If it is, the capacity is doubled in size. The method checks
* to see if the index that was passed is out of bounds; if it
* is, a index out of bounds message is displayed and the
* program is terminated. A temp Object is created and stores
* the arrayList object at the given passed index. The arrayList
* at the passed index is assigned the value of Object x. A temp2
* object is declared to be used in the loop. The loop is created
* and cycles starting at the current index location to the
* arrayList length - 1 position. The temp2 variable is assigned
* the Object value of arrayList at i+1 position. The arrayList
* at i+1 position is assigned the value of temp. Then the temp
* variable is assigned the value of temp2. This ensures that the
* Objects passed the index value are stored in the array. After
* the loop, the copyArray() method is called. This compacts the
* array. i.e. if the capacity was 20, and the array has 10 elements,
* but the user decided to add the new Object at index 15, the
* copyArray() method would move the Object from index 15 to index 10.
* The elementsInArray data field is incremented by 1.
* @param index | The position where the new Object should be added.
* @param x | The object that should be added to arrayList at the specific index.
*/
public void add(int index, Object x) {
if (checkIfArrayFull()) {
copyArray(0, "double");
}
if (index >= this.arrayList.length) {
System.out.println("The index is out of bounds");
System.exit(-1);
}
Object temp = this.arrayList[index];
arrayList[index] = x;
Object temp2;
// Invariant: index <= i < arrayList.length - 1
for (int i = index; i < this.arrayList.length - 1; i++) {
temp2 = arrayList[i + 1];
arrayList[i + 1] = temp;
temp = temp2;
}
copyArray(0, "");
this.elementsInArray++;
}
/**
* Allows you to retrieve a value of the arrayList array from a given location
* Precondition: Must pass an index that's within array bounds.
* Postcondition: Checks to see if the index is within the arrayList bounds. If it's not,
* a message is printed to the user. If it is within bounds, the Object at the specific
* index location is returned.
* @param index | The index location of the Object.
* @return element | The Object at the specific index.
*/
public Object get(int index) {
Object element = null;
// Invariant: 0 <= index < arrayList.length
try {
element = this.arrayList[index];
} catch (ArrayIndexOutOfBoundsException e) {
System.out.println("The index that you specified is not within bounds.");
System.exit(-1);
}
return element;
}
/**
* Allows you to get the number of elements currently in the Arraylist.
* Precondition: The ArrayList object must be instantiated in the user program.
* Postcondition: Returns the value of the elementsInArray field.
* @return elementsInArray value.
*/
public int size() {
return this.elementsInArray;
}
/**
* Tests to see if the Arraylist is empty.
* Precondition: The ArrayList object must be instantiated in the user program.
* Postcondition: Returns true if the elementsInArray value is zero meaning that
* there are zero elements in the arrayList array. Returns false if the
* elementsInArray value is greater than 0.
* @return true if empty; false if not
*/
public boolean isEmpty() {
return this.elementsInArray == 0;
}
/**
* A method that sees if a particular object exist in the arrayList
* Precondition: Must pass a parameter of type Object
* Postcondition: Passes the ob parameter the find() method. If the
* find() method returns a value greater than or equal to zero, an
* object was found and the isIn() method returns true. If the find()
* method returns -1, no object was found() and the isIn() method
* returns false.
* @param ob | The object that the user checks to see if it's in the
* arrayList array
* @return boolean | True if object exists, false otherwise.
*/
public boolean isIn(Object ob) {
return find(ob) >= 0;
}
/**
* Returns the location of first occurrence of an Object starting from location 0
* Precondition: Must pass a parameter of type Object.
* Postcondition: Checks to see if the arrayList array contains the Object n. If
* it does, the position of the Object is returned. Otherwise, -1 is returned.
* @param n | The Object that the method will search for in arrayList
* @return i | The position of the Object n within the arrayList array
*/
public int find (Object n) {
// Invariant: 0 <= i < arrayList.length
for (int i = 0; i < this.arrayList.length; i++) {
if (n.equals(this.arrayList[i])) {
return i;
}
}
return -1;
}
/**
* Removes the first occurrence of an Object starting from location 0
* Preconditon: Must pass the Object n as a parameter to be removed.
* The Object n should be an element in the arrayList array.
* Postcondition: The method loops through each of the elements in the
* arrayList. If the Object exists in the arrayList array, the element
* at that particular index is set to null. The elementsInArray is
* decremented by 1. The copyArray() method is called to compact the
* array again. The method will exit when the first instance of the
* Object is found.
* @param n | The Object to be removed from the arrayList array
*/
public void remove (Object n) {
// Invariant: 0 <= i < elementsInArray
for (int i = 0; i < this.elementsInArray; i++) {
if (n.equals(this.arrayList[i])) {
this.arrayList[i] = null;
this.elementsInArray--;
copyArray(0, "");
return;
}
}
}
/**
* Checks to see if the arrayList array is full.
* Precondition: The elementsInArray and arrayList data fields have to be initialized
* Postcondition: Checks to see if the elementsInArray is equal to the size of the arrayList array. If it is,
* that means that the arrayList is full. If it's full the method returns true; otherwise, returns false.
* @return boolean
*/
private boolean checkIfArrayFull() {
return this.arrayList.length == this.elementsInArray;
}
/**
* Copies the arrayList array to the larger tempArray array. Copies the contents of
* the tempArray array to the new arrayList array.
* Precondition: must pass the size that the tempArray will be incremented by. If action
* is "double" the size will be doubled.
* Postcondition: The size parameter is passed to the increaseArraySize() method. The
* method performs the necessary calculations and returns the new array size. The
* tempArray array is instantiated with the size. A tempElement is set to keep track
* of the tempArray element position. A for loop tests to make sure that the index of
* the element, represented as i, is less than the length of the arrayList array. After
* each loop, i and tempElement variables are incremented by 1. Within the loop body,
* a check is preformed to see if the current element is an Object or null. If it's null,
* the tempElement is decremented by 1 and the loop skips the remainder of the code. If
* it is not null, the tempArray at index tempElement is assigned the value of arrayList
* at index i.
* For example, if index 1 in arrayList is null, the next go around the code may resemble
* the following: tempArray[1] = arrayList[2];
* After the loop, the arrayList array is set to null. It's instantiated as a new Object[]
* with the size that is the size of the tempArray. The arrayList is assigned assigned the
* tempArray array.
* @param size | Size to increment the new array by.
* @param action | Tells the increaseArraySize how to process the size.
*/
private void copyArray(int size, String action) {
size = increaseArraySize(size, action);
Object[] tempArray = new Object[size];
int tempElement = 0;
// Invariants: 0 <= i < arrayList.length && 0 <= tempElement < arrayList.length
for (int i = 0; i < this.arrayList.length; i++, tempElement++) {
if (this.arrayList[i] == null) {
tempElement--;
continue;
}
tempArray[tempElement] = this.arrayList[i];
}
this.arrayList = null;
this.arrayList = new Object[tempArray.length];
this.arrayList = tempArray;
}
/**
* Increases the array size if size positive, decreases if negative.
*
* Precondition: Must pass the size parameter of type int.
* Postcondition: Checks to see if the action parameter is equal to "double". If so,
* the arrayList length is doubled and stored within the size variable. If not,
* the arrayList length is incremented by the value passed in the size parameter
* and stored in the size variable. Size is then returned.
* @param size | EDIT
* @param action | EDIT
*/
private int increaseArraySize(int size, String action) {
if (action.equals("double")) {
size = this.arrayList.length * 2;
} else {
size = this.arrayList.length + size;
}
return size;
}
}
view raw ArrayList.java hosted with ❤ by GitHub

/**
* Author: Dino Cajic
*
* Purpose: Tests the ArrayList class.
*
* How to use the program: Just run it.
*/
public class Driver {
/**
* Tests the ArrayList class
* Precondition: Must have ArrayList class in same folder
* Postcondition: Creates an ArrayList object of size 50. Adds and removes
* Objects from the list. Tests each of the methods to make sure everything
* is working. Creates another ArrayList object utilizing the default
* constructor. Again tests each of the ArrayList's methods.
* @param args
*/
public static void main(String[] args) {
System.out.println("Create Constructor setting ArrayList to capacity 50");
ArrayList numeric = new ArrayList(50);
System.out.println("The ArrayList is empty: " + numeric.isEmpty());
System.out.println("The numer of elements in array is: " + numeric.size());
System.out.println("Populate the ArrayList with values from 1 to 20");
for (int i = 0; i < 50; i++) {
numeric.add((int)(Math.random() * 20) + 1);
}
System.out.println("The ArrayList is empty: " + numeric.isEmpty());
System.out.println("The number of elements in array is: " + numeric.size());
System.out.println("Add an element to the end of the ArrayList: i.e. 12345");
numeric.add(12345);
System.out.println("The index of 12345 is " + numeric.find(12345));
System.out.println("The number of elements in array is: " + numeric.size());
System.out.println("The value of element 50 is: " + numeric.get(50));
System.out.println("Element at index 5 before removal: " + numeric.get(5));
System.out.println("The number of elements in array is: " + numeric.size());
System.out.println("Remove element at index 5");
numeric.remove(numeric.get(5));
System.out.println("Element at index 5 after removal: " + numeric.get(5));
System.out.println("The number of elements in array is: " + numeric.size());
System.out.println("Add an element at specific position");
System.out.println("Element at index 10 before insertion: " + numeric.get(10));
numeric.add(10, 200);
System.out.println("Element at index 10 after insertion: " + numeric.get(10));
System.out.println("Element at index 11 after insertion: " + numeric.get(11));
System.out.println("Check to see if particular element is in array?");
System.out.println("Is 12345 in array? " + numeric.isIn(12345));
System.out.println("Is 123456 in array? " + numeric.isIn(123456));
for (int i = 0; i < numeric.size(); i++) {
System.out.println("ArrayList[" + i + "]: " + numeric.get(i));
}
System.out.println("************************************************");
System.out.println("Tests the default constructor");
ArrayList test = new ArrayList();
System.out.println("Current size: " + test.size());
System.out.println("Is the Array List empty? : " + test.isEmpty());
test.add("x");
test.add("b");
test.add("aa");
test.add("bh");
test.add("G");
test.add("d");
test.add("a");
test.add("e");
test.add("bd");
test.add("c");
test.add(2, "DINO");
test.add(2, "CAJIC");
test.add(10, "DINO");
test.add(19, "DINO");
test.remove("DINO");
test.remove("x");
System.out.println("Current size: " + test.size());
System.out.println("Is the Array List empty? : " + test.isEmpty());
System.out.println("Object at index 1: " + test.get(1));
System.out.println("Object at index 3: " + test.get(3));
System.out.println("Position of G: " + test.find("G"));
System.out.println("Position of na: " + test.find("na"));
System.out.println("Is bd in array list? : " + test.isIn("bd"));
System.out.println("Is bda in array list? : " + test.isIn("bda"));
for(int i = 0; i < test.size(); i++) {
System.out.println("ArrayList[" + i + "] : " + test.get(i));
}
System.out.println("Out of bounds test: " + test.get(22));
}
}
view raw Driver.java hosted with ❤ by GitHub

Comments

  1. Amazing writing! Again, you provide several realistic ways. I want to thank you for your outstanding performance. In most cases, a mobile app development framework can help you choose the best framework to create a new mobile application. Thanks for sharing, as otherwise i would not have thought about trying this solution.

    ReplyDelete

  2. I know this is an amazing post, it defines the true value of your knowledge. In fact, running a business is not common. People keep running to drive more business and generate more customers. At RisingMax which is best IT consulting companies in NYC, you can maintain a leading position with real estate software development in New York. keep it up. I really think this article is amazing, I can't describe it in words. Also, if you need an automotive software development service, do not delay in shaking hands with RisingMax.

    ReplyDelete
  3. Once again you provide several doses of reality which explore the complete explanation of packing and moving companies in Bangalore . This article don't have to be that long. I simply couldn't leave your web site before suggesting that I actually loved the usual info on packing and movers services in Bangalore. I just want to know what is the best way to get real service.

    ReplyDelete
  4. In order to function as a printer, it is very important to download and install a proper driver from 123.hp.com/setup. Type the link 123.hp.com/setup onto the browser & type the correct model number in the search box and download the driver.

    ReplyDelete
  5. Since its launch, RisingMax has been following the principles of building and implementing great ideas, empowering customers' businesses and improving their lives through innovative enterprise solutions. Our team at RisingMax is distinguished by the cross-technology imagination, knowledge and experience we bring to every project we deal with. We understand the importance of nurturing interpersonal relationships.

    ReplyDelete
  6. Mobile app development is a lucrative and in-demand job path. Enroll in an advanced program in Android app development to determine if you're cut out for a future as a mobile app developer. Suffescom Solutions should also be aware of the App Store Optimization procedure, which is critical if you want to be found by consumers looking for apps that are comparable to yours.

    ReplyDelete
  7. Wow, that was a fantastic article. I took the time to read it. It's a tremendous resource! The Netflix clone is an excellent way to provide your users with a customized video-streaming platform that includes entertaining video content. Suffescom Solutions has grown to become the largest entertainment platform provider by providing streaming services like Netflix Clone script and various other customized content.

    ReplyDelete
  8. Thank you for providing the best information regarding mobile apps. It is very user-friendly and covers every aspect of food delivery app development.  Since technology is evolving especially in terms of the food business. The rise of mobile app development is also achieving new heights. Here the Suffescom solutions provide all sorts of information regarding mobile app development under one roof.

    ReplyDelete
  9. Thank you so much for sharing this valuable information and here I just want to introduce about App Cost Calculator which can help you determine how much it will cost to build an app and how long it will take to launch. The cost varies depending on the device, functionality, UI/UX, and many other factors that will be discussed in detail.

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. In my opinion, this is a very valuable and educational post. Honestly, this is an excellent piece of writing. Keep up the good work. Listed here are all the solutions we offer for both online and mobile app development. Here, you may learn about the most popular software development services in the world.

    celltracker io
    Try it Yourself »
    zazzle vs shopify

    Hire woocommerce developer

    java versus.net

    app to find local businesses

    ReplyDelete
  12. Thanks for Sharing This Information. Engineering Assignment Help is a website that allows you to Engineering Assignment Help. Easily to write, Assignment Help Online with trained teachers ..

    ReplyDelete
  13. You can create a TRC20 or TRC721 Token through our TRON token development services and they will work seamlessly with their Ethereum counterparts. Tron token

    ReplyDelete
  14. The token migration platform helps projects upgrade their old tokens to new tokens. In essence, if your old token has any flaws or if you want to add some additional features, you can create an entirely new token and users can swap their old tokens with your new tokens through the migration contract. Token Migration

    ReplyDelete
  15. Create your own DEX with like Uniswap our Uniswap clone script. Get decentralized exchange development from BlockchainX experts.Uniswap clone script

    ReplyDelete
  16. Hey, thanks for another great piece of content. The way you highlighted the problem of completing multiple assignments simultaneously is commendable. One way to deal with this never-ending struggle is hiring the ingenious Assignment Helper of the My Assignment Services platform. Our seasoned experts of Java Assignment Help not only have expansive knowledge about the content but are also very well versed with the pattern of writing assignments. They guide you through guided sessions, so as to earn you the maximum marks for your submissions.

    ReplyDelete
  17. Thanks for sharing the informational blog post. For more information on development of your very own DEX and SWAP platform visit Top Blockchain Development Company


    Quest GLT- India’s Leading Software Consulting & Development Company
    https://questglt.com

    ReplyDelete
  18. Tron token development is your best choice if you want all the functionalities of Ethereum, without the outrageous gas fees. Our Tron token development services allow you to create and deploy tokens on the tron network in minutes

    ReplyDelete
  19. James Baldwin is a PhD degree holder in Psychology and an academic blogger. he is also an academic writer working at tophomeworkhelper.com for a legit company, and provides his guidance to students with their studies. Students who are looking for professional support must contact him.you can get 30% discount on writing service. We are best home work help provider in USA. we have 3500 experts , Who are giving 24/7 service . write my case study for me, swot and pestle analysis, ford case study ,electrical assignment help ,biochemistry assignment help

    ReplyDelete
  20. I read a lot of blog entries and had never come across such a topic before. I truly enjoy the topic of the blogger's bucket list you chose. This is a very useful article. Nowadays, new technology in the entertainment business allows individuals to unwind and enjoy their leisure time. The latest technology has revolutionized daily entertainment. - ,LBM Blockchain Solutions

    ReplyDelete

  21. There are very few Best Blockchain Development Company in Mohali. Being one,LBM Blockchain Solutions makes sure you are served the best. We are the Best Blockchain Development Company in Mohali. Our company has built an inevitable reputation in the industry with years of experience.

    ReplyDelete
  22. This comment has been removed by the author.

    ReplyDelete
  23. You have posted a great article. meaning of every line explains clearly. In todays era crypto coin and token is trending in the market. If you want to know the difference between coin and token read my article and share your reviews.

    ReplyDelete
  24. Thanks for this wonderful post. The information in this article is very helpful to me. Thanks a lot for sharing. Keep blogging. How To Develop Your Own Crypto Token

    ReplyDelete
  25. Our assignment help is written as per the needs and requirements of the students. Top quality engineering assignments without any sort of errors submitted to the students which. Engineering assignment help in Australia, United Kingdom, Malaysia, Singapore, New zealand, United States of America, Canada, United Arab Emirates Online Assignment help, https://thetutorshelp.com/engineering-assignment-help.php
    Engineering Assignment Help

    ReplyDelete
  26. Information Technology Assignment Help
    Best Offer on information technology assignment help by Thetutorshelp.com Expert. We provide our service in the Malaysia, Singapore, New zealand, United States of America, Canada, United Arab Emirates and Australia 24/7. We are always available for your help https://thetutorshelp.com/information-technology-assignment-help.php
    Information Technology Assignment Help

    ReplyDelete
  27. Computer Science Assignment Help
    Get the best computer science assignment help service;In Australia, United Kingdom, Malaysia, Singapore, New zealand, United States of America, Canada, United Arab Emirates choose Thetutorshelp.com.us as they can give you the best assistance in a pocket-friendly price.https://thetutorshelp.com/computer-science-assignment-help.php
    Computer Science Assignment Help

    ReplyDelete
  28. Electrical Engineering Assignment Help
    Electrical engineering assignment help and Electrical Assignment Help by the best engineers for collge & universities students of UK, USA, Australia,UAE etc. Get best solution for electrical engineering homework help.https://thetutorshelp.com/electrical-engineering-assignment-help.php
    Electrical Engineering Assignment Help

    ReplyDelete
  29. This comment has been removed by the author.

    ReplyDelete
  30. Connect yourself with technology by reading the information provided by Apps For Startup Stay connected with it as it provides the best information on technology.

    ReplyDelete
  31. https://maticz.com/binance-clone-script
    https://maticz.com/localbitcoins-clone-script
    https://maticz.com/paxful-clone-script
    https://maticz.com/trust-wallet-clone-app
    https://maticz.com/crypto-trading-bot-development

    ReplyDelete
  32. Great post!
    Thank you so much for sharing this informative post with us. Keep it up
    Cryptocurrency Trading Bot Development Company

    ReplyDelete
  33. This is a treasure trove of insightful articles, offering valuable knowledge

    Metaverse Development Company

    ReplyDelete

  34. My Assignments Pro offers specialized assistance for business dissertations, providing invaluable support to students pursuing advanced degrees in business-related fields. Our services are tailored to meet the unique needs of students grappling with the complexities of dissertation writing in the business domain.

    ReplyDelete
  35. This comment has been removed by the author.

    ReplyDelete
  36. I don't have enough words to express my appreciation for your remarkable content. Keep up the good work! If anyone is interested in this topic Binance clone script, I hope you will also get a great experience with our content, and feel free to share your thoughts.

    ReplyDelete
  37. Thanks to substantial advancements in collaboration tools and technology, remote software developers may now seamlessly connect with existing teams and effectively contribute to projects more easily than ever before.
    hire remote software developers

    ReplyDelete

Post a Comment

Popular posts from this blog

Beginner Java Exercise: Sentinel Values and Do-While Loops

In my previous post on while loops, we used a loop-continuation-condition to test the arguments. In this example, we'll loop at a sentinel-controlled loop. The sentinel value is a special input value that tests the condition within the while loop. To jump right to it, we'll test if an int variable is not equal to 0. The data != 0 within the while (data != 0) { ... } is the sentinel-controlled-condition. In the following example, we'll keep adding an integer to itself until the user enters 0. Once the user enters 0, the loop will break and the user will be displayed with the sum of all of the integers that he/she has entered. As you can see from the code above, the code is somewhat redundant. It asks the user to enter an integer twice: Once before the loop begins, and an x amount of times within the loop (until the user enters 0). A better approach would be through a do-while loop. In a do-while loop, you "do" something "while" the condition...

Programming Language Concepts Test Questions/Answers

One of the easiest methods that I use to learn new topics is by creating notes on the subject and then by turning those notes into questions and answers. Remembering answers to questions just seems more natural. I was able to memorize 323 questions and answers in a matter of a couple of days. I wanted to start doing this for some topics that I find pretty interesting. To begin, here are some questions and answers to Programming Language Concepts (PLC). I'm reading your mind right now and the answer is yes, there will be more. 1. Name 3 reasons for studying PLC. - Better understanding of current programming languages - Advancement of computing - Increased capability to express ideas - Increased capability to learn new programming language. - Better understanding of which programming language to choose.  2. Name the 5 programming domains and languages best suited for each. - Scientific (Fortran, ALGOL 60) - Business (COBOL) - AI (Lisp, Scheme, Prolog) - Web (PHP, ...