CSCE 1030 - Exam 2 (Ch. 4-7) Review
Questions and Answers Graded A+
a) What library is needed for the square root function and
b) what is that function? - Correct answer-Library: <cmath>
Function: sqrt()
a) What library is needed for a float absolute value function and
b) what is that function? - Correct answer-Library: <cmath>
Function: fabs()
a) What library is needed for the absolute value function and
b) what is that function? - Correct answer-Library: <cstdlib>
Function: abs()
What library(s) is/are needed for random number generation? - Correct answer-
<cstdlib>
<ctime>
©COPYRIGHT 2025, ALL RIGHTS RESERVED 1
, a) What library is needed for the exit program function and
b) what is that function? - Correct answer-Library: <cstdlib>
Function: exit()
How do you exit a program? - Correct answer-exit(EXIT_FAILURE)
a) What library is needed for the "check if it's uppercase" function and
b) what is that function? - Correct answer-Library: <cctype>
Function: isupper()
a) What library is needed for the "check if it's lowercase" function and
b) what is that function? - Correct answer-Library: <cctype>
Function: islower()
a) What library is needed for the "check if it's a letter" function and
b) what is that function? - Correct answer-Library: <cctype>
Function: isalpha()
a) What library is needed for the "check if it's a number" function and
b) what is that function? - Correct answer-Library: <cctype>
Function: isdigit()
©COPYRIGHT 2025, ALL RIGHTS RESERVED 2
Questions and Answers Graded A+
a) What library is needed for the square root function and
b) what is that function? - Correct answer-Library: <cmath>
Function: sqrt()
a) What library is needed for a float absolute value function and
b) what is that function? - Correct answer-Library: <cmath>
Function: fabs()
a) What library is needed for the absolute value function and
b) what is that function? - Correct answer-Library: <cstdlib>
Function: abs()
What library(s) is/are needed for random number generation? - Correct answer-
<cstdlib>
<ctime>
©COPYRIGHT 2025, ALL RIGHTS RESERVED 1
, a) What library is needed for the exit program function and
b) what is that function? - Correct answer-Library: <cstdlib>
Function: exit()
How do you exit a program? - Correct answer-exit(EXIT_FAILURE)
a) What library is needed for the "check if it's uppercase" function and
b) what is that function? - Correct answer-Library: <cctype>
Function: isupper()
a) What library is needed for the "check if it's lowercase" function and
b) what is that function? - Correct answer-Library: <cctype>
Function: islower()
a) What library is needed for the "check if it's a letter" function and
b) what is that function? - Correct answer-Library: <cctype>
Function: isalpha()
a) What library is needed for the "check if it's a number" function and
b) what is that function? - Correct answer-Library: <cctype>
Function: isdigit()
©COPYRIGHT 2025, ALL RIGHTS RESERVED 2