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
inessss [21]
3 years ago
5

Assume that given , middle and family are three variables of type string that have been assigned values . Write an expression wh

ose value is a string consisting of the first character of given followed by a period followed by the first character of middle followed by a period followed by the first character of family followed by a period: in other words, the initials of the name . So if the values of these three variables were "John" "Fitzgerald" "Kennedy", then the expression 's value would be "J.F.K."
Computers and Technology
1 answer:
Rama09 [41]3 years ago
4 0

Answer:

String initials = given.charAt(0) + "." + middle.charAt(0) + "." + family.charAt(0) + "." ;

Explanation:

The code has been written in Java.

To get the first character of a String variable say, name, the syntax is:

name.charAt(0);

Zero(0) in the above expression indicated the position of the first character.

Therefore, to get the first character of the string given, we have

given.charAt(0).

To get the first character of the string middle, we have:

middle.charAt(0);

To get the first character of the string family, we have:

family.charAt(0);

Concatenating all of these first characters together and separating them by a period(.) we have;

given.charAt(0) + "." + middle.charAt(0) + "." + family.charAt(0) + "." ;

These will form a string which can be stored in a String variable, say 'initials', as follows;

String initials = given.charAt(0) + "." + middle.charAt(0) + "." + family.charAt(0) + "." ;

Hope this helps!

You might be interested in
Which function can you perform on a word processor but not on a typewriter?
zmey [24]
A function you can perform on a word processor BUT NOT on a typewriter is editing.
5 0
3 years ago
Read 2 more answers
How to delete the last element in array
svlad2 [7]

Answer:

Hey mate.....

Explanation:

This is ur answer.....

<em>To remove the last n elements from an array, use arr. splice(-n) (note the "p" in "splice"). The return value will be a new array containing the removed elements.</em>

<em />

Hope it helps!

Mark me brainliest pls.....

FOLLOW ME! :)

4 0
3 years ago
#Write a function called "in_parentheses" that accepts a
zimovet [89]

Answer:

import regex as re

def in_parentheses(a_string):

   regeX = re.compile(".*?\((.*?)\)")

   result = re.findall(regeX, a_string)

   return str(result).replace("[","").replace("]","")

print("test 1: "+in_parentheses("Open ( only"))

print("test 2: "+in_parentheses("This is a sentence (words!)."))

8 0
3 years ago
Which component of an email gives the recipient an idea of the email’s purpose and urgency?
Delvig [45]

Answer:

subject line

Explanation:

it is a brief description of what the email subject is.

4 0
3 years ago
In JAVA, answer the following:
erica [24]

Answer:

The JAVA program is as follows.

import java.util.Scanner;

public class Program

{

   static int n;

public static void main(String[] args) {

    //scanner object

    Scanner stdin = new Scanner(System.in);

    //loop executes till number entered is in the range of 1 to 10

    do

    {

        System.out.print("Enter any number: ");

        n = stdin.nextInt();

    }while(n<1 || n>10);

    System.out.println("Number is valid. Exiting...");

}

}

OUTPUT

Enter any number: 0

Enter any number: 23

Enter any number: 10

Number is valid. Exiting...

Explanation:

The program is explained.

1. The integer variable, n, is declared static since the variable should be accessible inside main() which is static.

2. An object of Scanner, stdin, is created inside main().

3. Inside do-while loop, the user is asked input any value for n.

4. The loop continues till user inputs a number which is not in the given range, beginning from 1 to 10.

5. The loop will not be terminated till the user enters a valid input.

6. Once a valid input is entered, the message is displayed to the console and the program ends.

7. The variable, n, is declared at the class level and is a class variable. Class variables are declared inside the class but outside all the methods in that class.

8. Since JAVA is a purely object-oriented language, all the code is written inside class.

9. The object of class is not created since only one class is included in the program. If more than one class is included, then the object of the class which does not has the main() method will be created inside main().

10. User input for integer is taken via scanner object and using nextInt() method.

11. The methods, print() and println() display the messages to the console. The only difference is that println() inserts a new line after displaying the message.

12. The name of the class having main() and the name of the program should be the same.

7 0
3 years ago
Other questions:
  • Artists who draw images on a computer often use a stylus in conjunction with special _________ tablets, which offer extra-sensit
    15·1 answer
  • Software can be distributed on the web. <br> a.true <br> b.false
    12·1 answer
  • Analog signals consists of individual electric pulses that represents bits group together into bytes {True/False}
    13·1 answer
  • Anybody good with Microsoft excel? I need help with this class.
    9·2 answers
  • While doing research on the Internet, what kind of website should you avoid because the information may be biased?
    11·1 answer
  • What is a central location that houses Joint Information System (JIS) operations and where public information staff perform publ
    6·1 answer
  • Rain forests clean the air by producing oxygen. Some rain forest plants have healing properties, and can be used as medicine. Ra
    12·1 answer
  • Word templates include pre-made flyers which may be edited and saved only if permission is obtained from the Microsoft Office te
    11·1 answer
  • Match the image to the view type in a presentation program. scroll bar tool bar status bar menu bar provides an array of buttons
    10·2 answers
  • To find information on a network use a ____
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!