Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Clunker Motors Inc. is recalling all vehicles in its Extravagant line from model years 19992002 as well as all vehicles in its Guzzler line from

Clunker Motors Inc. is recalling all vehicles in its Extravagant line from model years 19992002 as well as all vehicles in its Guzzler line from model years 20042007. A boolean variable named recalled has been declared. Given a variable modelYear and a String modelName, write a statement that assigns true to recalled if the values of modelYear and modelName match the recall details and assigns false otherwise.

I have

if((modelYear>=1999 && modelYear<=2002 && modelName=="Extravagant") || (modelYear>=2004 && modelYear<=2007 && modelName=="Guzzler")){ recalled=true;} else recalled = false;

This might be too much if they already state these variables as boolean values. Is this correct according to the directions?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions