What is the output of the following
// Function prototypes
void fillArray(char [ ] , int)
void showArray(const char[], int)
int main ()
{ char prodCode[8] = { '0', '0' 0 '0'' '0' '0' '0' '0' '0'
}
fillArray(prodCode,8);
showArray(prodCode,8);
return 0;
// Definition of function fillArray
// (Hint : 65 is the ASCII code for 'A'.}
void fillArray(char arr[], int size}
{ char code= 65;
for ( int k = O; k < size; code++, k++ )
arr[k] = code;
}
// Definition of function showArray
void showArray(const char codes[ ] , int size)
{ for (int k = O; k < size; k++)
cout << codes[k ] ;
}
Want to see the full answer?
Check out a sample textbook solutionChapter 8 Solutions
Starting Out With C++: Early Objects (10th Edition)
Additional Engineering Textbook Solutions
Database Concepts (8th Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
Absolute Java (6th Edition)
Starting Out with C++ from Control Structures to Objects (9th Edition)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
- Write a C function that will take an array of integers as an argument and return the median value of the array. Note - The given array will not be sorted, hence first you need to sort the given array.And calculate the median for both odd and even length arrays.arrow_forwardQuestion 1 This question deals with multiplying a 2 X 3 matrix by a 3 X 2 matrix. Your job is to input matrix A, followed by matrix B, then produce matrix C which is the product of A and B. At run time, please use the following for matrix A 1 2 3 4 5 6 followed by the following data for matrix B: 6 5 4 3 2 1 Your program should input the values for A and B in function main, then call a function matrix_mult to produce matrix C which consists of the product of A and B. Please use the following for naming your variables: Ar1c1, Ar1c2, Ar1c3. ..., where Ar1c1 refers to row 1, column 1 of matrix A, etc. (There will be a lot of variables). Do not use arrays to solve this problem.arrow_forwardQ3: Write a C++ program, using function, to find the value of array C from add array A and array B. C[i] = Alil+BI[i];arrow_forward
- solve using c++. Let the user enter two arrays. Add(concatenation) the arrays into one extended array, by a user-defined function. Pass the extended array into another function that should return the length of the array passed to it. Input: First array: 2, 3, 4 Second array: 2, 4, 6 Output: Extended array is 2, 3, 4, 2, 4, 6 and its length is 6.arrow_forwardpython code. Instructions for each function are given within the quotations. 1)def is_word_from_letters(word, letters): """ Returns True if word is spelled by rearrange all or some of the letters Otherwise returns False Notes: this is different from uses_only function we wrote before, word not only can use only characters in letters, but the number of times it can use a letter is also limited by what is in letters. For example: is_word_from_letters("book", "bok") should be False because we do not have enough letter 'o'. """ return True 2)def get_word_score(word, value_dict): """ Given a word, and a dictionary matching each letter to an int score, calculates the word's score (adding up each letter's score) and return the score. """ return 0 3)def get_legal_word_scores(letters, dictionary, value_dict): """ Given a str of letters that we can use, and a dictionary that contains all legal words allowed in scrabble game, and a value_dict that maps each letter to a score, Returns a…arrow_forwardGiven the code segment below, what should be the data type of a in the function prototype of func(), given the call from main()? Do NOT use array indexing notation. If it is an invalid access, write INVALID (in all capital letters) as your answer. void func( ______ a);int main(){ double aData[15];func(*aData + 15);return 0;}arrow_forward
- 6. using c++, Write a function that counts the number of times an integer t occurs in an array of integers.arrow_forwardPlease fill in the blanks for C, from 1 to 68. /*The program will get the information of each client and print it right back. We could get the information of all clients first, then print them all later for better readability using an array of struct.*/ #include<stdio.h> #include<stdbool.h> #define length 70 //assume there's no names longer than 70 /*It's good practice to add all function headers to the top of the program*/ __1__ __2__ getEmployeeInfo(); __3__ printEmployeeInfo(__4__ __5__ em); __6__ __7__ getClientInfo(__8__ i); __9__ printClientInfo(__10__ __11__ cli, __12__ i); /*Employee struct: all the arrays use the same constant size defined on top name-first, last-(string) title (string) number of clients (integer) number of years working at the company(can take decimal points). */ __13__ employee { __14__ first_name[__15__]; __16__ last_name[__17__]; __18__ title[__19__]; __20__ num_clients; __21__…arrow_forwardFill in the c code for the question below: Define the function: void deleteAtV1(int num[], int *count , int pos); //The function deletes the item at pos For example: Test Result int num[10]={4,5,1,2,8}; int coun=5; deleteAtV1(num,&count,2); display(num,count); 4528 code: void display(int num[], int size){ int i; for(i=0;i<size; i++) printf("%d", num[i]);} // Fill up this missing code to delete [2} in the arrayarrow_forward
- Write a Java program that: Your program should include at least 3 functions including main. You need to delete the name from the array : replace the deleted name with the one after it, in a loop. So when the deletion is finished, the remaining names are at the beginning of the array, and that is all that is shown from the array. This means you do not simply skip over the "deleted" names when outputting the array. Please follow the standard conventions for indentation, meaningful variable names, etc.arrow_forwardI need help in this question Given the code segment below, what should be the data type of a in the function prototype of func(), given the call from main()? Do NOT use array indexing notation. If it is an invalid access, write INVALID (in all capital letters) as your answer. void func( ______ a); Int main() { double aData[15]; func(aData[4]); return 0; }arrow_forwardWrite a function that will take an integer array and its size. This function will move all the odd values to left side and even values to right side. Ex: input array: [ 1, 4, 5, 3 ,6] output array: [1, 3, 5, 4, 6] Function Prototype: evenOdd( int *arr , int size); need an urgent answer in c++...pleasearrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr