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

4.6.1: Reading and outputting strings. Write a program that reads a person's first and last names, separated by a space. Then th

e program outputs last name, comma, first name. End with newline. Example output if the input is: Maya Jones Jones, Maya
Computers and Technology
1 answer:
Solnce55 [7]3 years ago
4 0

Answer:

import java.util.Scanner;

public class num5 {

   public static void main(String[] args) {

   Scanner in = new Scanner(System.in);

   System.out.println("Enter your full name");

   String name = in.nextLine();

   String [ ] n = name.split(" ");

       System.out.println(n[0]+", "+n[1]);

   }

}

Explanation:

Scanner class is used to receive the full names. e.g "Maya Jones"

This is saved in a variable called name using the nextLine() method to grab the entire line of string

The string split() method is used to split the string on the whitespace

The output statement is used to print the value at index 0 and index 1 concatenated with a comma.

You might be interested in
As in algebra, you can use brackets to override the order of operations Excel follows to perform formula calculations. True or f
sertanlavr [38]

Answer:

false

Explanation:

parasynthesis is used to change the order of priority.

6 0
4 years ago
Write a function that takes an integer value and returns the number with its digits reversed. for example, given the number 7631
lesantik [10]

//=indicating you to do the programming part on your own relating to the description provided against. This done because different programming languages require different coding for that.

n=integer value

n1=dummy storage for n

r=variable used to do the function

{

int n,r,n1,rev=0;

//do the coding here for storing the integer in the variable n

n1=n;

while(n>0){

   r=n%10;

   rev=(rev*10)+r;

   n=n/10;

   }

//now add a command for displaying the value of rev

}

this is just a logic i used for java

done.

3 0
3 years ago
The limitation of trade secret protection for software is that it is difficult to prevent the ideas in the work from falling int
Lubov Fominskaja [6]

Answer:

The answer is "Option B".  

Explanation:

The main drawback of commercial security is, that the software may not protect digital technology against data mining, and they are not known to be the  imperial tools, that's why the only option B is correct, and certain options are wrong, which can be explained as follows:

  • In option A, It used to provide a sequence of instructions, which is used in security.  
  • In option C, It doesn't use in security, that's why it is wrong.
  • Option D and Option E are wrong because in software there is no use of court and new software, it only upgrades the software.
4 0
3 years ago
While troubleshooting a network connection problem for a coworker, you discover the computer is querying a nonexistent DNS serve
tatuchka [14]

Answer:

nslookup ifconfig.

Explanation:

The nslookup is used a number of times by network admins to troubleshoot DNS related problems. In addition, this command finds IP addresses and name servers of hosts. This utility command queries the DNS database tables from every host in a network. It then determines the host name and issues an IP. It sort of converts your domain name into an IP addresses. This command combined with ifconfig finds the correct DNS servers and assigns the correct DNS server IP.

6 0
3 years ago
The text between and defines the _____.
Genrish500 [490]
Active text on a page
5 0
3 years ago
Other questions:
  • Running the cpu at a faster speed than the manufacturer recommends is called ________.
    11·1 answer
  • 1. Orthographic Drawings are used to express ideas that are more complicated. Explain the purpose of the different views and the
    7·1 answer
  • You find that you are missing a very important file. After much searching, you have determined that it is no longer on your comp
    13·2 answers
  • What does PowerPoint display when you use the Notes Page view?
    14·2 answers
  • Sulfur content is measured in
    11·1 answer
  • A spreadsheet has some values entered: Cell A1 contains 10, cell A2 contains 14, A3 contains 7. You enter in cell A4 the followi
    8·1 answer
  • Where do charts get the data series names?
    14·1 answer
  • Can somebody PLEASE help me cancel my subscription I have tried so many different things and contacted support - they are no hel
    14·1 answer
  • WILL GIVE BRAINLIEST! 20 POINTS! PLZ HELP!
    14·2 answers
  • Assignment 3: chabot<br>​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!