Lab 02 Q&a

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Questions and Answers Concerning LAB 02

Name: Daniyal
Date: 01/28/33

Answer 1:
Selection program control can jump to another code or statements on the basic of defined
decision. While in Sequential program control occurs when code statements are executed in
sequence, one at a time, and without any decisions or loops -- like following a recipe.

Answer 2:
We used Selection program controls in our code in the form of IF statements based on choices
if (choices == 1) {// code} OR if (choices == 2) {// code}

Answer 3:
A differential piecework schedule is based on the employee’s productivity.

Answer 4:
Numeric (Integer and Double)

Answer 5:
Both are selection statements but in if else first the condition is checked and accordingly the
work is done. In switch statement there may or may not be multiple cases according to which the
case which is true is executed otherwise the default case is executed.
When there are many conditions then if-else becomes complex and large in size. It is better to
use switch instead. Switch statement is used when there are multiple conditions to be checked.
Since ours code was made for only two selections therefore it’s good to use if else code blocks.

Answer 6:

DropDown having options for Flat rate and Differential rate.

You might also like