GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

The numNegatives variable counts the number of negative valu…

The numNegatives variable counts the number of negative values in the array userVals. What should numNegatives be initialized to, to make sure it has the correct value after the for loop? int userVals[20];int i;int numNegatives = /* What should this be? */ ; for (i = 0; i < 20; ++i) { if (userValues[i] < 0) { numNegatives = numNegatives + 1; }}

Read Details

What is the output? int MyFct(int x) { int y; x = x * 2; y =…

What is the output? int MyFct(int x) { int y; x = x * 2; y = x + 1; return y;} int main() { int a; a = 5; cout

Read Details

What is the output? void IsEven(int num) { int even; if (num…

What is the output? void IsEven(int num) { int even; if (num % 2 == 0) { even = 1; } else { even = 0; }}int main() { IsEven(7); cout

Read Details

For the following function, which is a valid function call?…

For the following function, which is a valid function call? Assume maxValue is an integer. int Max(int x, int y) { if (x > y){ return x; } else { return y; }}

Read Details

What is output? double MyFct(double a, double b) { return (a…

What is output? double MyFct(double a, double b) { return (a + b) / 2.0;}int main() { double x = 3.0; double y = 5.0; double z = 8.0; double t; t = MyFct(x, y); t = MyFct(t, z); cout

Read Details

How many parameters does FahrenheitToCelsius have? double Fa…

How many parameters does FahrenheitToCelsius have? double FahrenheitToCelsius(double fahrenheit) { return (fahrenheit – 32.0) * 5.0 / 9.0;} int main() { double fahrenheit; cin >> fahrenheit; int c1; int c2; int c3; int c4; c1 = FahrenheitToCelsius(fahrenheit); c2 = FahrenheitToCelsius(32); c3 = FahrenheitToCelsius(78); c4 = FahrenheitToCelsius(100);}

Read Details

Given array scorePerQuiz has 10 elements. Which assigns 7th…

Given array scorePerQuiz has 10 elements. Which assigns 7th element in the array with the value 8?

Read Details

Given the following function. To change the function to retu…

Given the following function. To change the function to return the product instead of the sum, how many lines of code need to be changed? int Calculate(int a, int b) { return a + b;}int main() { cout

Read Details

What is true about void functions?

What is true about void functions?

Read Details

What is the output? int Calc(int num1, int num2) { return 1…

What is the output? int Calc(int num1, int num2) { return 1 + num1 + num2;}int main() { int x; x = Calc(4, 5); cout

Read Details

Posts pagination

Newer posts 1 … 43,650 43,651 43,652 43,653 43,654 … 71,167 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top