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
Serjik [45]
3 years ago
14

4.15 LAB: Password modifier

Computers and Technology
1 answer:
Black_prince [1.1K]3 years ago
3 0

I've included my code in the picture below. Best of luck.

You might be interested in
What are the differences between switches and routers? cse question
deff fn [24]

Answer:

The main objective of router is to connect various networks simultaneously and it works in network layer

Explanation:

The main objective of router is to connect various networks simultaneously and it works in network layer

7 0
3 years ago
Write a program that simulates rolling one die using the following steps: 1. Prompt the user for the number of sides on the die.
Mashcka [7]

Answer:

The program to the given question can be given as:

Program:

//import package.

import java.util.*;                    

//define class.

public class Main                    

{

 public static void main(String ar[])  //define main method.  

 {

Scanner  ob = new Scanner(System.in);     //creating scanner class object.

   Random ran = new Random();                 //creating random class object.

   int roll1,roll2,roll3,number,total=0;          //define variable.

   float avg=0;

   System.out.print("Enter the sides= ");           //print message.

   number = scanner.nextInt();                 //input number by user.

   roll1 = ran.nextInt(number++);         //using random function.

   roll2 = ran.nextInt(number++);

   roll3 = ran.nextInt(number++);

   System.out.print("First roll= ");           //print message

   System.out.println(roll1);               //print value.

   System.out.print("Second roll= ");

   System.out.println(roll2);

   System.out.print("Third roll= ");

   System.out.println(roll3);

   System.out.print("total roll= ");

   total=roll1+roll2+roll3;                            //add all number.

   System.out.println(total);

   System.out.print("Average roll= ");                      

   avg=total/3;                                 //Average of the number.

   System.out.println(avg);

 }

}

Output:

Enter the sides= 4

First roll= 2

Second roll= 3

Third roll= 5

total roll= 10

Average roll= 3.0

Explanation:

In the above program first, we import the package form the user input and random number. In java, there are many packages but we use only the util package because in that package both the class like scanner class and random class are inbuilt. Then we declare the class that name is Main in that class we define the main function. In the main function, we create both class object (scanner class and random class). Then we take input a number from the user and pass into the random function. The random function is used to give a unique number and we pass the number into the random function that is increasing by post-increment operator i.e (X++). Then we print all the rolls and total by add all the roll and at the last, we print an average of it.

7 0
3 years ago
What is the difference page break and column break ​
algol13
A page break starts a new page. A column break starts a new column, while a section break indicates a change in formatting within the same page.
7 0
3 years ago
Read 2 more answers
Monster Collector
Lera25 [3.4K]

Answer:

In java:

import java.util.*;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 int monsternum, usernum;

 int count = 0;

 Random rand = new Random();

 String [] monsters = {"wild pikamoo","wild bulbaroar"};

 for(int i =0;i<2;i++){

     monsternum = rand.nextInt(5);  

     System.out.print("A "+monsters[i]+" appears! Guess a number between 1 and 5: ");

     usernum = input.nextInt();

     if(monsternum == usernum){      count++;      System.out.println("Congratulations, you caught a "+monsters[i]+"!");  }

 else{      System.out.println("You almost had it, but the monster escaped.");  }

 

 }

 System.out.println("There are no more monsters to encounter!");

 System.out.println("You caught "+count+" monsters of 2");

 if(count!=2){      System.out.print("Keep training to be the very best!");  }

 else{      System.out.print("You're the monster collector master!");  }

}

}

Explanation:

This declares monster and user number as integers

 int monsternum, usernum;

Initialize count to 0

 int count = 0;

Call the random object

 Random rand = new Random();

Create a string array to save the monster names

 String [] monsters = {"wild pikamoo","wild bulbaroar"};

Iterate for the 2 monsters

 for(int i =0;i<2;i++){

Generate a monster number

     monsternum = rand.nextInt(5);  

Prompt the user to take a guess

     System.out.print("A "+monsters[i]+" appears! Guess a number between 1 and 5: ");

Get user guess

     usernum = input.nextInt();

If monster number and user guess are equal, congratulate the user and increase count by 1

<em>      if(monsternum == usernum){      count++;      System.out.println("Congratulations, you caught a "+monsters[i]+"!");  } </em>

If otherwise, prompt the user to keep trying

<em>  else{      System.out.println("You almost had it, but the monster escaped.");  }  </em>

<em>  } </em>

Print no monsters again

 System.out.println("There are no more monsters to encounter!");

Print number of monsters caught

 System.out.println("You caught "+count+" monsters of 2");

Print user score

<em>  if(count!=2){      System.out.print("Keep training to be the very best!");  } </em>

<em>  else{      System.out.print("You're the monster collector master!");  } </em>

5 0
3 years ago
A display that is thin, flexible, light, and easy to read in all types of light is a(n) _____. touch screen computer. electronic
vfiekz [6]

The answer is an electric paper display

An electric paper display replicates the look and feel of ink and paper. They are very thin and only require power when an image is requested. An EPD is based on electrophoresis, which is the movement of electrically charged molecules. Instead of emitting light, the electric paper display reflects light like paper and operates on the basis of the motion of dispersed particles in a fluid. This fluid is always under the influence of an electric field.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Which information technology job has the lowest predicted 10-year growth? computer programmer software developer computer suppor
    13·1 answer
  • In the lab, you used the filter box in Wireshark to remove traffic from port 3389. What is that port used for? What filter synta
    12·1 answer
  • Assume that aList is a valid ArrayList containing the following:
    8·1 answer
  • Objectivity is only a small part of assessing a Web site. <br> a. True<br> b. False
    10·1 answer
  • The file extension for Access 2007 and 2010 database filenames is .accdb. What is the file extension for older versions of Acces
    5·1 answer
  • What are the examples of personal computers ?
    8·1 answer
  • Making sure that your business has something special and distinct to offer is known as?
    12·1 answer
  • To convince the server that a user is authentic, the authentication server creates a _________ that contains the user's ID and n
    13·1 answer
  • PLEASE HELP! 100 POINTS!
    7·1 answer
  • an existing technology that would allow users to transfer images from the camera to the computer without connecting them
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!