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
77julia77 [94]
3 years ago
10

3.29 LAB: Login name Write a program that creates a login name for a user, given the user's first name, last name, and a four-di

git 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
Computers and Technology
1 answer:
romanna [79]3 years ago
4 0

Answer:

In C++:

#include <iostream>

using namespace std;

int main(){

   string fname,lname; int num;

   cout<<"Firstname: "; cin>>fname;

   cout<<"Lastname: "; cin>>lname;

   cout<<"4 digits: "; cin>>num;

   string login = lname;

   if(lname.length()>=5){

       login = lname.substr(0, 5);    }

   login+=fname.substr(0,1)+to_string(num%100);

   cout<<login;

   return 0;

}

Explanation:

See attachment for explanation where I used comments to explain each line

Download cpp
You might be interested in
A page with no meaningful content that is full of ads and the webmaster makes money from if someone clicks on them is called____
o-na [289]
A spam page. It spams ads onto it.
3 0
4 years ago
Tom wants to find a number so that the sum of the digits of a two-digit number is 7. When reversing the digits, the number shoul
Rudik [331]
A VARIABLE is used to represent an unknown number.
3 0
3 years ago
It would be at least two decades before some of
Ivan

Answer:

yes! of course and sure! okay

6 0
3 years ago
Suppose a webpage contains a single text field. We want to make the page such that a user can immediately start typing in the te
just olya [345]

Answer:

The answer is "Option 2".

Explanation:

In HTML5, text inputs use an autofocus attribute, which, when the page is loaded, uses a template to concentrate primarily on text fields. This attribute is a Boolean property that represents the HTML autofocus attribute, showing if the related <select> element will receive an output focus whenever the page loads if it is overruled by the user. An only form-associated entity can have this property specified in a text.

5 0
3 years ago
Does anyone have any social media message me
Mademuasel [1]
What's your username on them?
5 0
3 years ago
Other questions:
  • What is the difference between a learner’s license and an operator’s license?
    13·1 answer
  • A ___ is the basic collective unit of data in a computer.
    12·1 answer
  • Which command can be used to manually add a package to the driver store?
    13·1 answer
  • What is the advantage of using Mail Merge Wizard when creating a mail merge?
    12·2 answers
  • A list of pages within a Web site that you have visited and that usually appears at the top of a page is referred to as a(n) ___
    14·1 answer
  • A virus or worm can have a payload that installs a(n) __________ door or trap-door component in a system, which allows the attac
    14·2 answers
  • Why is it so important to have employees who can critically think?
    7·2 answers
  • What would be an ideal scenario for using edge computing solutions?
    10·1 answer
  • We can save our data peremently on a
    7·2 answers
  • An end-user license agreement protects _____.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!