Ncku Introduction To Computers - Test Online Quiz

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Archembaud
A
Archembaud
Community Contributor
Quizzes Created: 5 | Total Attempts: 1,004
Questions: 12 | Attempts: 86

SettingsSettingsSettings
Ncku Introduction To Computers - Test Online Quiz - Quiz


Questions and Answers
  • 1. 

    What output will this C/C++ code produce? 

    • A.

      This code won't run - there are syntax errors.

    • B.

      B = 44

    • C.

      This code won't run - there are linking errors.

    • D.

      B = 25

    Correct Answer
    B. B = 44
  • 2. 

    What will this code produce when compiled and executed?

    • A.

      This code won't run - the function wasn't properly defined.

    • B.

      Sum = 0

    • C.

      Sum = 7\n

    • D.

      Sum = 7

    Correct Answer
    D. Sum = 7
  • 3. 

    What will this code produce when run?

    • A.

      Result = 5, 7

    • B.

      Result = 5, 2

    • C.

      This code won't run - the function is not properly defined.

    • D.

      Result = 7, 2

    Correct Answer
    A. Result = 5, 7
    Explanation
    The code will produce the output "Result = 5, 7" when run.

    Rate this question:

  • 4. 

    What will those code produce when run?

    • A.

      This code won't work - functions can't call themselves.

    • B.

      Result = 120

    • C.

      This code won't work - there are syntax errors.

    • D.

      Result = 5

    Correct Answer
    B. Result = 120
    Explanation
    The given code will produce a result of 120 when run. This is because the statement "Result = 120" indicates that the value of the variable "Result" is assigned as 120. The previous statements mentioning that the code won't work due to functions not being able to call themselves or syntax errors are not relevant to the actual output of the code.

    Rate this question:

  • 5. 

    What will those code produce when run?

    • A.

      C = 0

    • B.

      This code won't run - there are syntax errors.

    • C.

      C = 5

    • D.

      C = 00000002DC74 (A hex. base memory address)

    Correct Answer
    B. This code won't run - there are syntax errors.
    Explanation
    The given code will not run because there are syntax errors in it. The code tries to assign a value of 0 to the variable "c", but it is missing the proper syntax for variable assignment. Additionally, the code tries to assign a value of 5 to "c" without proper syntax. Finally, the code tries to assign a memory address in hexadecimal format to "c", which is not a valid operation. Therefore, the code will not be able to run successfully.

    Rate this question:

  • 6. 

    What will those code produce when compiled and run?

    • A.

      C = 5

    • B.

      This code won't run - there are syntax errors.

    • C.

      C = 0000002DC74 (A hex. base memory address)

    • D.

      C = 0

    Correct Answer
    A. C = 5
    Explanation
    The given code assigns the value 5 to the variable c. This means that when the code is compiled and run, the value of c will be 5.

    Rate this question:

  • 7. 

    What is the aim / purpose of this code?

    • A.

      To compute the integral of sin(x)cos(x) over the bounds 0.1 - 0.5 using the Left Hand Rule.

    • B.

      To compute the integral of sin(x)cos(x) over the bounds 0.1 - 0.5 using Simpson's Rule

    • C.

      To compute the integral of sin(x)cos(x) over the bounds 0.1 - 0.5 using the Trapezoid Rule

    • D.

      To compute the average value of sin(x)cos(x) over the range 0.1 to 0.5.

    Correct Answer
    A. To compute the integral of sin(x)cos(x) over the bounds 0.1 - 0.5 using the Left Hand Rule.
    Explanation
    The aim/purpose of this code is to calculate the integral of sin(x)cos(x) over the bounds 0.1 - 0.5 using the Left Hand Rule. The Left Hand Rule is a numerical integration method that approximates the area under a curve by dividing it into small rectangles and summing their areas. In this case, the code specifically focuses on the integral of sin(x)cos(x) within the given bounds using this method.

    Rate this question:

  • 8. 

    What will this code produce when compiled and run?

    • A.

      This code won't run - there are syntax errors.

    • B.

      Area = 0.10345

    • C.

      Area = 0.12028

    • D.

      Area = 0.0875

    Correct Answer
    B. Area = 0.10345
  • 9. 

    What is the purpose / goal of this code?

    • A.

      Compute the integral of sin(x)cos(x) over range 0.1 - 0.5 using the Left Hand Rule.

    • B.

      This code won't run - there are syntax errors.

    • C.

      Compute the integral of sin(x)cos(x) over range 0.1 - 0.5 using the Trapezoid Rule

    • D.

      Compute the integral of sin(x)cos(x) over range 0.1 - 0.5 using Simpson's Rule

    Correct Answer
    C. Compute the integral of sin(x)cos(x) over range 0.1 - 0.5 using the Trapezoid Rule
    Explanation
    The purpose/goal of this code is to calculate the integral of the function sin(x)cos(x) over the range 0.1 - 0.5 using the Trapezoid Rule. The Trapezoid Rule is a numerical integration method that approximates the area under a curve by dividing it into trapezoids. This method is commonly used for numerical integration when the exact solution is difficult to obtain analytically.

    Rate this question:

  • 10. 

    Will this code produce the correct answer?

    • A.

      Yes, it will.

    • B.

      No - because we integrate past the right hand bound of 0.5 in this code.

    • C.

      No - because there is a syntax error, and the code won't even run!

    • D.

      No - because the formula used on line 7 is incorrect.

    Correct Answer
    B. No - because we integrate past the right hand bound of 0.5 in this code.
    Explanation
    The code will not produce the correct answer because it integrates past the right hand bound of 0.5. This means that the code is calculating the integral beyond the specified limit, which is an incorrect approach.

    Rate this question:

  • 11. 

    What is the purpose of this code?

    • A.

      Solve a 2nd order ODE using Euler's method

    • B.

      Integrate a constant function x = 1 from 0 to 10.

    • C.

      Solve a 1st order ODE using Euler's method

    • D.

      None of the above.

    Correct Answer
    A. Solve a 2nd order ODE using Euler's method
    Explanation
    The purpose of this code is to solve a 2nd order ordinary differential equation (ODE) using Euler's method. Euler's method is a numerical method used to approximate solutions to ODEs. By applying Euler's method to a 2nd order ODE, the code aims to find an approximate solution to the differential equation.

    Rate this question:

  • 12. 

    What can this code be used to simulate?

    • A.

      A swinging pendulum

    • B.

      A vibrating mass

    • C.

      Both of the above options.

    • D.

      None (neither) of the above options.

    Correct Answer
    C. Both of the above options.
    Explanation
    This code can be used to simulate both a swinging pendulum and a vibrating mass. The code likely includes mathematical equations and algorithms that can model the motion of both a swinging pendulum and a vibrating mass. By inputting the necessary parameters and initial conditions, the code can generate a simulation that accurately represents the behavior of these physical systems.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Nov 29, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jun 09, 2016
    Quiz Created by
    Archembaud
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.