{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# lab4 - and Blue(RGB values given by a user Colour Red Green...

This preview shows page 1. Sign up to view the full content.

ECC 3101- Computer Programming Lab Sheet 4 – switch statement 1. Rewrite the previous program- Lab 3, Question 1 , using the switch case statement. 2. Write a program that implements a simple calculator that reads 2 integers and math operator ('+', '-', '*', '/', '%') from the keyboard , print the answer and exit. Eg. output is as follows: 7 + 6 = 13 7 – 6 = 1 7 * 6 = 42 7 / 6 = 1.667 7 % 6 = 1 3. Write a program using switch statement to recognize a colour based on the value of Red, Green
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: and Blue (RGB) values given by a user. Colour Red Green Blue Black White 255 255 255 Red 255 Green 255 Blue 255 Yellow 255 255 4. Write a program that reads in two integers and determines and prints whether it is odd or even. [Hint: Use the modulus operator. An even number is a multiple of two. Any multiple of two leaves a remainder of zero when divided by 2.]...
View Full Document

{[ snackBarMessage ]}