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
borishaifa [10]
4 years ago
9

Write a method called justFirstAndLast that takes a single String name and returns a new String that is only the first and last

name.
You may get a name with a middle name or multiple middle names but you should ignore those.


You can assume that there will be at least two names in the given String.

Java

public String justFirstAndLast(String name)

{

}

Computers and Technology
1 answer:
NemiM [27]4 years ago
6 0

Answer:

Answer is in the attached screenshot.

Explanation:

Using regex to split a given input string via whitespace, then returns the first and last element of the array.

You might be interested in
How do you add a new comment to a document?
EleoNora [17]

Answer:

D. Choose the Review tab, then New Comment

Explanation:

It's quite easy to add comments to word documents.

From the list of given options, only option D satisfy the given question.

To add comments to a text, you simply highlight the text

Go to the review tab then select new comment.

Once you follow these simple steps, a new comment will be created in your word document.

3 0
3 years ago
Consider the following method intended to modify the parameter names by removing all instances of the String n.
Anastasy [175]

Answer:

int i = 0; i < names.size(); i++

Explanation:

The ArrayList must be read in the forward direction, and it is going to start from 0 certainly. Also, the iteration is going to end when i is exactly one less than the size of the ArrayList. And this is possible only if we choose the option mentioned in the Answer section. In this, i starts from 0 and iterates till i is one less than name.size() which is the size of the ArrayList.

7 0
3 years ago
Give your own example of a nested conditional that can be modified to become a single conditional, and show the equivalent singl
victus00 [196]

Answer:

following are the program to the given question:

Program:

x = 0#defining an integer variable that holds a value

if x < 0:#defining if that checks x less than 0

   print("This number ",  x, " is negative.")#print value with the message

else:#defining else block

   if x > 0:#defining if that checks x value greater than 0

       print(x, " is positive")#print value with message

   else:#defining else block

       print(x, " is 0")#print value with message

if x < 0:#defining another if that checks x less than 0

   print("This number ",  x, " is negative.")

elif (x > 0):#defining elif block that check x value greater than 0

   print(x, " is positive")#print value with message

else:#defining else block

   print(x, " is 0")#print value with message

Output:

Please find the attachment file.

Explanation:

In this code, an x variable is defined which holds a value that is "0", in the next step nested conditional statement has used that checks the x variable value and uses the print method that compares the value and prints its value with the message.

In another conditional statement, it uses if that checks x value less than 0 and print value with the negative message.

In the elif block, it checks x value that is greater than 0 and prints the value with the positive message, and in the else block it will print the message that is 0.

3 0
3 years ago
If a database table is to hold data on 52 students it must have 52?
Marina CMI [18]

Answer:

yes

Explanation:

6 0
3 years ago
Adding Calculator Write a program that simulates an adding machine. Input to the program will be integers, submitted one per lin
Marysya12 [62]

Answer:

This is really hard. I tried doing this problem but of was a real pain. I honestly can't help. I tried. sorry mate.

7 0
3 years ago
Other questions:
  • ________ means that IT capacity can be easily scaled up or down as needed,which essentially requires cloud computing. A) agility
    15·1 answer
  • How can I make a website login system with only using php?
    14·1 answer
  • ______ is the software that blocks a user from being able to access your computer.
    9·1 answer
  • Two powerboats are about to cross paths. what should the boat on the starboard (right) do?
    11·1 answer
  • The date June 10, 1960, is special because when it is written in the following format, the month times the day equals the year:
    6·1 answer
  • 1. when is it a good idea to use lossless compression
    8·1 answer
  • 1. Before operating any power tool, you need to
    14·1 answer
  • Someone asks you for help with a computer that hangs at odd times. You turn it on and work for about 15 minutes, and then the co
    10·1 answer
  • Create a subclass of Person called Lecturer that has 2 variables of its own: employeeNumber and salary. As in the above scenario
    12·1 answer
  • Heyyyyyy<br> byeeeeeeeeeeeeeeeeeeeeeee
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!