Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

QUESTION 1 Given the function heading: int atoi(string s) What is the return typ

ID: 3879829 • Letter: Q

Question

QUESTION 1

Given the function heading: int atoi(string s) What is the return type?

QUESTION 2

Assuming int j = 4, int k = 8; evaluate the following expressions. j * (3 + k)

QUESTION 3

Given the function heading: int atoi(string s) What is the class of the argument?

QUESTION 4

Given the function heading: int atoi(string s) Is atoi("-10") a valid function call?

True

False

QUESTION 5

Assuming int j = 4, int k = 8; evaluate the following expressions. j % k

QUESTION 6

Assuming int j = 4, int k = 8; evaluate the following expressions. j / k

QUESTION 7

Given the function heading: int atoi(string s) Is atoi(81) a valid function call?

True

False

QUESTION 8

Given the function heading: int atoi(string s) What is the number of arguments?

QUESTION 9

Assuming int j = 4, int k = 8; evaluate the following expressions. (j - k) * ( j + k )

QUESTION 10

Assuming int j = 4, int k = 8; evaluate the following expressions. k % j

Explanation / Answer

Hi,

Ans 1 - The return type of this function is integer.

Ans 2- The expression will result in 44
Steps-
=4*(3+8)
=4*11
=44

Ans 3- The argument belongs to "string" class.

Ans 4- True
This is because string can hold the negative sign it can strore the numbers in the form of string too.

Ans 5- The answer is 4
This is because the modulus operator returns the remainder of the two operands. In this case if we divide 4 by 8, we get 4 as remainder.

Ans 6- The answer is 0
This is because because the divide operator returns the quotient of the two operands. In this case if we divide 4 by 8, we get 0 as result.

Ans 7-This is an invalid function call. This is because the datatype of the parameter of this function is string.We are passing integer in the argument of the function which is incorrect.

Ans 8- The answer is -48
=)(4-8)*(4+8)
=)(-4)*(12)
=)-48

Ans 9- The output is 0
This is because the modulus operator returns the remainder of the two operands. In this case if we divide 8 by 4, we get 0 as remainder.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote