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
Arisa [49]
3 years ago
5

(1) Prompt the user to enter two words and a number, storing each into separate variables. Then, output those three values on a

single line separated by a space. (Submit for 1 point)
Enter favorite color:
yellow
Enter pet's name:
Daisy
Enter a number:
6
You entered: yellow Daisy 6

(2) Output two passwords using a combination of the user input. Format the passwords as shown below. (Submit for 2 points, so 3 points total).

Enter favorite color:
yellow
Enter pet's name:
Daisy
Enter a number:
6
You entered: yellow Daisy 6

First password: yellow_Daisy
Second password: 6yellow6

(3) Output the length of each password (the number of characters in the strings). (Submit for 2 points, so 5 points total).

Enter favorite color:
yellow
Enter pet's name:
Daisy
Enter a number:
6
You entered: yellow Daisy 6

First password: yellow_Daisy
Second password: 6yellow6

Number of characters in yellow_Daisy: 12
Number of characters in 6yellow6: 8
Computers and Technology
1 answer:
Sergeu [11.5K]3 years ago
3 0

Answer:

import java.util.Scanner;

public class num3 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter Favorite color");

       String word1 = in.next();

       System.out.println("Enter Pet's name");

       String word2 = in.next();

       System.out.println("Enter a number");

       int num = in.nextInt();

       //Point One

       System.out.println("You entered: "+word1+" "+word2+

               " "+num);

       //Point Two

       String passwordOne = word1+"_"+word2;

       String passwordTwo = num+word1+num;

       System.out.println("First password: "+passwordOne);

       System.out.println("Second password: "+passwordTwo);

       //Point Three

       int len_passwrdOne = passwordOne.length();

       int len_passwrdTwo = passwordTwo.length();

       System.out.println("Number of characters in "+passwordOne+" :" +

               " "+len_passwrdOne);

       System.out.println("Number of characters in "+passwordTwo+" :" +

               " "+len_passwrdTwo);

   }

}

Explanation:

  • This question is solved using java programming language
  • The scanner class is used to receive the three variables (Two string and one integer)
  • Once the values have been received and stored in the respective variables (word1, word2 and num), Use different string concatenation to get the desired output as required by the question.
  • String concatenation in Java is acheived with the plus (+) operator.
You might be interested in
How many bits would be needed to count all of the students in class today? There are 40 students.
Semenov [28]

Answer:

You would need 8 bits.

Explanation:

pls mark brainliest

3 0
2 years ago
Any fact or set of facts, such as the words in a letter to a friend or the notes in a song, can become computer ____.
Alina [70]

I think the answer is... data

3 0
3 years ago
Which function is going to find the lowest value in a range of numbers? MIN MAXAVERAGE COUNT
never [62]
Min is the correct bicycle
8 0
3 years ago
Life can get busy and hectic but relationships matter what is an effective way to mending relationships that may have been negle
Galina-37 [17]
Staying and working thing out or getting help
8 0
3 years ago
There is no need to schedule video calls ahead of time; they can be used the same way as
UNO [17]

Answer:

The answer to this question is "True".

Explanation:

The term video calling is part of communication. In this type of communication will be used in every place like house, office for video conferencing, etc. It was developed in 1968 by AT&T's Bell Labs. It works on internet.This type of calling we can face to face communicate means, we watch the person. In the video calling, there is no need for a schedule it is used as a phone call.  

6 0
3 years ago
Other questions:
  • What is A/B Testing
    10·2 answers
  • This measures how close a biometric reading is to a prerecorded template
    11·1 answer
  • A(n ____ enables a database administrator to define schema components.
    10·1 answer
  • Which of the following best describes the purpose of a design specification?
    14·2 answers
  • The _____ feature will mark all changes made to a document for others to review at a later time.
    13·1 answer
  • Question 1:
    5·1 answer
  • Help!!
    15·1 answer
  • For which input values will the following loop not correctly compute the maximum of the values? 1. Scanner in = new Scanner (Sys
    14·1 answer
  • Viruses that load from usb drives left connected to computers when computers are turned on are known as.
    9·1 answer
  • I am a new linux and unix system user. how do i find out the user and groups names and numeric ids of the current user or any us
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!