By using Figure 4(a), complete the codes to produce the program output as in Figure 4(b). Figure 4 (a): SOURCE CODE 1. #include 2. #include 3. using namespace std; 4. int main() 5. { 6. char pwd_master[5] "MEL7"; 7. ; //1 declare variables to be used in this program 8. 9. cout<<"Please keyin the password: "; 10. ; //2 store the keyin data in variable pwd with size 5 11. 12. ; //3 backup 3 first letter in pwd to pwd1 13. ; //4 uppercase the keyin password 15. if ( ) //5 compare the master password and keyin //password return true if the value is O 16 cout<<"Correct for the first 4 letters \n"; 17 else 18 cout<<"In correct for the first 4 letters \n"; 19 20. return 0; 21. Figure 4 (b) : OUTPUT CONSOLE (sample 1) Please keyin the password: meL7 Correct for the first 4 letters Figure 4 (b): OUTPUT CONSOLE (sample 2) Please keyin the password: merT In correct for the first 4 letters

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
icon
Concept explainers
Question
By using Figure 4(a), complete the codes to produce the program output as in
Figure 4(b).
Figure 4 (a) : SOURCE CODE
1.
#include <iostream>
2.
#include<cstring>
3.
using namespace std;
4.
int main ()
5.
{
6.
char pwd_master[5] = "MEL7";
7.
; //1 declare variables to be used in this program
8.
9.
cout<<"Please keyin the password: ";
10.
; //2 store the keyin data in variable pwd with size 5
11.
12.
; //3 backup 3 first letter in pwd to pwd1
13.
: //4 uppercase the keyin password
15.
if (
) //5 compare the master password and keyin
//password return true if the value is 0
16
cout<<"Correct for the first 4 letters \n";
17
else
18
cout<<"In correct for the first 4 letters \n";
19
20.
return 0;
21.
}
Figure 4 (b) : OUTPUT CONSOLE (sample 1)
Please keyin the password: meL7
Correct for the first 4 letters
Figure 4 (b) : OUTPUT CONSOLE (sample 2)
Please keyin the password: merT
In correct for the first 4 letters
Transcribed Image Text:By using Figure 4(a), complete the codes to produce the program output as in Figure 4(b). Figure 4 (a) : SOURCE CODE 1. #include <iostream> 2. #include<cstring> 3. using namespace std; 4. int main () 5. { 6. char pwd_master[5] = "MEL7"; 7. ; //1 declare variables to be used in this program 8. 9. cout<<"Please keyin the password: "; 10. ; //2 store the keyin data in variable pwd with size 5 11. 12. ; //3 backup 3 first letter in pwd to pwd1 13. : //4 uppercase the keyin password 15. if ( ) //5 compare the master password and keyin //password return true if the value is 0 16 cout<<"Correct for the first 4 letters \n"; 17 else 18 cout<<"In correct for the first 4 letters \n"; 19 20. return 0; 21. } Figure 4 (b) : OUTPUT CONSOLE (sample 1) Please keyin the password: meL7 Correct for the first 4 letters Figure 4 (b) : OUTPUT CONSOLE (sample 2) Please keyin the password: merT In correct for the first 4 letters
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Operators
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