Case-Based Critical Thinking QuestionsCase 1: Human Resources ApplicationAn application used by the human resources (HR) department needs to be improved. You need to use various string manipulation properties and methods to ensure all data entered by a user are accurate and stored correctly.
Each employee is assigned an employee code, such as F01234, which is stored in the strEmpCode variable. The first character is a letter for employment status (F for Full-time, P for Part-time). The next two characters are numbers representing the employee's department number. The last three characters are numbers representing a unique value for each individual employee. Which of the following statements assigns the employee's department to the strDept variable?

A. strDept = strEmpCode.Substring(0, 1)
B. strDept = strEmpCode.Substring(1)
C. strDept = strEmpCode.Substring(0, 2)
D. strDept = strEmpCode.Substring(1, 2)

Answer: D

Computer Science & Information Technology

You might also like to view...

The ____ in a flowchart is the start/stop symbol.

A. parallelogram B. rectangle C. diamond D. oval

Computer Science & Information Technology

Case-Based Critical Thinking QuestionsCase 1You have just starting working at Quantum Company. As a new programmer, you have been asked to review and correct various pseudocode.The following pseudocode is not working properly. The message should display 10 times. This is not working because the programmer made which common loop mistake?   for count = 1 to 10       output "Hello"   endfor

A. Neglecting to initialize the loop control variable B. Neglecting to alter the loop control variable C. Using the wrong comparison with the loop control variable D. Including statements inside the loop that belong outside the loop

Computer Science & Information Technology