Clunker Motors Inc is recalling all vehicles from model years 1995 – 1998 and 2004 – 2006. Given a variable modelYear write a statement that prints the message “RECALL” to standard output if the value of modelYear falls within those two ranges.
LANGUAGE: Visual Basic
CHALLENGE:
Clunker Motors Inc is recalling all vehicles from model years 1995 – 1998 and 2004 – 2006. Given a variable modelYear write a statement that prints the message “RECALL” to standard output if the value of modelYear falls within those two ranges.
SOLUTION:
If (modelYear >= 1995 And modelYear <= 1998) Or (modelYear >= 2004 And modelYear <= 2006) Then MessageBox.Show("RECALL") End If