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
Your friend decides to create a spreadsheet containing vocabulary terms and their definitions to help prepare for the unit test
Nataly_w [17]

Answer:

The answer is SORT

Explanation:

Just did the test :)

6 0
3 years ago
Which of the following is a feature of Big Data? Group of answer choices Its datasets are at least a petabyte in size. It is gen
Serggg [28]

Answer:

Its data sets are at least a petabyte in size.

Explanation:

Big data data sets are of huge size to perform the computations using modern techniques.

6 0
4 years ago
Which of these is not a sub-claim "Our Clean Power Plan" uses to support its main claim? The CPP protects public health. The CPP
Leno4ka [110]
The CPP cleans the air statement is not a sub-claim of Our Clean Power Plan.

It is the efforts of President Barrack Obama and the U.S. Environmental Protection Agency that has the main goal of lessening to cutting carbon pollution from the present power plants
4 0
3 years ago
Read 2 more answers
Select the correct answer.
Naddika [18.5K]

the answer is style, because it is a game developemnt. you need style

7 0
3 years ago
Read 2 more answers
Which position is expected to be at the center of the action providing complete technology solutions for a business?
dedylja [7]

IT Manager is expected to be at the center of the action providing complete technology solutions for a business.

Explanation:

An Information Technology Manager (IT Manager) is responsible for implementing and maintaining an organization's technology infrastructure.

IT Manager Roles:

  • Monitors the organization's operational requirements
  • Manages the data center
  • Maintains information technology strategies
  • Manages staff
  • Maintains a safe and secure work environment
  • Initiates, coordinates, and enforces systems, policies, and procedures

Education and Experience Requirements:

  • Bachelor’s or master’s degree in a computer science
  • Five or more years of IT work experience
  • Optional product or system certification
4 0
4 years ago
Other questions:
  • To erase an entire entry in a cell and then reenter the data from the beginning, press the ____ key.
    5·1 answer
  • In statistics, what is the mode of a data set?
    6·2 answers
  • What are some “creatures/animals” that Rex imitates?
    14·1 answer
  • A speech why friends are important 2 min​
    11·1 answer
  • How to wire two separate switches & lights using the same power source?
    14·1 answer
  • Field whose data type is ____ can contain any characters.
    6·1 answer
  • তথ্য ও যোগাযোগ প্রযুক্তির প্রশ্ন(45)10 সংখ্যাটির সমতুল্য মান?
    14·1 answer
  • All banks follow the same guideline for determining if an applicant qualifies for a loan.
    13·1 answer
  • Tax preparation software can help prepare and file your taxes by _________.
    7·1 answer
  • What is a presentation program? Name any<br> presentation programs.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!