EXERCISESGRADE_12
EXERCISESGRADE_12
a. Implement the program above in Java and Test it with some numbers
to see its correctness.
b. This algorithm needs to be improved with a range check. Write
pseudocode to reject the input of values less than zero for variables
Cost and sell.
a. Implement it in Java.
b. Alter the program on a to make sure that all the numbers entered
are between 1 and 500 inclusive. If any numbers fall outside
these limits, a replacement value is requested and entered.
5. Write the Java program to perform this task: accept the input of
a whole number from 1 to 4 inclusive and use a CASE
statement to: a. output the number (1 to 4 inclusive) that was
entered
b. output the word “ERROR” if a 1 to 4 inclusive number was
not entered.