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
erica [24]
4 years ago
12

Write a java program that will take 2 String inputs and perform the following operation on them: a) Show length of the strings b

) Concatenate two strings c) Convert those two strings to uppercase.
Computers and Technology
1 answer:
marissa [1.9K]4 years ago
6 0

Answer:

// here is code in java.

import java.util.*;

// class definition

class Solution

{

   // main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

 // scanner object to read input from user

Scanner scr=new Scanner(System.in);

 // string variables

String st1,st2;

System.out.print("enter the first string:");

 // read the first string

st1=scr.nextLine();

System.out.print("enter the second string:");

 // read the second string

st2=scr.nextLine();

// part (a)

 // find length of each string

System.out.println("length of first string is: "+st1.length());

System.out.println("length of second string is: "+st2.length());

//part(b)

 // concatenate both the string

System.out.print("after Concatenate both string: ");

System.out.print(st1+st2);

// part(c)

 // convert them to upper case

System.out.println("first string in upper case :"+st1.toUpperCase());

System.out.println("second string in upper case :"+st2.toUpperCase());

   }catch(Exception ex){

       return;}

}

}

Explanation:

Read two strings st1 and st2 with scanner object.In part a, find the length of each string with the help of .length() method and print the length.In part b, concatenate both the string with + operator.In part c, convert each string to upper case with the help of .toUpperCase()  method.

Output:

enter the first string:hello

enter the second string:world!!

length of first string is: 5

length of second string is: 7

after Concatenate both string: hello world!!

first string in upper case :HELLO

second string in upper case :WORLD!!

You might be interested in
TULPCOAONIAC<br>TRUOESP<br> this is un scrambled word​
MaRussiya [10]

<em>Answer:</em>

1.)OCCUPATIONAL

2.)POSTURE

<em>This is the answer thank youu!</em>♡︎♡︎

4 0
3 years ago
Read 2 more answers
Open and close ____ immediately following the name of a procedure identify a Visual Basic statement as a procedure call statemen
Bezzdna [24]

Answer:  Parentheses

Explanation:

 The open and close parentheses basically identify the visual basic statement   in the procedure call statement.

The close procedure basically in the visual basic statement basically terminate the call of a program that performed the real processing. Open and close is also known as right and left parentheses.

The close statement is basically control the pre-defined programming statement in the particular close procedure.

 

4 0
3 years ago
Need some help with this one chief​
Molodets [167]

Answer:

i have no clue dude sorry thanks for the points tho.

Explanation:

8 0
2 years ago
As each layer of the OSI model adds its encapsulation header and/or footer, the ______ gets larger until it reaches the physical
aleksklad [387]

Answer:

Message

Explanation:

  • The Application layer creates a message. The Application layer passes the message to the Presentation layer.
  • The Presentation layer encapsulates the message by adding information to it. Information is usually added only at the beginning of the message (called a header); however, some layers also add material at the end of the message (called a footer)
  • The process of passing the message down and adding layer-specific information continues until the message reaches the Physical layer.
  • At the Physical layer, the message is converted into electrical impulses that represent bits and is transmitted over the physical connection.  
  • The receiving computer captures the bits from the physical connection and re-creates the message in the Physical layer.  
  • The Physical layer converts the message from bits into a Data Link frame and sends the message up to the Data Link layer.
  • The Data Link layer strips its information and sends the message up to the Network layer.
  • This process of deencapsulation is performed until the message reaches the Application layer.
  • When the message reaches the Application layer, the data in the message is sent to the intended software recipient.
5 0
3 years ago
You want to implement 802.1x authentication on your wireless network. Where would you configure passwords that are used for auth
irakobra [83]

Answer:A RADIUS server provides authentication through a user name and password encrypted with EAP.

Explanation:

7 0
3 years ago
Other questions:
  • Which of the following information sources was not directly affected by the Telecommunications Act of 1996?
    12·1 answer
  • Which of these jobs would be most appropriate for someone who majors in computer engineering? I need the answer ASAP Helping com
    14·2 answers
  • Luentifying message rullidl Upuuns
    12·1 answer
  • To delete data from a disk in such a way that no one can ever read it, you should ____.
    6·1 answer
  • Which statement describes part of the meeting scheduling process? It is always an all-day event. It is created in a single calen
    14·1 answer
  • According to the "multiple-selves" theory, of an online DVD rental service could offer same-day deliveries, so that people who o
    9·1 answer
  • You are creating a presentation and you have come to the last slide. You still have more information to add. What should you do?
    7·1 answer
  • What is the nearest ten cents of 453.56
    5·1 answer
  • Which camera is interchangeable<br><br> freeform<br><br> hybrid<br><br> DSLR<br><br> point and shoot
    15·1 answer
  • Explain briefly how learning how to follow can make a person a good leader
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!