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
Lerok [7]
3 years ago
8

Write a boolean expression that is true if s references the string end.

Computers and Technology
1 answer:
Musya8 [376]3 years ago
3 0

Boolean expressions are those expressions whose value can only be <em>true or false.</em>

The required boolean expression is: s == "end"  

From the question, we have the following highlights

  • The string variable is s
  • The string value is "end"

For the boolean expression to be true, then we need a <em>comparison operator.</em>

For this purpose, we make use of the == operator

Hence, the required boolean expression is: <em>s == "end"  </em>

Read more about boolean expressions at:

brainly.com/question/16843003

You might be interested in
Most Muslims are Sunni Muslims; however, the Shiites are a forceful minority in some parts of the Middle East. The Sunni-Shiite
Sever21 [200]
<span>Dispute who should be the leader of the Muslims after the death of Mohammed.<span> </span></span>
3 0
3 years ago
Give 5 examples for software ​
yuradex [85]

Answer:

  • Adobe Photoshop.

  • Picasa.

  • VLC Media Player.

  • Windows Media Player.

  • Windows Movie Maker

3 0
3 years ago
You are creating a story map about Mexico. After configuring the web app template, you launch the app to test it. When the app o
navik [9.2K]
Nbdjsksjsidjdjwkwejd
3 0
3 years ago
Create a class called Hokeemon that can be used as a template to create magical creatures called Hokeeemons. Hokeemons can be of
Viefleur [7K]

Answer:

See Explaination

Explanation:

/*****************************************Hokeemon.java********************************/

import java.io.File;

import java.io.FileNotFoundException;

import java.util.Scanner;

public class Hokeemon {

private String name;

private String type;

private int age;

public Hokeemon(String name, String type, int age) {

super();

this.name = name;

this.type = type;

this.age = age;

}

public Hokeemon() {

this.name = "";

this.type = "";

this.age = 0;

}

public String getName() {

return name;

}

public void setName(String name) {

this.name = name;

}

public String getType() {

return type;

}

public void setType(String type) {

this.type = type;

}

public int getAge() {

return age;

}

public void setAge(int age) {

this.age = age;

}

public String liveIn() {

if (this.type.equalsIgnoreCase("dwarf")) {

return "Mountain";

} else if (this.type.equalsIgnoreCase("elf")) {

return "Dale";

} else if (this.type.equalsIgnoreCase("fairy")) {

return "Forest";

} else {

return "Shire";

}

}

public boolean areFriends(Hokeemon other) {

if (this.type.equalsIgnoreCase(other.type)) {

return true;

} else if ((this.type.equalsIgnoreCase("dwarf") && other.type.equalsIgnoreCase("elf"))

|| (this.type.equalsIgnoreCase("elf") && other.type.equalsIgnoreCase("dwarf"))) {

return true;

} else if ((this.type.equalsIgnoreCase("hobbit") && other.type.equalsIgnoreCase("fairy"))

|| (this.type.equalsIgnoreCase("fairy") && other.type.equalsIgnoreCase("hobbit"))) {

return true;

} else {

return false;

}

}

public static Hokeemon[] getData(String file) {

Hokeemon[] hokeemons = new Hokeemon[8];

int i = 0;

try {

Scanner scan = new Scanner(new File(file));

while (scan.hasNextLine() && i < hokeemons.length) {

String line = scan.nextLine();

String[] data = line.split("\\s+");

String name = data[0];

String type = data[1];

int age = Integer.parseInt(data[2]);

hokeemons[i] = new Hokeemon(name, type, age);

i++;

}

scan.close();

} catch (FileNotFoundException e) {

System.err.println(e);

}

return hokeemons;

}

public static String getBio(Hokeemon[] hokeemons) {

String s = "";

for (Hokeemon hokeemon : hokeemons) {

s += "I am " + hokeemon.getName() + ": Type " + hokeemon.getType() + ": Age=" + hokeemon.getAge()

+ ", I live in " + hokeemon.liveIn() + "\n";

s += "My friends are: ";

for (Hokeemon hokeemon2 : hokeemons) {

if (hokeemon.areFriends(hokeemon2) && !hokeemon.equals(hokeemon2)) {

s += (hokeemon2.getName() + " ");

}

}

s += "\n";

}

return s;

}

atOverride

public String toString() {

return "Name " + name + ": Type " + type + ": Age=" + age + "\n";

}

}

/*******************************HokeemonMain.java**************************/

import java.util.Arrays;

public class HokeemonMain {

public static void main(String[] args) {

Hokeemon[] hokeemons = Hokeemon.getData("data.txt");

System.out.println(Arrays.toString(hokeemons));

System.out.println(Hokeemon.getBio(hokeemons));

}

}

/**********************************data.txt********************/

Noddy Dwarf 4

Legolas Elf 77

Minerva Fairy 33

Samwise Hobbit 24

Merry Hobbit 29

Warhammer Dwarf 87

Ernedyll Elf 19

Frodo Hobbit 18

3 0
3 years ago
A gamer typing their name into the computer is an example of:
vova2212 [387]

user input I think I'm not sure though

3 0
2 years ago
Read 2 more answers
Other questions:
  • 24 bit or 16 million colors is often called?
    7·1 answer
  • A number of LC-3 instructions have an "evaluate address" step in the instruction cycle, in which a 16-bit address is constructed
    6·1 answer
  • Answer the queston...........​
    7·2 answers
  • What output is generated by this for loop?
    6·1 answer
  • As marketing manager, you need to have ( blank) skills and (blank) skills.
    11·1 answer
  • What do u think a creative app must have? <br><br> Please answer the question ASAP!!
    5·1 answer
  • How many total cells can a worksheet window contain? If columns are labelled alphabetically, what will be the label for the cell
    15·1 answer
  • Programming Cycle. Arrange them in correct order​
    5·2 answers
  • In a computer-controlled greenhouse, a temperature sensor and a window motor are connected to the computer.
    10·1 answer
  • Your network uses a network address of 137. 65. 0. 0 with a subnet mask of 255. 255. 0. 0. How many ip addresses are available t
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!