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
When law enforcement becomes involved, the need may arise to freeze systems as part of the evidence. There is also the likelihoo
Sindrei [870]

Answer:

Costs will cover a need for more customer data. The further explanation is given below.

Explanation:

  • It's the greatest problem for almost every company to provide the data with security.
  • This is possible for highly trained practitioners and the technical staff to take charge of it.
  • Complicated technologies would have been going to run together again to withstand these types of jobs.
  • Such problems play a major part in the decision-making process affecting the law enforcement authorities to locate the suspects to strengthen the organization.
  • To do something like this, there seem to be a lot of other good initiatives out there doing it.

There have been some cases in which major corporations have chosen not to include law enforcement:

  • There are many more electronic corruption going on, including money robbery, asset fraud, as well as machine assaults.
  • In such a bigger case, numerous institutions, such as large-scale ones, have gone through these circumstances to evaluate law enforcement to come to terms with cybersecurity.
5 0
3 years ago
Write the line of code to calculate the area of a circle with radius 3 and store it in a variable called
zloy xaker [14]

Answer:

area = 2.14 * 3 ** 2

Explanation:

No clue what language you use but this should be pretty universal. To find the area of a circle you use pi(r) ^ 2 or pi times radius squared

\pi r^{2}

In python it looks like this:

>>> area = 3.14 * 3 ** 2

>>> print(area)

28.26<em> <Printed text</em>

3 0
3 years ago
Do you think communities or countries can survive without the internet?why or why not?​
abruzzese [7]

Answer:

here

Explanation:

Generally, very few will survive without internet and some technology geek will die overnight due to lack of things to research. Most of the brand and business will lose their online presence in no internet mode

7 0
3 years ago
How do I use this without the spring?
poizon [28]

Answer:

put a spring in

Explanation:

duuuuuuuu

cy

6 0
3 years ago
What's the code?
lys-0071 [83]

Answer:

Explanation:

#include <iostream>

using namespace std;

// Recipe of single portion salad

int main()

{

   float Qing[3]={0.0,0.0,0.0};

   string ItemName[3]={" "," "," "};

   int qty=0;

   cout<<"Please enter 3 Ingredients required for Salad and Quantity required for a single serve"<<endl;

   for (int i=0;i<3;i++)

   {

       cout<<"Enter the ingredient number "<<(i+1)<<" :";

       cin>>ItemName[i];

       cout<<"Qty required for single serve (in Oz) :";

       cin>>Qing[i];

   }

   cout<<"Number of servings required :";

   cin>>qty;

   cout<<endl<<"Total Quantities required for "<<qty<<" servings"<<endl;

   for (int i=0;i<3;i++)

   {

       cout<<ItemName[i]<<" Qty for "<<qty<<" servings :"<<(Qing[i]*qty)<<" Oz."<<endl;

   }

   return 0;

}

// You can run this after compiling without any problem.

3 0
3 years ago
Other questions:
  • Disk scheduling algorithms in operating systems consider only seek distances, because Select one: a. modern disks do not disclos
    13·1 answer
  • End-user development: the process by which an organization's non-it specialists create software applications.
    8·1 answer
  • Free points! your welcome
    9·2 answers
  • Charlie is taking his slide presentation to a meeting at a remote location. He saves his presentation as a package on a CD. Char
    15·2 answers
  • Microsoft Excel is an example of a(n) application.
    11·2 answers
  • Which three techniques are used in this photo
    12·1 answer
  • Una laptop agarra mas internet que una computadora de escritorio?
    11·1 answer
  • Add comma(s) where needed, if needed.
    8·1 answer
  • Radio spectrum is the part of the complete range of electromagnetic waves that is used for radio communication from
    14·1 answer
  • Create a program that prompts the user for a positive integer then prints a right-aligned pyramid using that number using the st
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!