answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alik [6]
2 years ago
8

Clunker Motors Inc. is recalling all vehicles in its Extravagant line from model years 1999-2002 as well all vehicles in its Guz

zler line from model years 2004-2007. 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.
Computers and Technology
1 answer:
irina1246 [14]2 years ago
5 0

Answer:

Following are the program in the Python Programming Language.

#set user defined integer variable

modelYear=int(input("Enter year from 1999 to 2002 or from 2004 to 2007: "))

#set user defined string variable

modelName=input("Enter the vehicle name 'Extravagant' or 'Guzzler': ")

#set if statement

if((modelYear>=1999 and modelYear<=2002 and modelName=="Extravagant") or (modelYear>=2004 and modelYear<=2007 and modelName=="Guzzler")):

 recalled=True    #if the statement is true

else:

 recalled=False   #if the statement is not true

print(recalled)    #print boolean type

<u>Output</u>:

Enter year from 1999 to 2002 or from 2004 to 2007: 2001

Enter the vehicle name 'Extravagant' or 'Guzzler': Extravagant

True

Explanation:

Here, we set a user defined integer data type variable "modelYear" and assign value from the user then, we set a user defined string data type variable "modelName" and assign value from the user.

Then, we set the if statement and pass the condition when modelYear is greater than equal to 1999 and less than equal to 2002 and modelName is equal to "Extravagant" or modelYear is greater than equal to 2004 and less than equal to 2007 and modelName is equal to "Guzzler" than "recalled" is equal to True otherwise "recalled" is equal to False.

Finally, we print the value of the variable "recalled".

You might be interested in
If you’d like to have multiple italicized words in your document, how would you change the font of each of these words?
Mariana [72]
You select the words and then format - italics
5 0
2 years ago
Read 2 more answers
Annabeth has been using a public cloud to store and access her documents. Which drawback of a public cloud should she be aware o
Flura [38]

<u><em>i just to the test on Plato and it said that A. accessibility is wrong  the correct answer is d  security #homeschoolrocks</em></u>

5 0
2 years ago
Jason is working on a web page that includes Q&amp;A interactions. Which option should Jason select to engage users in the inter
Vaselesa [24]
E should be the correct answer
0 0
2 years ago
Read 2 more answers
Which command suppresses the visibility of a particular Row or column in a worksheet?
leonid [27]

Answer:

Ctrl+Space is the keyboard shortcut to select an entire column.

Explanation:

When you press the Shift+Space shortcut the first time it will select the entire row within the Table.  Press Shift+Space a second time and it will select the entire row in the worksheet.

The same works for columns.  Ctrl+Space will select the column of data in the Table.  Pressing the keyboard shortcut a second time will include the column header of the Table in the selection.  Pressing Ctrl+Space a third time will select the entire column in the worksheet.

You can select multiple rows or columns by holding Shift and pressing the Arrow Keys multiple times.

4 0
2 years ago
Write MVCTester.java. When the program starts, the initial screen displays a button labeled "add", a blank text area, and a text
Debora [2.8K]

Answer:

Kindly note that, you're to replace "at" with shift 2 as the brainly text editor can't take the symbol

Explanation:

import java.awt.event.*;  

import java.awt.geom.Area;

import javax.swing.*;

class MVCTester implements ActionListener{

JButton b; //button

JTextField t1; //textfiled

JTextArea area; //text area

MVCTester(){

JFrame f=new JFrame("Button Example");

//button

b=new JButton("add");  

b.setBounds(0,0,125,27);  

f.add(b);  

b.addActionListener(this);  

//textfiled

t1=new JTextField();  

t1.setBounds(0,161,125,24);  

f.add(t1);

//textarea

area=new JTextArea();  

area.setBounds(0,28,123,130);  

f.add(area);

area.setColumns (17);

area.setLineWrap (true);

area.setWrapStyleWord (false);

f.setSize(125,225);

f.setLayout(null);  

f.setVisible(true);

}

"at"Override

public void actionPerformed(ActionEvent arg0) {

Control c=new Control(area,t1,b);

}  

}  

class Control {

Control(JTextArea area,JTextField t1,JButton b){

//simple logic getting text of text area adding text of textfiled and setting the text to text area

area.setText(area.getText()+t1.getText()+"\n");

t1.setText("");

}

}

public class Modal{

public static void main(String[] args) {  

MVCTester be=new MVCTester();

}

}

8 0
2 years ago
Read 2 more answers
Other questions:
  • In __________ mode, the data within an ip packet is encrypted, but the header information is not.
    15·1 answer
  • Which term describes a process by which malicious code can enter from a non-secure network, and make a hairpin, or sharp turn, a
    6·1 answer
  • Type two statements that use rand() to print 2 random integers between (and including) 100 and 149. End with a newline. Ex:
    8·2 answers
  • Alyosha was explaining to a friend the importance of protecting a cryptographic key from cryptoanalysis. He said that the key sh
    10·1 answer
  • Given is the array prices with 100 elements(prices[100]). The problem consists of two parts: 1. Find the highest price in the ar
    11·1 answer
  • Create the strAnalysis() function that takes 1 string argument and returns a string message. The message will be an analysis of
    15·1 answer
  • What types of messages flow across an SDN controller’s northbound and southbound APIs? Who is the recipient of these messages se
    15·1 answer
  • Match each scenario to the absolute value expression that describes it. 1. the distance moved when going backwards five spaces i
    13·2 answers
  • What are the primary IP addresses for DNS servers hosted on the x128bit, iskytap and cloudparadox domains
    8·1 answer
  • Plz help code practice for python
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!