subject

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?

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 07:20, Hcalhoun21
Write a pseudocode solution for each of these problems. 1. design a while loop that lets that user enter a number. the number should be multiplied by 10, and the result stored in a variable named product. the loop should iterate as long as product contains a value less than 100. 2. design a do-while loop that asks the user to enter two numbers. the numbers should be added and the sum displayed. the loop should ask the user whether he or she wishes to perform the operation again. if so, the loop should repeat; otherwise it should terminate. 3. design a for loop that displays the following set of numbers: 0, 10, 20, 30, 40, 50 100. 4. design a nested loop that displays 10 rows of # characters. there should be 15 # characters in each row. 5. convert this for loop to a while loop. declare integer count for count = 1 to 50 display count end for 6. find the error in the following pseudocode. declare boolean finished = false declare integer value, cube while not finished display “enter a value to be cubed.” input value; set cube = value ^ 3 display value, “ cubed is “, cube end while
Answers: 2
image
Computers and Technology, 23.06.2019 23:30, yasarhan2
Match the following errors with their definitions. a. #name b. #value c. #ref d. 1. when a formula produces output that is too lengthy to fit in the spreadsheet cell 2. when you enter an invalid cell reference in a formula 3. when you type text in cells that accept numeric data 4. when you type in a cell reference that doesn’t exist
Answers: 1
image
Computers and Technology, 24.06.2019 00:00, marika35
Visualizing a game of “tag” to remember the meaning of contagious
Answers: 3
image
Computers and Technology, 24.06.2019 07:20, djs1002
Ingrid started speaking about her slide presentation. when she clicked to th"third slide, which had just a picture of an elephant, she forgot what she wassupposed to talk about. what could ingrid do to avoid this situation in thefuture? oa. print handouts for her audience. ob. add presenter's notes to each slide. oc. add a video to each slide. od. save her slide presentation to a flash drive
Answers: 2
You know the right answer?
Given a variable modelYear and a String modelName, write a statement that assigns true to recalled i...

Questions in other subjects: