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]
2 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]2 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
Thabo has a small barber shop and he uses Microsoft applications to keep track of his stock and to create posters for advertisin
kirza4 [7]

An information system is crucial to the success of a business. Itemized below are five benefits of operating an information system in a business.

<h3>What are the benefits of an Information System?</h3>

Information systems are important because:

  1. They help to increase and enhance operational efficiencies such as accounting, sales, inventory, and HR operations.
  2. They help to minimize costs. As the business makes more and more informed decisions, its costs will drop.
  3. It enhances customer service. Information about customers helps the business to tailor its services to the requirements of each customer.
  4. Information system helps the decision-makers in the business to make better and more informed decisions.
  5. Information systems help to ensure business continuity.

<h3>What are the requirements for creating an information system?
</h3>

An information system requires the following:

  • Hardware for the computer workstation and addendums
  • Software
  • A network communication amongst the computers and hardware
  • a map of the company's processes and the people responsible for such processes
  • A procedural manual.
  • Existing data from the business.

For the barber's shop, for example, some of the components of the information system he must put in place are:

A workstation that collects information about:

  • Clients
  • Details of Sales
  • Expenses
  • Compliance dates and records etc.

Learn more about Information Systems at:

brainly.com/question/25226643

4 0
2 years ago
Hooollaaaa , todos absolutamente todos quieren borrar esta tarea por que no tiene nada que ver con la materias del colegiooo per
Andreas93 [3]

Answer:

JAJAJSJJS XD PERO SI SOY

7 0
2 years ago
Read 2 more answers
Add three methods to the Student class that compare twoStudent objects. One method (__eq__) should test for equality. A second m
shusha [124]

Answer:

class Student(object):

def __init__(self, name, number):

self.name = name

self.scores = []

for count in range(number):

self.scores.append(0)

 

def getName(self):

 

return self.name

 

def setScore(self, i, score):

 

self.scores[i - 1] = score

 

def getScore(self, i):

 

return self.scores[i - 1]

 

def getAverage(self):

 

return sum(self.scores) / len(self._scores)

 

def getHighScore(self):

 

return max(self.scores)

def __eq__(self,student):

return self.name == student.name

 

def __ge__(self,student):

return self.name == student.name or self.name>student.name

 

def __lt__(self,student):

return self.name<student.name

 

def __str__(self):

return "Name: " + self.name + "\nScores: " + \

" ".join(map(str, self.scores))

 

 

def main():

student = Student("Ken", 5)

print(student)

for i in range(1, 6):

student.setScore(i, 100)

print(student)

 

print("\nSecond student")

student2 = Student("Ken", 5)

print(student2)

 

print("\nThird student")

student3 = Student("Amit", 5)

print(student3)

 

print("\nChecking equal student1 and student 2")

print(student.__eq__(student2))

 

print("\nChecking equal student1 and student 3")

print(student.__eq__(student3))

 

print("\nChecking greater than equal student1 and student 3")

print(student.__ge__(student3))

 

print("\nChecking less than student1 and student 3")

print(student.__lt__(student3))

if __name__ == "__main__":

5 0
3 years ago
A condition-controlled loop uses a while loop.<br><br> true<br><br> false
matrenka [14]

Answer:

true

Explanation:

a while loop is a condition-controlled loop. While loops continue no matter what under a certain condition, unless you insert the keyword <em>break.</em>

One example in python is this:

while x > y:

      <em>pass</em>

The keyword to break a while loop may vary depending on the coding language you are using.

<u>Tip</u> The pass keyword allows a no error contact between loop and the terminal. Pass in a nutshell is almost as if saying nothing at all, but just leaving the condition blank. We only use pass because it prevents errors instead of no value.

8 0
2 years ago
List four classification of computer based on their size ​
anyanavicka [17]
There are different sizes like-mini computers, microcomputer, mainframe computer and super computer.
5 0
3 years ago
Other questions:
  • Let's say that you handle the IT systems administration for your company. There's a server inside of your organization that chec
    14·1 answer
  • Which of the following is not an impact device?<br> Joy Stick<br> Track Ball<br> Mouse<br> Printer
    10·1 answer
  • The primary function of a __________ is to translate the URL or web address a user enters in a web browser, into the correct cor
    15·1 answer
  • What are some situations where you might find it useful to use the “!” symbol in a program?
    9·1 answer
  • Which attribute of the image tag specifies the URL of an image
    14·1 answer
  • Each web site contains a(n) ____ page, which is the first document users see when they access the site.
    9·1 answer
  • Your company just installed a new web server within your DMZ. You have been asked to open up the port for secure web browsing on
    5·1 answer
  • Which is the first computer brought in nepal for the census of 2028 B.S​
    6·1 answer
  • Windows hard disks can now use a variety of file systems, including FAT16, FAT32, ____, and Resilient File System.
    8·1 answer
  • The ________ approach to motivation suggests a connection between internal physical states and outward behavior. achievement dri
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!