1answer.
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
Alex787 [66]
3 years ago
12

Pick the simplest line of code to test if the word "BASIC" is stored in the variable text1.

Computers and Technology
1 answer:
mihalych1998 [28]3 years ago
4 0

The simplest line of code to test if the word "BASIC" is stored in the variable text1 is :

if ( text1 == "BASIC" ):

Explanation:

  • The simplest if-statement has two parts, a boolean "test" within parentheses ( ) followed by "body" block of statements within curly braces { }.
  • The test can be any expression that evaluates to a boolean value  true or false. The if-statement evaluates the test and then runs the body code only if the test is true.
  • You should use the equals() method of the String class to compare Strings.
  • == will do an object comparison between the strings in this situation, and although the value may be the same of the String objects, the objects are not the same.
  • Equals: a == b. The double equals sign =. A single symbol a = b would mean an assignment
You might be interested in
Which is the best response to receiving a threating text from a classmate
Yuri [45]

Answer:

send a threatening text in reply, then block the phone number block the phone number, then contact his phone service provider immediately delete the text, then report the incident to authorities ignore the message, then get a new cell phone number.

Explanation:

5 0
3 years ago
Read 2 more answers
What set of code correctly initializes all elements of the array ar to the value 0, given the declaration
Veronika [31]

Answer:

The correct answer is:

C. ndx = 0;

while (ndx < 3) {

ar[ndx] = 0;

ndx++;

}

Explanation:

The declaration given is:

int ar[3];

This means the array consists of three locations and is named as ar.

We know that the indexes are used to address the locations of an array and the index starts from 0 and goes upto to 1 less than the size of the array which means the indexes of array of 3 elements will start from 0 and end at 2.

Now in the given options we are using ndx variable to run the while loop.

So the code to assign zero to all elements of array will be

ndx = 0;

while(ndx<3)

{

ar[ndx] = 0;

ndx++;

}

Hence, the correct answer is:

C. ndx = 0;

while (ndx < 3) {

ar[ndx] = 0;

ndx++;

}

7 0
3 years ago
When the primary key of one relation is placed in a second relation to represent a relationship, the attribute in the second rel
s2008m [1.1K]
It is called a foreign key
6 0
3 years ago
I need help can yall help me
AnnZ [28]
8.75
I think this is the answer. The way you solve this is you divide 175 by 20 and then you have the answer.

7 0
3 years ago
Read 2 more answers
The Yacht club has a web site that consists of a picture of the yacht club room along with the yacht club rules on the left. On
lidiya [134]
External CSS style sheet
6 0
3 years ago
Other questions:
  • Which of the following is the best definition of a workplace policy?
    13·2 answers
  • _______________creates new markets separate to the mainstream; markets that are unknowable at the time of the technology's conce
    8·1 answer
  • Write a method that will receive 2 numbers as parameters and will return a string containing the pattern based on those two numb
    10·1 answer
  • Suppose that Alice wants to send Bob a 50 kilobyte message over a 1 Gbps link. The total time required to transmit the message (
    5·1 answer
  • When conducting research on the internet, what is a starting point for determining how to start the research?
    5·1 answer
  • Explain 3 ways you can be an upstander when seeing cyberbullying.
    13·2 answers
  • the list of available fonts in the fonts gallery may differ, depending on what fonts you have installed and the type of printer
    14·1 answer
  • You wouldn't think a simple shop like Dippy Donuts would be an interesting target for hackers. But look beyond the donuts and yo
    7·1 answer
  • You should always be afraid to use the internet<br><br> True or false?
    11·1 answer
  • Rocks created from compaction and cementation of sediments are called:
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!