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
elixir [45]
3 years ago
6

Write a program that asks the user for three strings. Then, print out whether the first string concatenated to the second string

is equal to the third string. Here are a few sample program runs:
Sample Program 1:

First string? pepper
Second string? mint
Third string? peppermint
pepper + mint is equal to peppermint!
Sample Program 2:

First string? go
Second string? fish
Third string? donuts
go + fish is not equal to donuts!
public class ThreeStrings extends ConsoleProgram
{
public void run()
{
code
}
Computers and Technology
1 answer:
ipn [44]3 years ago
8 0

Answer:

import java.util.Scanner;

public class num5 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter The First String");

       String str1 = in.next();

       System.out.println("Enter The Second String");

       String str2 = in.next();

       System.out.println("Enter The Third String");

       String str3 = in.next();

       String oneAndTwo = str1+str2;

       if(str3.equals(oneAndTwo)){

           System.out.println(str1+" + "+str2+" is equal to "+str3+"!");

       }

       else

           System.out.println(str1+" + "+str2+" is not equal to "+str3+"!");

   }

}

Explanation:

  • Implemented in Using Java Programming Language
  • Import Scanner Class to prompt and receive users' input
  • Create three string variables and store the three values entered by the user (str1, str2 and str3)
  • Concatenate str1 and str2 using the + operator and assign to a new variable
  • Use the if statement with Java's .equals() method to check for equality of the new string with the third string
  • Print the appropriate message if the equal or not
You might be interested in
3.6 lesson practice
Thepotemich [5.8K]

what...? how is this a question??

5 0
4 years ago
Complete the statement by entering the appropriate term in the space below.
Vera_Pavlovna [14]

Answer:

Probably "compress", but these days the common answer is "upload to cloud".

Explanation:

Compressing the files is an easy way to reduce their size, unless most of the size is in already compressed, high-entropy formats (like mp3, jpeg or mp4).

The common compression format is .ZIP - you've probably seen it countless times, but other ways like RAR, 7Z are also popular, while Linux users mostly deal with tar.gz, tar.bz2 or tar.xz

On the other hand, the standard practice these days is to upload the presentation to a cloud service, like GSheets or Office PowerPoint 365, which gets rid of the limits of email filesize, while providing a convenient web-app way to view the presentation without downloading (and it doesn't clutter their inbox space or hard drives)! Alternatively, one other way to email any large file (not just a presentation) includes uploading it to some service like DropBox, GDrive or anything similar.

7 0
3 years ago
Read 2 more answers
Write the SQL commands to obtain the following information from the system catalog:
netineya [11]

The SQL commands to obtain the information from the system catalog is illustrated below.

<h3>How to illustrate the the SQL commands?</h3>

It should be noted that SQL commands are instructions to communicate with a database to perform a task.

List every table that you created. - SHOW TABLES

List every field in the Client table and its associated data type. - SHOW COLUMNS FROM CUSTOMER

List every table that contains a field named TaskID. - SELECT TBNAME FROM SYSCOLUMNS WHERE COLNAME = 'TaskID'

Learn more about SQL on:

brainly.com/question/25694408

#SPJ1

3 0
2 years ago
An attacker captures an encrypted message. he tries decrypting with every possible key until the decryption process reveals a se
strojnjashka [21]
Brute force. He's not using any information to mathematically derive information about the key, just trying all possibilities. With modern key sizes this is typically not a successful approach.
8 0
3 years ago
Which of the following is a negative effect of the rise in agricultural technology following World War II?
Whitepunk [10]
Is it a multiple choice
6 0
3 years ago
Other questions:
  • Write a program that responds to a positive integer passed on the command line with the number of bits needed to express that nu
    10·1 answer
  • Give two separate print statements: one will print your name, the other will print your major. Ensure that both will print on th
    15·1 answer
  • The smallest building block of a wireless lan is a ______.
    5·1 answer
  • List 5 anti-virus products currently in use
    15·1 answer
  • Jason Has A Science Video Project, As He Creats His Project, He Saves, Then Comes Back A Minute Later. The File Is Now Unreadabl
    8·2 answers
  • /*Implement a class Address . An address has a house number, a street, an optional
    5·1 answer
  • Please help I will mark brainliest ⚡️⚡️⚡️⚡️
    12·1 answer
  • So im new how exactly does this point system work???​
    6·1 answer
  • Insert in the Current Values section at the top of the worksheet summary functions that use the range I9:I54. In cell I2, calcul
    7·1 answer
  • Rachelle is writing a program that needs to calculate the cube root of a number. She is not sure how to write the code for that
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!