subject
Computers and Technology, 12.03.2021 15:30 F3R

In this lab, we review and practice arrays and functions. You will practice: How to use array to store a collection of values:
partially filled array (using a int variable to keep track of the number of elements)
searching for a value in the array,
inserting an element into the array,
deleting an element from the array,
reversing the array and using swap.
How to clearly declare a function by writing concise function comments, and specifying properly name, parameters and return type for the function. This step address the question of what the function is supposed to do?
Passing array as parameter to function: both the array and the number of elements need to be passed to the function
Call-by-value and call-by-reference
return type: for functions that perform some kind of checking, it should return bool type.
How to implement a function given its declaration. This step takes care of How the function works? When implementing a function, all you need to know is the function's declaration.
Example Output:
Enter a list of up to 20 integers or -1 to end the list
3 2 4 8 12 5 6 9 0 11 10 13 -1
3 2 4 8 12 5 6 9 0 11 10 13
Enter a value and a position to insert: 18 5
3 2 4 8 12 18 5 6 9 0 11 10 13
Enter a value to delete from the array: 18
3 2 4 8 12 5 6 9 0 11 10 13
Enter a value to append: 15
3 2 4 8 12 5 6 9 0 11 10 13 15
15 13 10 11 0 9 6 5 12 8 4 2 3
Please fill in the code in all places where there have a ToDo comment.
Hints
Start with the simiplest function, e. g., the one to search the content of an array.
The suggested order to write the function is:
Function to search for a value in the array
Function to fill an array with positive integers
Function to delete an element from the array: after deletion, the array should have no holes.
Function to insert an element into the array
Write one function, test it to make sure it really works, and then move on to next function.
Write comments to 1) document your algorithms and design, 2) make your code readable, 3) debug code.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:20
When developing a stakeholder matrix, the portfolio manager must look at the portfolio governance in order to complete the stakeholder analysis. in your own words, what is the role, interest and expectations of the governance?
Answers: 3
question
Computers and Technology, 22.06.2019 13:00
Which part of the cpu accepts data?
Answers: 1
question
Computers and Technology, 23.06.2019 00:40
Consider the following statements: struct nametype{string first; string last; }; struct coursetype{string name; int callnum; int credits; char grade; }; struct studenttype{nametype name; double gpa; coursetype course; }; studenttype student; studenttype classlist[100]; coursetype course; nametype name; mark the following statements as valid or invalid. if a statement is invalid, explain why.a.) student.course.callnum = "csc230"; b.) cin > > student.name; c.) classlist[0] = name; d.) classlist[1].gpa = 3.45; e.) name = classlist[15].name; f.) student.name = name; g.) cout < < classlist[10] < < endl; h.) for (int j = 0; j < 100; j++)classlist[j].name = name; i.) classlist.course.credits = 3; j.) course = studenttype.course;
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
What are the possible consequences of computer hacking? what is computer piracy? describe some examples. what are the effects of computer piracy? what are the possible consequences of computer piracy? what is intentional virus setting? describe some examples. what are the effects of intentional virus setting? what are the possible consequences of intentional virus setting? what is invasion of privacy? describe some examples. what are the effects of invasion of privacy? what are the possible consequences of invasion of privacy? what is an acceptable use policy and what is the purpose of the acceptable use policy what is intellectual property and how can you use it?
Answers: 1
You know the right answer?
In this lab, we review and practice arrays and functions. You will practice: How to use array to st...
Questions
question
Arts, 31.01.2021 09:20
question
History, 31.01.2021 09:20
question
Mathematics, 31.01.2021 09:20
question
History, 31.01.2021 09:20
question
English, 31.01.2021 09:20
question
Mathematics, 31.01.2021 09:20
Questions on the website: 13722362