When writing a block of code in which something can go wrong, where should you place the block? It should be placed in
a try block
.
When you create a segment of code in which something might go wrong you place the code in a ____ block?
When you create a segment of code in which something might go wrong, you place the code in
an error block
.
What method can be used to terminate an application?
One way in which you can terminate a process is using
the Process class’s Kill method
. This attempts to immediately stop the process and release its resources. You should use the method with care; as the program’s normal closing actions will not run, any unsaved data could be lost.
What property for a MonthCalendar object allows you to specify the last day that can be selected?
The MonthCalendar control allows the user to select a date using a visual display. You can limit the date and times that can be selected by
setting the MinDate and MaxDate properties
.
What file mode is used to open an existing file and empty the file once opened?
fopen() for an existing file in
write mode
In C, fopen() is used to open a file in different modes. To open a file in write mode, “w” is specified. When mode “w” is specified, it creates an empty file for output operations.
Is not lost when a computer loses power?
Data is not lost when a computer loses power, and it is referred to as
nonvolatile
. This is similar to a program saving data on to a disk. in a computer system. They exist on permanent storage devices.
When you think in an object oriented manner Everything is a N?
When you think in an object-oriented manner, everything is
an object
, and every object is a member of a method.
What is supposed to happen if the administrator kills the parent process?
If the main process dies, the OS
will take care of terminating the child processes
.
How can I tell if a process is running C#?
GetProcessById() function in C#. In the above code, we created a
function isRunning()
that checks if a process is running or not. The isRunning() function takes the process id as an argument and returns true if the process is running and returns false if it is not running.
How do you exit an application in Visual Studio?
Just Close() all active/existing forms
and the application should exit.
What is MonthCalendar C#?
MonthCalendar is
a selectable calendar widget
. On the MonthCalendar, a user can select a day, or a range of days. The user can also scroll through the months. This control provides many useful options. It is ideal for instant calendars.
What key combination can be used to run a program without debugging it?
F5 Runs the project with debugging. Execution continues until either a breakpoint is reached or the program ends. | F11 Step Into. Advanced to the next statement unless it is a method call in which it drops inside for line-by-line. | Ctrl + F5 Runs the project without debugging. |
---|
What kind of a class might be considered to be fragile?
What kind of a class might be considered to be “fragile”?
A class that depends on field names from parent classes
.
What mode is required to create a new file?
Use the
file mode w
to create a new file
Use open(file, mode) with mode as “w” to open a new file in write mode. If file is an existing file, it will be overwritten.
Which mode is used to open a text file?
Mode Description | a+ opens a text file in both reading and writing mode. (It creates a file if it does not exist. Reading will start from the beginning but writing can only be done at the end) |
---|
What will happen when a file is opened in write mode and then immediately closed?
The file opening modes are: … “w” – Write mode – it opens a file in write mode to write data in it, if the file is opened in write
mode then existing data will be removed, it also creates a file, if the file does not exist
. “x” – Creates a file, if the file already exists, it returns an error.