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
When artists have a successful career, there is sometimes the need to collect all their works in an anthology album. Given main(
elixir [45]

Answer:

Answered below

Explanation:

public class BoxSet extends Album{

private boolean isCompleteWork;

private int numDiscs;

public void setIsCompleteWorks( boolean cw){isCompleteWorks = cw;

}

public boolean getCompleteWorks(){

return isCompleteWorks;

}

public void setNumDiscs(int discs){

numDiscs = discs;

}

public int getNumDiscs(){

return numDiscs;

}

public void printInfo(){

super.printInfo();

System.out.print(isCompleteWorks);

System.out.print(numDiscs);

}

}

3 0
3 years ago
Uppose a computer processor can perform about 3.8 billion operations per second. how many operations can it perform in 0.6 ​seco
Ratling [72]
We have information:
3.8 billion         1 second
x billion            0.6 second

To find out the number of operations we need to cross multiply these equations and solve for x.
3.8 * 0.6 = 1*x
x = 2.28 billion

In 0.6s computer can do 2.28 billion operations.
4 0
3 years ago
Read 2 more answers
Create a program named Auction that allows a user to enter an amount bid on an online auction item. Include three overloaded met
Olin [163]

Answer:

Explanation:

The following code is written in Java and creates the overloaded methods as requested. It has been tested and is working without bugs. The test cases are shown in the first red square within the main method and the output results are shown in the bottom red square...

class Auction {

   public static void main(String[] args) {

       bid(10);

       bid(10.00);

       bid("10 dollars");

       bid("$10");

       bid("150 bills");

   }

   public static void bid(int bid) {

       if(bid >= 10) {

           System.out.println("Bid Accepted");

       } else {

           System.out.println("Bid not high enough");

       }

   }

   public static void bid(double bid) {

       if(bid >= 10) {

           System.out.println("Bid Accepted");

       } else {

           System.out.println("Bid not high enough");

       }

   }

   public static void bid(String bid) {

       if (bid.charAt(0) == '$') {

           if (Integer.parseInt(bid.substring(1, bid.length())) > 0) {

               System.out.println("Bid Accepted");

               return;

           } else {

               System.out.println("Bid not in correct Format");

               return;

           }

       }

       int dollarStartingPoint = 0;

       for (int x = 0; x < bid.length(); x++) {

           if (bid.charAt(x) == 'd') {

               if (bid.substring(x, x + 7).equals("dollars")) {

                   dollarStartingPoint = x;

               } else {

                   break;

               }

           }

       }

       if (dollarStartingPoint > 1) {

           if (Integer.parseInt(bid.substring(0, dollarStartingPoint-1)) > 0) {

               System.out.println("Bid Accepted");

               return;

           } else {

               System.out.println("Bid not in correct format");

               return;

           }

       } else {

           System.out.println("Bid not in correct format");

           return;

       }

   }

}

3 0
3 years ago
How did larissa describe the process of roberto's release in chapter 4 and what was her answer to jonas question
Ksenya-84 [330]
What is the book and show page number?
8 0
3 years ago
Which sign or symbol will you use to lock cells for absolute cell reference?
jek_recluse [69]

Answer:asterisk

Explanation:

In spreadsheet applications, a reference to a particular cell or group of cells that does not change, even if you change the shape or size of the spreadsheet, or copy the reference to another cell.

3 0
3 years ago
Other questions:
  • business ethics chapter 7 jordan, a software engineer, is responsible for maintaining the private piece of his company's interne
    15·1 answer
  • Help i give 20 shekel
    9·1 answer
  • Write an if-else statement for the following: If user_tickets is less than 5, assign 1 to num_tickets. Else, assign user_tickets
    15·1 answer
  • Hello Answerers it would be great if you could answer this:
    12·2 answers
  • 5 disadvantage of assembly<br> level language​
    12·1 answer
  • Why should you delete files from your computer?
    8·2 answers
  • What is another name for control structure <br> Object<br> Sequence<br> Loop<br> Decision
    8·1 answer
  • name instances in the past where social media has kept you informed about the latest news around the country​
    15·2 answers
  • A ____________________ machine is used to gather or arrange in their proper sequence.
    9·1 answer
  • Explain employment opportunities in the networking field 
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!