Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

155
Views
How to create login name for a user in Java

Write a program that creates a login name for a user, given the user's first name, last name, and a four-digit integer as input. Output the login name, which is made up of the first five letters of the last name, followed by the first letter of the first name, and then the last two digits of the number (use the % operator). If the last name has less than five letters, then use all letters of the last name.

Ex: If the input is:

Michael Jordan 1991 the output is:

Your login name: JordaM91 Ex: If the input is:

Kanye West 2024 the output is:

Your login name: WestK24

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This covers all the use cases specified

const user = {
  firstName : "Michael",
  lastName : "Jordan",
  num : 1991
}

const loginName = user.lastName.slice(0,5) + user.firstName[0] + user.num.toString().slice(-2)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!