subject

Partially-filled Arrays Write the function rindby() which stands for remove mark>if not divisiby by. The function removes all elements from the array that are not evenly divisible by the argument n. You can find out if a number is evenly divisible by n using the remainder operator: % (there will be nothing left over).
The function returns the number of items removed or -1 if the array was originally empty.
The function takes 3 arguments:
the array of int that may be modified.
the size of the array (use size_t as the type)
the int n used to check for divisibility
Here are two short examples:
int a[] = {2, 3, 4, 5, 6};
size_t size = 5;
int removed = rindby(a, size, 2);
// removed->2, a = [2, 4, 6], size = 3
size = 0;
removed = rindby(a, size, 3);
// removed-> -1, no change otherwise
In the first case, the numbers 3 and 5 are removed because they are not divisible by 2. Only the numbers that are divisible by 2 are left in the array.
In the second, size has been set to , so the input array is empty and the function returns - 1.
Exam C++ Quick Reference
p1.cpp
1 #include // size_t for sizes and indexes
2 using namespace std;
3
4 WRITE YOUR FUNCTION BELOW THIS LINE
5 int rindby(int all, size_t& size, int number)
6 {
7 int result;
8 // Add your code here
9 return result;
10 }
11

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:30
1. which of the following is a search engine? a) mozilla firefox b)internet explorer c)google d)safari 2. which of the following statements is true? a) all search engines will provide the same results when you enter the same query. b) all search engines use the same amount of advertisements. c) some search engines are also browsers. d) search engines often provide different results, even when you enter the same query.
Answers: 2
question
Computers and Technology, 23.06.2019 10:20
Suppose there is a relation r(a, b, c) with a b+-tree index with search keys (a, b).1. what is the worst-case cost of finding records satisfying 10 < a < 50 using this index, in terms of the number of records n1, retrieved and the height h of the tree? 2. what is the worst-case cost of finding records satisfying 10 < a < 50 and 5 < b < 10 using this index, in terms of the number of records n2 that satisfy this selection, as well as n1 and h defined above? 3. under what conditions on n1 and n2, would the index be an efficient way of finding records satisfying the condition from part (2)?
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
What does the faves button do? a. users mark a web page as a favorite b. leads other readers to favor a specific page c. readers sort and align their favicons, or favorite icons d. leads users to a message board where they can post questions
Answers: 1
question
Computers and Technology, 24.06.2019 08:50
Write a program that will compute the volume of ice cream served in a cone. as you can see in the diagram below, the ice cream is served as a hemisphere of frozen deliciousness on top of a cone, which is also packed with frozen deliciousness. thus, the total volume of ice cream sold is the volume of the hemisphere plus the volume of the cone. the example shows an ice cream cone in which the hemisphere and cone have a radius of 10 inches and the cone has a height of 15 inches. your program must instead prompt for these two values, which are taken from the keyboard as integers: • the hemisphere/cone radius in inches, and
Answers: 3
You know the right answer?
Partially-filled Arrays Write the function rindby() which stands for remove mark>if not divisib...
Questions
question
Mathematics, 18.09.2019 17:30
question
Mathematics, 18.09.2019 17:30
question
Mathematics, 18.09.2019 17:30
Questions on the website: 13722360