Electrical Engineering  >  EXAM  >  University of WaterlooECE 150FIinalExam-Fall2016 - Solution-vF17 (All)

University of WaterlooECE 150FIinalExam-Fall2016 - Solution-vF17

Document Content and Description Below

Question 1: True or False [21 Marks] Record your answer on the Scantron card as follows: Fill in the A circle for TRUE Fill in the E circle for FALSE If you fill in more than one circle it will be ... deemed to be incorrect. +3 marks for each correct answer, 0 marks for each instance of no response, –1 mark for each incorrect answer SCANTRON Question 1: Given the following two functions: int arraySum1(int num, int* pArray) { int i = 0; int sum = 0; while (i < num) { sum += *(pArray+i); i += 1; } return sum; } int arraySum2(int num, int array[]) { int sum = 0; for (int i = num; i > 0; --i) sum = array[i-1] + sum; return sum; } arraySum1() and arraySum2() will produce the same return value if given the same input values. Answer: TRUE SCANTRON Question 2: The following code: #include <iostream> using namespace std; void strSet(char* target, const char* source) { while(*source) *target++ = *source++; } int main() { char A[100]="Freddy Mercury"; char B[100]="Martha"; strSet(A, B); cout << A << endl; return 0; } will output “Martha” to the console [Show More]

Last updated: 3 years ago

Preview 1 out of 17 pages

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)
Preview image of University of WaterlooECE 150FIinalExam-Fall2016 - Solution-vF17 document

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Reviews( 0 )

$11.00

Buy Now

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Instant download

Can't find what you want? Try our AI powered Search

66
0

Document information


Connected school, study & course


About the document


Uploaded On

May 16, 2021

Number of pages

17

Written in

All

Seller


Profile illustration for Muchiri
Muchiri

Member since 4 years

209 Documents Sold

Reviews Received
19
5
1
1
6
Additional information

This document has been written for:

Uploaded

May 16, 2021

Downloads

 0

Views

 66

Document Keyword Tags

Recommended For You

Get more on EXAM »

$11.00
What is Scholarfriends

Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·