MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

ALGORITHMS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following variables names is an example of camel case?
A
totalScore
B
TOTALSCORE
C
TotalScore
D
None of the above
Explanation: 

Detailed explanation-1: -Some examples of CamelCase variable names would be UserName, BirthDate, intUserAge and strUserName. Kebab-case is discouraged in many computer languages due to the dash being interpreted as a mathematical minus sign. In some languages, CamelCase is encouraged in the developer documentation best practice.

Detailed explanation-2: -camelCase is a naming convention in which the first letter of each word in a compound word is capitalized, except for the first word. Software developers often use camelCase when writing source code. camelCase is useful in programming since element names cannot contain spaces.

Detailed explanation-3: -Example, firstName, lastName, actionEvent, printArray( ), etc. The Upper camel case also known as the title case, where the first character of the first word is in uppercase. This convention is usually followed while naming the classes and interfaces. For example, Employee, Printable, etc.

Detailed explanation-4: -Classic C doesn’t use camel-case; I’ve written code in camel-case in C, and it looks weird (so I don’t do it like that any more). That said, it isn’t wrong-and consistency is more important than which convention is used.

There is 1 question to complete.