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
Luba_88 [7]
3 years ago
7

Having a secure password is a very important practice, when much of our information is stored online. Write a program that valid

ates a new password, following these rules:
• The password must be at least 8 characters long.
• The password must have at least one uppercase and one lowercase letter
• The password must have at least one digit.

Write a program that asks for a password, then asks again to confirm it. If the passwords don’t match or the rules are not fulfilled, prompt again. Your program should include a method that checks whether a password is valid.
Computers and Technology
1 answer:
AVprozaik [17]3 years ago
7 0

public static boolean isValid(String password) {

   Boolean atleastOneUpper = false;

   Boolean atleastOneLower = false;

   Boolean atleastOneDigit = false;

// If its less then 8 characters, its automatically not valid

   if (password.length() < 8) {

       return false;

   }

  for (int i = 0; i < password.length(); i++) {

// Lets iterate over only once.

       if (Character.isUpperCase(password.charAt(i))) {

           atleastOneUpper = true;

       }

       else if (Character.isLowerCase(password.charAt(i))) {

           atleastOneLower = true;

       }

       else if (Character.isDigit(password.charAt(i))) {

           atleastOneDigit = true;

       }

   }

return (atleastOneUpper && atleastOneLower && atleastOneDigit);

// Return true if the password is atleast eight characters long, has atleast one upper, lower and digit

}

You might be interested in
-Which of the following is true about Web services?
Lynna [10]

Answer:

The answer is "Option D".

Explanation:

Web service is also known as an online open software product, which uses a common XML messaging service system. It is used service like HTTP, SOAP, etc, that encrypts messages from all web services.

  • It uses the internet, that enables you the interface or application for the user interaction or exchanging data.
  • It will turn the software into web apps.
7 0
4 years ago
is the practice of using the internet to provide healthcare without going to a doctor’s office or hospital.
devlian [24]

Answer:

Telemedicine refers to the practice of caring for patients remotely when the provider and patient are not physically present with each other. Modern technology has enabled doctors to consult patients by using HIPAA compliant video-conferencing tools.

Explanation:

6 0
3 years ago
2. What type of expansion card allows your computer to
nekit [7.7K]

You can use a peripheral component interconnect Express card (also known as an expansion card) to connect your computer to a wireless network (WLAN).

I hope this helped!

3 0
4 years ago
Netflix suggestions ?
hjlf

Answer:Lost in space

Explanation:It is a great space movie do not watch if your scared

3 0
3 years ago
Read 2 more answers
Declare a structure with a type name: Car containing:
OLga [1]

Answer:

C++ code is given below

Explanation:

#include <iostream>

#include <cctype>

#include <string.h>

#include <cstring>

#include <sstream>

using namespace std;

struct Car {

public:    

char reportingMark[5];    

int carNumber;

string kind;

bool loaded;

string destination;

};

void input(Car *);

void output(Car *);

int main() {

Car *T = new Car;    

input(T);

output(T);    

delete T;    

return 0;

}

void input(Car *T)

{

string str, s;

cout << " Enter the reporting mark as a 5 or less character uppercase string: ";

cin >> str;

for (int i = 0; i < str.length(); i++)

T->reportingMark[i] = toupper(str[i]);

cout << " Enter the car number: ";

cin >> T->carNumber;

cout << " Enter the kind: ";

cin >> T->kind;

cout << " Enter the loaded status as true or false: ";

cin >> s;    

istringstream(s) >> boolalpha >> T->loaded;    

if (T->loaded == true) {

cout << " Enter the destination: ";

cin.ignore();

getline(cin, T->destination);

}

else

T->destination = "NONE";    

}

void output(Car *T)

{

cout << " Reporting Mark: " << T->reportingMark;

cout << " Car Number: " << T->carNumber;    

cout << " Kind: " << T->kind;

cout << " Loaded Status: " << boolalpha << T->loaded;

cout << " Destination: " << T->destination << " ";

}

7 0
4 years ago
Other questions:
  • The fast food restaurant Chipotle pulled its app from Apple's app store when customer demand caused the firm's servers to crash.
    14·1 answer
  • How do i start makeing a Character in the Unreal Game Engine
    14·2 answers
  • A _____ is a device that not only provides surge protection, but also furnishes desktop computers and network devices with batte
    7·1 answer
  • Jeff needs to apply a theme and change the font of the theme in the presentation that he is making. Put the steps in the order t
    14·1 answer
  • If you are working in a word-processing program and need to learn more about its features, the best place to get assistance is f
    7·2 answers
  • Privacy Group of answer choices must be respected if we are to function as complete, self-governing agents is an absolute value
    5·1 answer
  • Suppose that the instruction format for a modified Little Man Computer requires two consecutive locations for each instruction.
    5·1 answer
  • A specialized output device for producing charts, maps, and very high-quality drawings is
    5·1 answer
  • (a) What is the meaning of word 'computer (b) Cive a reason for the evolution of computer (c) Write a weakness of a computer (d)
    14·1 answer
  • Why is it important for organizations to make strong commitment to Cloud at scale?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!