68 417
Assignments Done
Successfully Done
In December 2018

Answer to Question #54419 in C++ for nia

Question #54419
Write a C++ program for Cell phone pin number. If the user entered the correct pin code displays.Welcome to Smart.Simply Amazing. The cell phone user will enter his pin code three times; if onthe first, second and third trial he failed to enter the correct pin code it will display code three times also.If the user still failed to enter PUK code will display "SIM BLOCKED".
Expert's answer
#include <iostream>
using namespace std;

int main()
int pincode=1234;
int puckcode=123456;
int userpin =0;
int userpuck = 0;
int attempt = 1;
bool statuspin=false;
bool statuspuck=false;

cout<<"\nPlease enter pin code: ";
if (userpin!=pincode) {cout<<"Pin Code wrong"<<endl;}
else {cout<<"welcome to SMART"<<endl;statuspin=true;break;}
if (statuspin==true) break;

cout<<"\nPlease enter PUCK CODE: ";
if (userpuck!=puckcode) {cout<<"Phone Blocked";statuspin=true;break;};


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions