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
Jlenok [28]
3 years ago
10

Create a function called full_name. Pass two parameters to the function, an employee’s last name and first name. The function sh

ould return the full name in the format, last name, comma, space, first name (for example: Smith, Joe). Save your code.
Computers and Technology
1 answer:
marissa [1.9K]3 years ago
6 0

Answer:

The solution code is written in Python:

  1. def full_name(lastName, firstName):
  2.    return lastName + ", " + firstName  

Explanation:

Firstly, create a function and name it as<em> full_name</em> that takes two parameters, <em>lastName</em> and <em>firstName </em>(Line 1).

In the function body, we can simply use plus operator, "+", to join the <em>lastName</em> string, comma and <em>firstName</em> string into a concatenated string. Please note a single space is made right after the comma (Line 2).

At last, return the concatenated string as function output.

You might be interested in
Modify class Time2 of fig 8.5, (which is split into four pictures) to include a tick method that increments the time stored in a
ArbitrLikvidat [17]

Explanation:

Complete Program:

NOTE:   The newly added statements are highlighted in bold.

// File: Time2.java

public class Time2

{

private int hour; // 0 - 23

private int minute; // 0 - 59

private int second; // 0 - 59

public Time2()

{

 this(0, 0, 0);

}

public Time2(int hour)

{

 this(hour, 0, 0);

}

public Time2(int hour, int minute)

{

 this(hour, minute, 0);

}

public Time2(int hour, int minute, int second)

{

 if(hour < 0 || hour >= 24)

  throw new IllegalArgumentException("hour must be 0-23");

 if(minute < 0 || minute >= 60)

  throw new IllegalArgumentException("minute must be 0-59");

 if(second < 0 || second >= 60)

  throw new IllegalArgumentException("second must be 0-59");

 this.hour = hour;

 this.minute = minute;

 this.second = second;

}

public Time2(Time2 time)

{

 this(time.getHour(), time.getMinute(), time.getSecond());

}

public void setTime(int hour, int minute, int second)

{

 if(hour < 0 || hour >= 24)

  throw new IllegalArgumentException("hour must be 0-23");

 if(minute < 0 || minute >= 60)

  throw new IllegalArgumentException("minute must be 0-59");

 if(second < 0 || second >= 60)

  throw new IllegalArgumentException("second must be 0-59");

 this.hour = hour;

 this.minute = minute;

 this.second = second;

}

public void setHour(int hour)

{

 if(hour < 0 || hour >= 24)

  throw new IllegalArgumentException("hour must be 0-23");

 

 this.hour = hour;

}

public void setMinute(int minute)

{

 if(minute < 0 || minute >= 60)

  throw new IllegalArgumentException("minute must be 0-59");

 

 this.minute = minute;

}

public void setSecond(int second)

{

 if(second < 0 || second >= 60)

  throw new IllegalArgumentException("second must be 0-59");

 

 this.second = second;

}

public int getHour()

{

 return hour;

}

public int getMinute()

{

 return minute;

}

public int getSecond()

{

 return second;

}

public String toUniversalString()

{

 return String.format("%02d:%02d:%02d", getHour(), getMinute(),

   getSecond());

}

public String toString()

{

 return String.format("%d:%02d:%02d %s",

   ((getHour() == 0 || getHour() == 12) ? 12 : getHour() % 12),

   getMinute(), getSecond(), (getHour() < 12 ? "AM" : "PM"));

}

// increment second

public void tick()

{

 if(second < 23)

 {

  second++;

 }

 else if(minute < 59)

 {

  second = 0;

  minute++;

 }

 else if(hour < 23)

 {

  second = 0;

  minute = 0;

  hour++;

 }

 else

 {

  second = 0;

  minute = 0;

  hour = 0;

 }    

}

// increment minute

public void incrementMinute()

{

 if(minute < 59)

 {

  minute++;

 }

 else if(hour < 23)

 {

  minute = 0;

  hour++;

 }

 else

 {

  minute = 0;

  hour = 0;

 }    

}

public void incrementHour()

{

 if(hour < 23)

 {

  hour++;

 }

 else

 {

  hour = 0;

 }    

}

}

------------------------------------------------------------------------------------------------------------

// File: Time2Test.java

public class Time2Test

{

  public static void main( String args[] )

  {      

     Time2 t = new Time2(22, 58, 59);

     System.out.println("Starting time: ");

     System.out.println("Time in 24 hours format: " + t.toUniversalString());

     System.out.println("Time in 12 hours format: " + t);

     System.out.println();

     

     t.incrementMinute();

     System.out.println("After incrementing one minute: ");

     System.out.println("Time in 24 hours format: " + t.toUniversalString());

     System.out.println("Time in 12 hours format: " + t);

     System.out.println();

     

     t.incrementHour();

     System.out.println("After incrementing one hour: ");

     System.out.println("Time in 24 hours format: " + t.toUniversalString());

     System.out.println("Time in 12 hours format: " + t);

     System.out.println();

     

     t.tick();

     System.out.println("After incrementing one second: ");

     System.out.println("Time in 24 hours format: " + t.toUniversalString());

     System.out.println("Time in 12 hours format: " + t);    

     System.out.println();

  }

}

4 0
3 years ago
Write the Q basic program to find the area of room.​
Mkey [24]

Explanation:

CLS

Input length

Input breadth

A= l*b

Print" the area of a room is"; A

END

8 0
2 years ago
True and False(Total points: 10)
Gwar [14]

Answer:

1.T 2.f 3.t 4.f 5.f 6.f 7.t 8.t 9.f

8 0
2 years ago
Read 2 more answers
Write the following numbers in binary. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25
AfilCa [17]
0 1 10 11
Explanaition:
4 0
2 years ago
Where could an identity theft access your personal information
Nikolay [14]
Hello!

The identity theif could establish a new identity for ciminal purposes using YOUR identity and personal information, and the theif could aquire money or goods from it.

*PLAGIARISM FREE*
5 0
3 years ago
Read 2 more answers
Other questions:
  • Jared does not update his computer’s system software. What threat does his computer face?
    9·1 answer
  • Jenny is working on a laptop computer and has notices that the computer is not running very fast. She looks and realizes that th
    6·2 answers
  • In regard to protective actions for explosive devices, the area where the blast originates is referred to as ___________ perimet
    8·1 answer
  • which type of classroom enable students to attend lectures without being physically present with the teacher
    14·2 answers
  • Project manager George is defining project management to his team. How should he define project management in one sentence?
    7·1 answer
  • A human interest story is an example of hard news.<br> O True<br> O False HEL
    15·1 answer
  • What is the output of the following JavaScript code?
    9·1 answer
  • Using range(1,101), make two list, one containing all even numbers and other containing all odd numbers. How can I do this on Py
    15·1 answer
  • Write a Python program to find whether a given number (accept from the user) is positive
    11·1 answer
  • can i get an access code for free online? if yes, what website is it so i can get a free access code?​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!