can someone help me on codehs. its 7.1.5: initials. here is what your supposed to do

Write a function called initials that will take a first and last name and return their initials using the following format:

initials("Tracy", "Turtle")
# => "T.T."
initials("Peter", "Parker")
# => "P.P."

Answers

Answer 1

Answer:

first = input( "What is your first name? " )

last = input( "What is your last name? " )

def initials():

   print ("Your initials are: "+first[0]+"."+last[0]+".")

initials ()

Explanation:

it works when I test but it won't submit. Hope this helps

Answer 2

Following are the program to prints the initials of the input value.  

Program Explanation:

Defining a class Main.Inside the class, a method "initials" is declared that takes two string variables "first, last" in the parameter.Inside the method, a return keyword is defined that uses the charAt method that returns the first character value of the parameters. In the next step, the main method is defined.Inside the main method, a print method is declared that calls initials method that accepts value in the parameter and prints its value.

Program:

public class Main //defining a class Main

{

   static String initials(String first, String last)//defining a String method initials that input two variables in the parameter

   {

       return first.charAt(0)+"."+last.charAt(0)+".";//using charAt method that returns first character value

   }

 public static void main(String[] as) //defining main method

 {

   System.out.println(initials("Tracy", "Turtle"));//using print method that calls initials method that accepts value in parameter

   System.out.println(initials("Peter", "Parker"));//using print method that calls initials method that accepts value in parameter

 }

}

Output:

Please find the attached file.

Learn more:

brainly.com/question/2810164

Can Someone Help Me On Codehs. Its 7.1.5: Initials. Here Is What Your Supposed To DoWrite A Function

Related Questions

In a particular spreadsheet, the data in each cell is password protected. When cells are selected, the formula is visible
in the formula bar. Which is true?
O The cells are locked and hidden.
The cells are locked and unhidden.
The cells are unlocked and hidden.
O The cells are unlocked and unhidden.

Answers

Answer:

Explanation:

Locked and hidden

Other Questions
The side length of an equilateral triangle is 6x - 12. Write an expression for the perimeter of the triangle in simplest form. sheila has a total of $20 to spend at the fall fair. If the armband for rides cost $12.50, what is the most she can spend on treats? write and solve an inequality When trade barriers began to fall, what was the motivation for much of the foreign direct investment by non-U.S. firms please help me on these two questions help me ill give brainliest Do you use Edenuity? if so do you like it and what is your favirot part and your least favirot part about it? 14 pts btw 2 pointsA student saw the Moon rise at 6:20 a.m. on Monday. If he wants to seethe Moon rise again on Tuesday, vhat time should he look in the sky?(Markthe one best answer.)About 6:20 amAbout 6:20pmAbout 5:30 amAbout 7:10am what is an equation of the line that passes through the points 0,-1 and 6,1 put answer in fully reduced form What is the answer anyone quick???? Round 4.574 to the nearest tenth i don't know the answer pls tell me the answer Yesterday I ran 9.6 miles at an average speed of 0.4 miles per 5 minutes. How long did it take me to run the 9.6 miles? I WILL GIVE BRAINLIEST!!!!! a recipe calls for 12 1/8 cups of sugar. I need to make this 5 times. How much sugar will I need? In a particular spreadsheet, the data in each cell is password protected. When cells are selected, the formula is visiblein the formula bar. Which is true?O The cells are locked and hidden.The cells are locked and unhidden.The cells are unlocked and hidden.O The cells are unlocked and unhidden. what is the relationship between the number of sides in a polygon and the sum of the measures of the interior angles ? 2. How far does a lorry move if it's travelling at:a. 10m/s for 30s b. 20m/s for 20sc. 2m/s for 100sd. 15m/s for 28s what do you feel about the writers negative stand about children using social media? Consider the two functions below. Which one of these functions is linear? What is its equation? Enter any answers to two decimal places. 1/5(x4)=2 Please help me fast How did Mexicos desire to use their land and attract Americans to Texas eventually lead to Texas Independence?