Question: Need last minute help on a CS homework. For Question 12: Last digit of student ID is 5. True/False: Circle one True/False Variable and functions
True/False: Circle one True/False Variable and functions identifiers can only begin with alphabet and digit. 2. True/False Compile time array sizes can be non-constant variables. 3. True/ False Compile time array sizes must be known at comple time. 4True/ False An array can have size of O. S. True / False int m 15.6; won't compile because the types do not match. 6. True /Fals int n-11/5; will allocate memory for n and initialize with the value 2. 7. True/False Array indices begin with the number 1. 8. Truit/ False You can define multiple functions with the same identifier. 9CTrue False 10 True/ False structs by default have private access specification. after the function completes execution. Variables declared local to a function are still accessible 11. Suppose you're tasked with fodng a function definition that does not work as intended. The fu identical characters, two characters are identical if they are compare two strings and set the count to the number of the same character and are in the same position in the cstring. This function will be case sensitive so the character 'd is not the same as 'A. Note that cstrings are just character arrays that have as their last character, for example char nane[7] "harry" might looks like this in memory 0 Usage of this function might look like (Note that the usage is correct and should not be modified): int count e; coeparecstrings( tacocat", "TACOCAT", count); I/ should set count to e compareCstrings("Harry""Malfoy", count); compareCstrings("SMC,"SBCC, count); /I should set count to 1 // should set count to 2 Currently the function definition is: void compareCstrings(const char stri[], const char str2[), int count) Scount - 8 int index; while (stri !-"Ye, II str2 ! 'e') { if (stristr2) &count++ index++ Rewrite the function so that it satisfies specification. Try to keep the general form of the original code, you should not have to add or remove any lines of code, just modify the existing ones. Page 1 of 8 12. Use the code below to answer the questions that follow. Assume that all proper libraries and name spaces are included and that the code will compile without error. Within the main function, for the variable int last sid write in the last digit of your SMC student ID. int foo(int a, int b) //First int c-a+b; while(c>"3) C--3; return c char foo(string a, int b) ( //Second return a[b]: string foo(int b, string &a) //Third string sub-a.substr(3.b,3); .replace(3.b, 3,.. ""); return sub; void main) ( int last-sid ; //c-Last digit of your SID string letters("ggfiorkcboneat !!!ws adtarojot") string output(); int numbers[] (,8,3,7,4,6,9,1,2,5) for(int ise; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
