224k views
4 votes
Write a program that asks the user for three strings.

Then, print out whether or not the first string concatenated to the second string is equal to the third string. Don’t worry about spaces at the beginning or ending of strings unless you want to! The code for the user to input the three strings is already written for you.

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!

import java.util.Scanner;

public class ThreeStrings

{

public static void main(String[] args)

{

Scanner input = new Scanner(System.in);


System.out.println("First String? ");

String first = input.nextLine();


System.out.println("Second String? ");

String second = input.nextLine();


System.out.println("Third String? ");

String third = input.nextLine();


//Start your code here.


}


}

User MadSeb
by
5.0k points

1 Answer

1 vote

Answer:

good luck djfjjdndnfjfjjfjfdsadd

User Mir Milad Hosseiny
by
4.3k points