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
deff fn [24]
3 years ago
7

Your smartphone or tablet may require you to enter a short personal identification number, or PIN. This may be any number in a r

ange of lengths. For our purposes, we will consider PINs to be of length 4, 5, or 6. We use digits 0–9 inclusive. Since PINs can be of different lengths, you need to consider 1111, 01111, and 001111 as separate examples. We provide a testing function check_pin( pin ) which accepts a four-digit guess for pin. check_pin returns True if the PIN number matches the internal PIN. The pin should be provided as a string, that is, '1234', rather than [ '1','2','3','4' ] or [ 1,2,3,4 ]. Compose a function crack_pin() which scans all possible PIN numbers in the valid ranges and returns the correct one. Your submission should include a function crack_pin(). check_pin is already defined for your use.
Computers and Technology
1 answer:
matrenka [14]3 years ago
8 0

Answer:

#include <iostream>

using namespace std;

void crack_pin(string a, int low, int res)

{

if (low == res)

 cout<<a<<endl;

else

{

 for (int i = low; i <= res; i++)

 {

  swap(a[low], a[i]);

  crack_pin(a, low+1, res);

  swap(a[low], a[i]);

 }

}

}

int main()

{

string str = "ABC";

cout <<"Enter pin guess"<<endl;

getline(cin,str);

int n = str.size();

crack_pin(str, 0, n-1);

return 0;

}

Explanation:

Take pin guess  from user using getline method in str variable of type string.

Find size of pin guess.

Declare a function crack_pin and send string, starting (0) and ending (n-1) to function.Call the function recursively to find all combinations.If start=end print string else call function again.

You might be interested in
Join my among us <br><br> code GNLMJF
ryzh [129]

Answer:

i cant

Explanation:

i would but im on a chromebook rn

sorry but thanks

take care

8 0
3 years ago
Read 2 more answers
You can press and hold [Tab] and click the Normal button on the status bar to display the slide master.
tester [92]

Answer:

False.

Explanation:

No, By pressing and holding tab and clicking the normal button on the status bar will not help you in opening the slide master. By holding the shift key and pressing the first icon as shown in this figure will open the slide master for you.

5 0
3 years ago
Read 2 more answers
write the algorithm, flowchart and BASIC program to calculate the area of the rectangle length 50m and width 30m.​
GalinKa [24]

Answer:

The Basic Program is as follows:

10 LENGTH = 50

15 WIDTH = 30

20 AREA = WIDTH * LENGTH

25 PRINT AREA

30 END

The Algorithm is as follows:

1. Start

2. Let Length = 50

3. Let Width = 30

4. Compute Area = Length * Width

5. Display Area

6. Stop

See Attachment for flowchart (flowchart is designed using draw io tools)

Explanation:

The flowchart, algorithm and basic program all follow the same sequence and explanation

Using the basic program as a case study;

Line number 10: The program starts by initializing LENGTH to 50

Line number 15: It then initializes WIDTH to 30

Line number 20: The AREA is calculated by LENGTH * WIDTH

Line number 25: The value of AREA is printed afterwards

Line number 30: Lastly, the program stops execution

8 0
3 years ago
Who do you think first invented or used air crafts first??? If you have an answer that is deep then I will give you the BRAINLIE
vovangra [49]

Answer:

leonardo da vinci

He made the first hot air balloon witch is somewhat flight

and created a glider so

7 0
3 years ago
Read 2 more answers
A user has been complaining that their wireless connection has been connecting and disconnecting too frequently. what command co
riadik2000 [5.3K]
<span>A user has been complaining that their wireless connection has been connecting and disconnecting too frequently. You could use the command </span><span>netsh wlan show wlanreport  to generate a detailed HTML based report for analysis of the wireless connection on their computer in the past.
</span>
<span><span>The netsh tool, is used to generate an interactive <span>WLAN Report</span></span>.
</span>

4 0
4 years ago
Other questions:
  • _____ is a scam in which access to one's own computer is locked or restricted in some way.
    10·1 answer
  • Which of the following can be used to replace internal network addresses with one or more different addresses so the traffic tha
    9·1 answer
  • I’m having trouble with my computer. It’s stuck on this automatic repair screen and every time I try to reset it, it says “Your
    5·1 answer
  • Which of the following types does the Java programming language support?
    9·2 answers
  • 3 applications of cumulative probability distribution in medical field?​
    9·1 answer
  • Clicking a _____ takes you to a webpage that no longer exists or has been moved.
    9·2 answers
  • Write a function called show_info that takes a name, a home city, and a home state (a total of 3 arguments) and returns a full s
    12·1 answer
  • What type of ransomware was developed to block the user from accessing the computer and encrypts all the files on the user's dev
    5·2 answers
  • Which of the following is NOT areserved word in Java?intpublicstaticnum
    9·1 answer
  • Mencione algunos ejemplos en donde sean utilizadas las máquinas de aire comprimido. Justifique su respuesta.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!