Hello. I need help in a C++ program, that checks passwords, but I'm not really sure how to continue. Program Requirements: Use an array to hold the good passwords and an array hold the bad passwords as you process through the file. Use a void function that accepts an array of strings and an integer containing the number of elements in the array to print the contents. Use .length() Use a boolean function that accepts a string as the sole argument and returns true or false depending on whether the password is good or bad based on the following rules: Rules for a valid (good) password The password must be at least 9 characters long The password must have at least 3 uppercase alphabetic letters The password must have at least 3 digits (0-9) The password may not have space characters in it

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Hello. I need help in a C++ program, that checks passwords, but I'm not really sure how to continue.

Program Requirements:

  • Use an array to hold the good passwords and an array hold the bad passwords as you process through the file.

  • Use a void function that accepts an array of strings and an integer containing the number of elements in the array to print the contents.

  • Use .length()
  • Use a boolean function that accepts a string as the sole argument and returns true or false depending on whether the password is good or bad based on the following rules:

  • Rules for a valid (good) password

    • The password must be at least 9 characters long
    • The password must have at least 3 uppercase alphabetic letters
    • The password must have at least 3 digits (0-9)
    • The password may not have space characters in it
1 #include <iostream>
2 #include <iomanip>
#include <fstream>
3
4
5 void Something (int arr[], int size);
6
bool Nothing (std::string);
7
8
9
10
float pass;
11
double bad_password ;
12 double good_password;
13
456
14
15
int main() {
std::string filename;
16
17
33
34
35
36
37
38
39 }
std::ifstream data_file;
18
19
20
21 ✓ while(true){
22 ✓
23
24
25
26
27
28
29 }
30
31 ✓ void Something (int arr[], int size) {
32 ✓ for (int i = 0; i < pass; i++){
}
std::cout << "Enter file to process: << std::endl;
std::cin>> filename;
data_file.open(filename);
}
}
if(!data_file) {
std::cout << filename << " does not exist." << std::endl;
}
else if(pass.length() <= 9){
bad_password++;
}
"
bool Nothing (std::string){
Transcribed Image Text:1 #include <iostream> 2 #include <iomanip> #include <fstream> 3 4 5 void Something (int arr[], int size); 6 bool Nothing (std::string); 7 8 9 10 float pass; 11 double bad_password ; 12 double good_password; 13 456 14 15 int main() { std::string filename; 16 17 33 34 35 36 37 38 39 } std::ifstream data_file; 18 19 20 21 ✓ while(true){ 22 ✓ 23 24 25 26 27 28 29 } 30 31 ✓ void Something (int arr[], int size) { 32 ✓ for (int i = 0; i < pass; i++){ } std::cout << "Enter file to process: << std::endl; std::cin>> filename; data_file.open(filename); } } if(!data_file) { std::cout << filename << " does not exist." << std::endl; } else if(pass.length() <= 9){ bad_password++; } " bool Nothing (std::string){
Sample Run 1
Enter file to process: bothtypes.txt
Bad Passwords
Qwertyuiop
Iloveyou
000000
Bad PasswoRd123
Good Passwords
ABC123good
ThisIsA1337Password
T35tIng7hInGs
GrEaTPa33word
This-Is-Valid123
MyBirthdayIs1953
MykidsBirthdayIs1980
30.30% of passwords were bad.
Sample Run 2
Enter file to process: allgoodfile.txt
Bad Passwords
Good Passwords
ABC123good
ThisIsA1337Password
T35tIng7hInGs
GrEaTPa33word
This-Is-Valid123
MyBirthdayIs1933
MyKidsBirthdayIs1980
0.00% of passwords were bad.
Sample Run 3
Enter file to process: allbadfile.txt
Bad Passwords
123456
123456789
Qwerty
Password
12345
12345678
111111
1234567
123123
Qwerty123
1q2w3e
1234567890
DEFAULT
Abc123
654321
123321
Qwertyuiop
Iloveyou
000000
Bad PasswoRd123
Good Passwords
100.00% of passwords were bad.
Transcribed Image Text:Sample Run 1 Enter file to process: bothtypes.txt Bad Passwords Qwertyuiop Iloveyou 000000 Bad PasswoRd123 Good Passwords ABC123good ThisIsA1337Password T35tIng7hInGs GrEaTPa33word This-Is-Valid123 MyBirthdayIs1953 MykidsBirthdayIs1980 30.30% of passwords were bad. Sample Run 2 Enter file to process: allgoodfile.txt Bad Passwords Good Passwords ABC123good ThisIsA1337Password T35tIng7hInGs GrEaTPa33word This-Is-Valid123 MyBirthdayIs1933 MyKidsBirthdayIs1980 0.00% of passwords were bad. Sample Run 3 Enter file to process: allbadfile.txt Bad Passwords 123456 123456789 Qwerty Password 12345 12345678 111111 1234567 123123 Qwerty123 1q2w3e 1234567890 DEFAULT Abc123 654321 123321 Qwertyuiop Iloveyou 000000 Bad PasswoRd123 Good Passwords 100.00% of passwords were bad.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education