Boolean Expressions

Write a condition that will test for:

a. Is a number num greater than or equal to 1?

b. Is a number num less than or equal to 10?

c. Is a number num between 1 and 10 inclusive?

d. Is a number num not between 1 and 10 inclusive?

e. Is a character ch an uppercase letter?

Selection

Consider the following code fragment:

   int x, y;
   printf ("Enter two integers (separated by a space): ");
   scanf("%d %d", &x, &y);

   if ((x >= 3) && (y <= 7))
      printf ("A");
   else
      printf ("B");

   if ((x >= 3) || (y <= 7))
      printf ("C");
   else
      printf ("D");

   if (( x > 3) && (y < 7))
      printf ("E");
   else
      printf ("F");
   
   if (( x > 3) || (y < 7))
      printf ("G");
   else
      printf ("H");
   

What is the output produced if the user enters:

a. 3 7

b. 4 6

c. 2 7

d. 2 8

Problem Statement

Wage roll employees are paid an hourly rate. However, if the number of hours worked is greater than 40 hours in one week, wage roll employees are paid an overtime wage that is 1.5 times their hourly rate for the hours over 40. Write a program to compute a wage roll employee's gross pay for a week given her pay rate and hours worked.

The output of this program might look like:

   Enter the hourly pay rate: 12.50
   Enter the number of hours worked: 45
   Gross pay for this week is $593.75.