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
Triss [41]
3 years ago
11

3.26 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. Hint: Use the to_string() function to convert numerical data to a string. 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:
Tanya [424]3 years ago
3 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:

This declares the first name, last name as strings and 4 digit number as integer

   string fname,lname; int num;  

This prompts and get input for last name

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

This prompts and get input for first name

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

This prompts and get input for four digit number

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

This initializes login information to last name

   string login = lname;

This checks if length of login is 5 and above

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

If yes, it gets the first five letters only

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

This adds the first character of first name and the last 2 digits of num to login

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

This prints the login information

   cout<<login;

You might be interested in
Why now days 3D images are used in cartoons? What are the drawbacks of 2D image?
antoniya [11.8K]

Answer:

There are no drawbacks

Explanation:

People just think 3D is more modern-ish. I liked 2D better, but whatever- things are changing.

5 0
3 years ago
Read 2 more answers
Definition of blog? computer science
inysia [295]

Blogs are sites online owned by a person and or a group of people, usually containing things like videos, pictures and overall things that happened in their day. Blogs are updated daily and have explanations or an overall report on what their day was like.

7 0
4 years ago
Determine the number of bytes necessary to store an uncompressed RGB color image of size 640 × 480 pixels using 8, 10, 12 and 14
dexar [7]

Answer:

For 8 bits / Color Channel: 921, 600 bytes.

For 10 bits / Color Channel: 1,152,000 bytes.

For 12 bits / Color Channel: 1,382,400 bytes.

For 14 bits / Color Channel : 1,612, 800 bytes.

Explanation:

Un uncompressed RGB color image of 640 pixels wide by 480 pixels height (VGA resolution) uses 3 samples of x bits fin order to represent the quantity of each primary color (red, green and blue) in a given pixel of the image.

So, if we use 8 bits/ sample, we can calculate the bytes needed to store a complete image as follows:

640*480*3*8 bits = 7, 372,800 bits. (1)

As, by definition, 1 byte= 8 bits, we have:

Nº of bytes = 7,372,800 / 8 = 921,600 bytes. (2)

In order to get the bytes needed to store the same image, using 10, 12 and 14 bits/ sample, all we need is replacing 8 by 10, 12 and 14 in (1), and then dividing by 8 as in (2).

Proceeding in this way we obtain:

640*480*3*10 = 9,216,000 bits ⇒    1,152,000 bytes.

640*480*3*12 = 11,059,200 bits ⇒   1,382,400 bytes.

640*480*3*14=   12,902,400 bits ⇒  1,612,800 bytes.

8 0
4 years ago
What are three ways data can be gathered?Possible answers include:
MrRa [10]

Answer:

D. All of the above

Explanation:

Here are the top six data collection methods:

  • Interviews.
  • Questionnaires and surveys.
  • Observations.
  • Documents and records.
  • Focus groups.
  • Oral histories.

The system of data collection is based on the type of study being conducted. Depending on the researcher’s research plan and design, there are several ways data can be collected.

The most commonly used methods are: published literature sources, surveys (email and mail), interviews (telephone, face-to-face or focus group), observations, documents and records, and experiments.

1. Literature sources

This involves the collection of data from already published text available in the public domain. Literature sources can include: textbooks, government or private companies’ reports, newspapers, magazines, online published papers and articles.

This method of data collection is referred to as secondary data collection. In comparison to primary data collection, tt is inexpensive and not time consuming.

2. Surveys

Survey is another method of gathering information for research purposes. Information are gathered through questionnaire, mostly based on individual or group experiences regarding a particular phenomenon.

There are several ways by which this information can be collected. Most notable ways are: web-based questionnaire and paper-based questionnaire (printed form). The results of this method of data collection are generally easy to analyse.

3. Interviews

Interview is a qualitative method of data collection whose results are based on intensive engagement with respondents about a particular study. Usually, interviews are used in order to collect in-depth responses from the professionals being interviewed.

Interview can be structured (formal), semi-structured or unstructured (informal). In essence, an interview method of data collection can be conducted through face-to-face meeting with the interviewee(s) or through telephone.

4. Observations

Observation method of information gathering is used by monitoring participants in a specific situation or environment at a given time and day. Basically, researchers observe the behaviour of the surrounding environments or people that are being studied. This type of study can be contriolled, natural or participant.

Controlled observation is when the researcher uses a standardised precedure of observing participants or the environment. Natural observation is when participants are being observed in their natural conditions. Participant observation is where the researcher becomes part of the group being studied.

5. Documents and records

This is the process of examining existing documents and records of an organisation for tracking changes over a period of time. Records can be tracked by examining call logs, email logs, databases, minutes of meetings, staff reports, information logs, etc.

For instance, an organisation may want to understand why there are lots of negative reviews and complains from customer about its products or services. In this case, the organisation will look into records of their products or services and recorded interaction of employees with customers.

6. Experiments

Experiemental research is a research method where the causal relationship between two variables are being examined. One of the variables can be manipulated, and the other is measured. These two variables are classified as dependent and independent variables.

In experimental research, data are mostly collected based on the cause and effect of the two variables being studied. This type of research are common among medical researchers, and it uses quantitative research approach.

7 0
3 years ago
A(n) _____ is a request for the database management software to search the database for data that match criteria specified by th
timama [110]
A query, specifically a select statement.
4 0
3 years ago
Read 2 more answers
Other questions:
  • The inherent portability of which medium, gives it an advantage over other types of media that require an individual’s full atte
    10·1 answer
  • You are going to buy a computer but first you want to do some research to help you select the best model everfi answer
    11·1 answer
  • What technology changes led to industrialization?
    15·1 answer
  • Write an expression that evaluates to true if the value of the string variable s1 is greater than the value of string variable s
    7·1 answer
  • Some drugs, like Tylenol, are available over the counter because they are safe in any dose.
    8·1 answer
  • What export format is a great option for students that want to put their video into an online portfolio?
    8·1 answer
  • Define full-duplex. Group of answer choices term used to describe the networking device that enables hosts in a LAN to connect t
    9·1 answer
  • A Color class has a constructor that accepts three integer parameters: red, green and blue components in the range of 0 ... 255
    6·1 answer
  • 3 Points
    15·2 answers
  • A major retailer wants to enhance their customer experience and reduce losses
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!