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
zavuch27 [327]
3 years ago
10

Write a program that uses a Scanner object to read two strings from the user’s keyboard. Display each string, along with its wid

th, on two separate lines. Then create a new string by joining the two strings with a space between them. Display the new string and its length on a new separate line.
Computers and Technology
1 answer:
katen-ka-za [31]3 years ago
5 0

Answer:

// here is code in java.

import java.util.*;

class Main

{

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

{

   try{

       // create 3 string variables

       String st1,st2,st3;

 // scanner object to read input      

Scanner scr=new Scanner(System.in);

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

 // read first string

st1=scr.nextLine();

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

 // read second string

st2=scr.nextLine();

 // print 1st string and its length

System.out.println(st1+" "+st1.length());

 // print 2nd string and its length

System.out.println(st2+" "+st2.length());

 // create 3rd string by joining two string with a space between

st3=st1+" "+st2;

 //// print 3rd string and its length

System.out.println(st3+" "+st3.length());

       

   }catch(Exception ex){

       return;}

}

}

Explanation:

Create three string variables.Read the 1st string and assign it to variable "st1" , read 2nd string and assign it to variable "st2".Find the length of 1st and 2nd  string and then print "st1" & its length.Similarly do it for 2nd string, print  "st2" and its length in a line. Join the first two string with a space in between them. find its length and print the "st3" and its length in a line.

Output:

enter the first string:                                                                                                                                      

hello                                                                                                                                                        

enter the second string:                                                                                                                                      

alex

hello 5                                                                                                                                                      

alex 4                                                                                                                                                        

hello alex 10  

You might be interested in
CLS
marusya05 [52]

Answer:

1 1

2

3

5

8

13

21

34

55

Explanation:

i guess this is the answer

8 0
3 years ago
If you Buy my group clothing in R.o.b.l.o.x for a donation i will make you brainliest
erastova [34]

Answer:kk ima do it

Explanation:

7 0
3 years ago
Read 2 more answers
attackers typically use ack scans to get past a firewall or other filtering device. how does the process of an ack scan work to
bogdanovich [222]

Attackers frequently use ACK scans to circumvent a firewall or other filtering tools. During a NULL scan, all packet flags are enabled. The most recent versions of Nessus Server and Client are compatible with Windows, Mac OS X, FreeBSD, and the vast majority of Linux variants.

<h3>What is ack scan ?</h3>
  • ACK scans are used to identify hosts or ports that have been blocked or are resistant to other types of scanning. An attacker uses TCP ACK segments to learn about firewall or ACL configuration.
  • Attackers probe our router or send unsolicited SYN, ACK, and FIN requests to specific UDP/TCP ports.
  • TCP ACK Scan sends an ACK message to the target port to determine whether or not it is filtered.
  • On unfiltered ports, a RST reply packet will be sent for both open and closed ports. Filtered ports will either generate no response or generate an ICMP reply packet with an unreachable destination.
  • The TCP ACK scanning technique attempts to determine whether a port is filtered by using packets with the ACK flag set.

To learn more about ask scan refer to:

brainly.com/question/13055134

#SPJ4

3 0
1 year ago
Technology can help governments handle economic emergencies, such as the reliance on automation. Crop and resource shortages. Th
uranmaximum [27]

Answer

Technology can help government handle economic emergencies such as crop and resource shortages.

Explanation

The government can address the concerns of food shortages and water scarcity through embracing new technology interventions to increase farm yields and mitigate the impacts of water shortages. Through crop protection methods, weeds and pest can be controlled. Drip irrigation technology applies water directly to the roots of crops to facilitate high crop production. Other technologies to apply can include organic agriculture and integrated soil fertility management.



3 0
3 years ago
Read 2 more answers
A sosit vara.copiii sunt veseli pentru ca au luat vacanta,mii de fluturi colorati zboara pe ceruri senine,soarele straluceste ve
hodyreva [135]
Acest lucru nu este calculator și tehnologie acest lucru arata ca acesta poate fi un poem pare rău, dar acest lucru trebuie postat in categoria engleză!! Mulțumesc

4 0
3 years ago
Other questions:
  • A Web ____ is a software program that retrieves the page and displays it. Select one:
    5·1 answer
  • Using the bitwise AND operation, the result of 1 AND 0 is ___________. 10100100 ___________ 11010101 = 01110001. A common way to
    15·1 answer
  • You are provisioning a server with eight-core 3 GHz CMP that can execute a workload with an overall CPI of 2.0 (assuming that L2
    5·1 answer
  • 3 Points
    9·2 answers
  • a paragraph is a segment of text with the same format that begins when you press the enter key and ends when you press enter key
    6·2 answers
  • Refer to the following code segment. You may assume that array arr1 contains elements arr1[0],arr[1],...,arr[N-1], where N = arr
    8·1 answer
  • A system administrator is selecting an operating system for use by the company’s research and development team. The team require
    15·1 answer
  • When classified data is sent over an unclassified network, what is this incident called?
    5·1 answer
  • NEED HELP ASAP
    13·2 answers
  • Digital rights include the right to
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!