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

This is from C++ class. Can someone answer these questions? What value is assign

ID: 3605959 • Letter: T

Question

This is from C++ class.

Can someone answer these questions?

What value is assigned to result for each of the following?(23-26) 23. if (a == (a+1)) result = 5; result = 6; result7; 24, result = 'B' - 'A' + 'a'; 25. result = a>b && b>a; 26. result= static cast (14.995); 27. Write a C++ statement that is equivalent to the following statement, but does not use the ‘YE', operator? x += y; 28. What are three pieces of information provided by a function header? 29. Is 0x2E5A equivalent to 0x2e5a? 30. What is another term (i.e., synonym) for a function declaration? Function definition

Explanation / Answer

Q23-
The result variable will be assigned result=7 because if(a==(a+1)) will be false so result=5 will not execute
then reult will be assigned 6 after the if condition and at the end result will be 7 so at the end result=7.

Q24-if result variable is of type integer then result will be 98 and if it is of type char then result=b;
Q25-result will be false as both the condition cannot be true and we have && operator so one of the condition will be false
so the result will be false.
Q26-result will be 14 as it is static casted to integer type.
Q27- x=x+y;
Q28- The three peices of information provided by function header is
1- function return type
2-function name
3-function parameterlist

Q29-Yes 2E5A and 2e5a both are equivalent as hexadecimal is case insensitive.

Q30-Function signature is the another name for function declaration.

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