1.
You are developing a Windows forms application used by a government agency. You need to develop a distinct user interface element that accepts user input.
This user interface will be reused across several other applications in the organization.
None of the controls in the Visual Studio toolbox meets your requirements; you need to develop all your code in house.
Which of the following actions should you take?
Correct Answer
B. Develop a custom control for the user interface.
Explanation
You need to develop a custom control because you need reusable functionality but also want to develop the code in house.
You cannot use Windows Forms because they cannot be reused easily.
You cannot use console applications because they do not provide distinct user interface.
You cannot buy a control from third-party because you need to develop the code in house.
2.
You are developing a user interface component that responds to user actions such as keystrokes.
Which of the following programming constructs should you use to accomplish this requirement?
Correct Answer
A. Event
Explanation
Events are generated when users take an action such as pressing keystrokes.
You need to handle these events to respond to user actions.
3.
You need a Windows Form similar to the W_RecForm form that is being already used by the application. However, you need a couple of extra controls on your form that are not available on W_RecForm. You need to make sure that you accomplish this requirement with the least coding effort. In future, if the W_RecForm is enhanced, you need to make sure that those enhancements are available in your form as well.
What should you do?
Correct Answer
B. Use visual inheritance to inherit the new form from W_RecForm. Add the new functionality to the new control.
Explanation
You need to use visual inheritance to inherit the new form from W_RecForm. Add the new functionality to the new control. Copying the code for W_RecForm does not work because future changes to the W_RecForm aren’t automatically carried forward to the new form. Modifying the code for W_RecForm does not work because you don’t need to change anything that is already working. Converting the W_RecForm to a custom control requires additional programming efforts.
4.
You are developing a Windows application. The user needs to work with multiple windows of the application at the same time and needs a simplified interface.
The application needs to be compatible with different display configurations, such as multiple monitors.
Which of the following interfaces should you create?
Correct Answer
C. Create a Single Document Interface (SDI) Application. Open multiple instances of the application.
Explanation
MDI applications are complex, and implementing support for multiple monitors is tricky in an MDI application.
Because the user wants a simple interface, creating a single document interface (SDI) application and opening multiple instances of the application make up the best course of action.
You can switch between multiple application windows by using the Windows taskbar.
5.
You need an application that updates the inventory every morning when you log in to the workstation. If an error occurs during update, the application needs to log messages to a text file. The application doesn’t need any user interaction. You want to automate the process that launches the application.
You want to minimize the efforts for developing, installing, and updating the application.
Which type of application should you create?
Correct Answer
D. Console application
Explanation
You need to develop a console-based application.
A console-based application provides minimal or no user interface and requires the least effort to program, install, and update.
You can use the Windows Startup settings to launch the console application automatically when the user logs in.
Finally, the console application can also log messages to a test file.
6.
You are developing a data-entry application that receives user input in multiple data fields. The application allows users to enter the data either by using a keyboard or by using a bar-code scanner. When a code is entered, a picture of the product appears onscreen.
The application also needs to log its operation to a console window.
Occasionally, the operator will look at the console window to monitor communication with the scanner.
What project should you choose to create such an application?
Correct Answer
D. A Windows Forms application project with the Output type set to Console Application
Explanation
To enable reading from or writing to the console from a Windows Forms application, set the project’s Output type to Console Application in the project’s properties.
If you set the Output type to Windows Application, you lose any input or output that you send to the command line.
7.
You are developing an application that receives orders over the Internet via Electronic Data Interface (EDI).
The application needs to run constantly the background and wait for orders.
There is no user interface.
The application writes messages to the Windows application event log.
The application must continue to run even after a user logs off from the computer.
Which type of application should you develop for this requirement?
Correct Answer
A. Windows Service application
Explanation
The nature of Windows services make them ideal for creating long-running programs that run in the background and do not provide any direct user interaction.
Because a Windows service can run in the background, it does not need a logged-on user to function.
Windows services run in their own Windows session in the specified security context.
8.
You are developing an application that writes messages to the Windows application event log for the local machine.
What should you use to view the messages written by the application?
Correct Answer
A. Event Viewer
Explanation
Use the Windows Event Viewer utility to view the messages in event logs.
The event viewer messages cannot be opened directly by Notepad.
The XPS Viewer can open only the XPS files.
The Remote Desktop Connection utility is used to connect to remote computers, but the question is in the context of a local computer.
9.
You are developing a new Windows service application.
The application contains three different Windows services.
Each service will have a different start type.
Which of the following classes will help you perform the installation tasks specific to each service?
You must suggest a solution that requires the least coding effort.
Correct Answer
B. System.ServiceProcess.ServiceInstaller class
Explanation
The System.ServiceProcess.ServiceInstaller class performs the installation tasks specific to a single Windows service, such as setting the ServiceName and StartType.
The ServiceProcessInstaller class performs installation tasks common to all the Windows services in an application.
The Installer and ComponentInstaller classes are not specifically useful for configuring a Windows service application.
10.
You are developing a new Windows service application that process orders.
The system administrator must be able to suspend order processing while maintenance operations are in progress.
When maintenance operations are completed, order processing must be resumed without the loss in any information. How should you configure this Windows service?
Correct Answer
B. Set the CanPauseAndContinue property of the service to true.
Explanation
The value of the CanPauseAndContinue property indicates whether the service can be paused and resumed without losing information.
When you override the OnPause and OnContinue methods, you can specify the actions that need to be taken when a Windows service is paused or resumed.
11.
What is an IDE?
Correct Answer
B. Integrated Development Environment which allows coders to code programs
Explanation
An IDE is an Integrated Development Environment that provides a comprehensive set of tools and features for programmers to write, debug, and manage their code. It offers a user-friendly interface, code editors, compilers, and other development tools to streamline the coding process. With an IDE, coders can efficiently write and organize their programs, access libraries and frameworks, and debug their code for any errors or issues. It is a crucial tool for software development as it enhances productivity and simplifies the coding experience.