In: Computer Science
Question A
Let’s think about the use of Lists in everyday life. Provide an example and discuss the advantages and disadvantages of using these types of Lists.
Question B
Considering the lessons on menu logic and the use of arrays and loops, how does this change your programming capabilities? What kind of programs can you now create utilizing these powerful programming tools? Describe an example program that, before this week, was not possible or infeasible for you to program.
Question A
The list is the data structure which can store a
large amount of data.
The can be used in everyday life, to keep a record of
the things which we see in daily life.
Example -
1. List of all the
incoming calls from unknown contact helps us to filter them or
block the spam ones.
2. List can be used to
make a to-do list for daily routine.
3. List can be used to
keep a record of the grocery items list that before visiting the
market.
Advantages of the list -
1. The list can have
any type of value.
2. List can store any
numbers of values.
3. A various operation
can be performed on list such as - insertion, deletion, sorting
etc.
Disadvantages of the list -
1. The list values are
mutable i.e can be changed.
Question B
A menu logic together with array and loops can add
more advantage to the program.
It can provide a menu to the user and later ask for
the input, according to the input it can do various tasks.
It helps us to build a more advanced application
such as -
1. Menu-based
record-keeping system for students
2. Quiz Portal
3. Arithmetic
calculator
Let us take a tour to a menu based program for lists operation
Menu
1.
Insert
2.
Delete
3.
Print
4.
Sort
Enter Choice: 1
Enter a value to insert:
'A'
Successfully inserted into the
list.