Lab 5

You might also like

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

Lab 5

1. Fill in the blank.

a) Statement is a ___specification_______to be taken by the computer as the


program executes.
b) An Expression is a Combination of both __operators____and__operands_____.
c) Operators act on___operands_____.
d) Operators are divided into____unary____, ___binary_____ and
____ternary____.
e) Several statements grouped together in braces ({ and }) are called
a(n)______compound statements_____.

2. Give an example of Arithmetic Operator, Relational Operator and Logical Operator.


Subtraction ‘-‘, Greater than ‘>’, AND ‘&&’

3. Write a C program to calculate employee weekly pay. The program is required to


read the employee name, his total number of regular hours worked, total overtime
hours and hourly wage rate. Weekly pay is calculated as payment for regular hours
worked, plus payment for overtime hours worked. Payment for regular hours worked
is calculated as (wage rate times regular hours worked); payment for overtime hours
worked is calculated as (wage rate times overtime hours worked times 1.5). Display
the employee name and his weekly pay on the screen.

You might also like