You are on page 1of 4

AB REPORT#

TASK:

NTRODUCTION:
A switch condition/statement allows a variable to be tested for
equality against a list of values. Each value is called a case, and the
variable the entered variable is checked for each case.

To make a variable being checked, for only a single case and then
stop the process if the case is true we use a function called

When the break statement is encountered inside a loop, the loop is


immediately terminated and program control resumes at the next
statement.

Secondly we used another function in this program called,

In computer programming, a Default parameter (also called an


optional parameter) is a function that has a default value provided
to it. If the user does not supply a value for this parameter, the
default value will be used.
The following screenshot shows the build-up of the program:

Switch
Break
Default

Are the functions which are used in this program and they are
defined in the introduction of the report.
The result that we got on the console window can be seen in the
screenshot below:

SULT#2
(This result shows that if we enter a value that is not defined so the
“default” will perform its function and Invalid grade will be printed out on
the screen)

You might also like