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

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
Computers and Technology
1 answer:
zepelin [54]3 years ago
5 0

Answer:

import java.util.Scanner;

public class Main {

   public static void main(String[] args) throws Exception {

          Scanner myObj = new Scanner(System.in);

        //Request and receive first String

       System.out.println("Enter username");

       String firstString = myObj.nextLine();

       

       //Request and receive second string

       System.out.println("Enter second string");

       String secondString = myObj.nextLine();

       

         //Request and receive third string

       System.out.println("Enter third string");

       String thirdString = myObj.nextLine();

       //Concatenate the first and second string

       String concatA_B = firstString + secondString;

       

       if(concatA_B.equals(thirdString)){

           System.out.println("First String Concatenated to Second String is equals to the third String");

       }

       else{

            System.out.println("First String Concatenated to Second String is NOT equals to the third String");

       }

   }

}

Explanation:

  • Import Scanner Class
  • Request and Receive three variables from the user using the Scanner Class
  • Concatenate the first and second
  • Use the .equals() method to check for equality
You might be interested in
what are some of the challenges that could arise from setting up a file management system on a computer
seropon [69]
A virus maybe or ransomware
7 0
3 years ago
What Windows utility can enable you to shut down an unresponsive application?
boyakko [2]

Answer:

Task manager

Explanation:

Allows you to force quit applications.

4 0
2 years ago
Read 2 more answers
Why is malware dangerous
Sonbull [250]

Malware can be hugely damaging to businesses as well as individuals. Hackers often use malware to try and gain entry into an organisation's systems or networks, from where they can access valuable data to steal and sell on.

6 0
3 years ago
Read 2 more answers
Help me if you do then you get 10 points and brainliest
stellarik [79]

The answer is A. The earth was formed 4.54 years ago, and during those first serveral hundred million years, oceans, continents started to form.

A) Precambrian time.

3 0
3 years ago
Write a MIPS assembly language program that prompts for a user to enter a series of floating point numbers and calls read_float
LenaWriter [7]

Explanation:

Here if the value in the register $f2 is equals to the value in $f4, it jumps to the Label1. If it should jump when the value in the register $f2 is NOT equals to the value in $f4, then it should be

4 0
3 years ago
Other questions:
  • Which of these is not a combination of a keyboard and percussion musical instrument?
    13·1 answer
  • Can you answer my question it's a bit confusing to me! I'm adding brainlist too!
    8·1 answer
  • A user calls the help line and ask for some help installing a new keyboard. He isn't sure how to plug the keyboard into the comp
    15·1 answer
  • The major difference between a template and another document is in _____.
    7·1 answer
  • Where in the Formula tab on the ribbon would you find the Use in Formula function?
    11·2 answers
  • Business cards are generally designed so that this item stands out the most.
    8·1 answer
  • Your network has four Hyper-V hosts, which are running three domain controllers and about 10 member servers. Three of the member
    10·1 answer
  • You cannot then move and resize the control on the form as desired with your mouse TRUE OR FALSE​
    6·2 answers
  • In the following nested loop structure, which loop does the program EXIT first?
    6·1 answer
  • (Technical terms) The classification computer into five distinct phases.​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!