Question
Question 1 it is enough to follow best practices and coding conventions 80% of the time options: True False Question 2 indenting is cumulative, i.e.
Question 1 it is enough to follow best practices and coding conventions 80% of the time
options:
True False
Question 2 indenting is cumulative, i.e. if we are inside of a double loop, we are indented once per loop
options:
True
False
Question 3 Which of the following is not a good programming practice?
options:
Commenting
Using short easy names for variables
Using descriptive names for variables
Following the guidelines of the group/team/industry
Question 4 The only single letter variable name should be the index of a for loop
options:
True False
Question 5 indentation is a convention which depends on the company/team
options:
True
False
Question 6 A header should give the following information
options:
Name of the file
purpose
Author name i.e. a way to contact them
all of the above
Question 7 Best Programming Practices are important because
options:
We need to follow the guidelines of our company/team/industry
We maintain code and need it to be as clear as possible
We sometimes need to update our own code and it may have made sense a long time ago but we may not remember it
all of the above
Question 8 a variable names should be named using Hungarian notation, i.e. they should be of the form typeFollowedByTheName is camelCasing
options:
True
False
Question 9 A function name is best defined as a verb
options:
True False
Question 10 In the following loop for (i = 0; i< 12; i++ ) { int months[] = {"jan", "feb", "mar", "apr", "jun", "jul", "aug", "sept", "oct", "nov", "dec"}; .... }
options:
the array gets created and destroyed for every iteration
The months are not going to change so the creation of the array month should move out of the loop.
both of the above
It is only a loop..
Question 11 The inside of any block is indented by one.
One = one tab or the equivalent of 4 spaces.
options:
True
False
Question 12 Cuddling an else means that the statement looks like this: if (...) { // can be on the next line } else { }
options:
True
False
Question 13 A function can be of any length, including a couple of pages long
options:
True
False
Question 14 The arguments against cuddling an else are
options:
easy to move the code around
easy to comment the else code
both of the above
none of the above
Question 15 Indentation does not affect compilation
options:
True
False
ANSWER ALL PLEASE
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started