- Strength to Increase Rep
- +3
- Strength to Decrease Rep
- -0
- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
[CODE]//This function prints all scores, but if a score occurs more than once, it only prints it one time void scores_once(int x[20], int size, int new_array[20]) { for(int i=0; i<size; i++) { new_array[i]= -1; } new_array[0]= x[0]; cout<<new_array[0]<<endl; for(int j=1; j<size; j++) { for(int k=0; k<size; k++) { if (x[j]!=new_array[k]) … |
|
I have to write code to shift all the values in the array to the right of position P, one place to the left. I can make up my own array and position P. would this code work? for (j=6; j>1;j--) { x[j-1]=x[j]; } |
|
The following function mixes call by reference and call by value parameters. [ICODE]void T ( int & a, int b ) { int c = a - 1; a = c + b; b = a + 2; }[/ICODE] Suppose that in main we had the following: [ICODE]int apple = … |
|
26. What is printed in the following code segment? [ICODE] I = 1; do { I = I + 25; } while ( I > 50 ); cout << I + 50; [/ICODE] a) 50 b) 51 c) 75 d) 76 |
|
23. To convert Fahrenheit ( F ) temperatures to Centigrade ( C ) temperatures people use the formula: (32 degrees F is 0 degrees C, 212 degrees F is 100 degrees C, etc.) double C,F; [ICODE]cin >> F; C = ( 5 / 9 ) * ( F - 32 … |
|
14. What will be outputted given the segment of code, if 11 is entered from the keyboard? int number; [ICODE]cin >> number; if ( number > 0 ) cout << "C++"; else cout << "Soccer"; cout << " is "; cout << "fun" << endl; [/ICODE] |
|
I just learned about bubble sort and still don't know how to make it work in my program I hope someone can help me. This is my task I should use parallel arrays (of size 20) for student name, student number, test score, and letter grade. The list must be … |