Question: Write selection statement for each of the following. a) Write a selection statement to do the following: if hour less than or equal to 40,

Write selection statement for each of the following. a) Write a selection statement to do the following: if hour less than or equal to 40, salary = hour x wageRate, otherwise, salary = 40 x wageRate + (hours 40) x overTime Assume that all the variables are already declared, and their values are initialized. b) Check if a variable x is not equal to 0 and variable y is equal to 5, then write a display statement that displays valid data, otherwise display invalid data. c) Given an integer number x, check if x is even or odd, write a selection statement to do that. [Hints: Check if x is divisible by 2 or not, by checking the remainder of x divided by 2 is 0 or not]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!