Question

In: Computer Science

VISUAL STUDIO CODE Use a for loop for to create "password". Request the password at least...

VISUAL STUDIO CODE 

Use a for loop for to create "password".  Request the password at least 3 times. If the password is 12345, the procedure ends, if the correct password entered, close excel saving changes.

THANKS

Solutions

Expert Solution

Program:

Sub createPassword()


Dim password As String
Dim correctPassword As String
Dim i, p As Integer

' assume the correct password is 12345
correctPassword = 12345
For i = 1 To 3
'accepting the passwords
password = InputBox("Enter your password: ")
'comparing the correct password and user password, if it's true then return 0
p = StrComp(correctPassword, password)
If (p = 0) Then
'saving and closing workbook for correct password
ThisWorkbook.Saved = True
Application.Quit
Exit For
End If
If (i = 3) Then
MsgBox ("You have exceeded 3 attempts! Try next time")
End If
Next i

End Sub


Private Sub CommandButton1_Click()
createPassword
End Sub

Output:


Related Solutions

In visual Studio C++ Create a program that uses a for loop to input the high...
In visual Studio C++ Create a program that uses a for loop to input the high temperature, and low temperature for each day of the week. The high and low will be placed into two elements of the array. For each loop the high and low will be placed into the next set of elements of the array. After the temps for all seven days have been entered into the array, a for loop will be used to pull out...
I need the code for following in C++ working for Visual studio please. Thanks Use a...
I need the code for following in C++ working for Visual studio please. Thanks Use a Struct to create a structure for a Player. The Player will have the following data that it needs maintain: Struct Player int health int level string playerName double gameComplete bool isGodMode Create the 2 functions that will do the following: 1) initialize(string aPlayerName) which takes in a playername string and creates a Player struct health= 100 level= 1 playerName = aPlayerName gameComplete = 0...
USE VISUAL STUDIO/VB In this assignment, you will create an array of ten elements, one for...
USE VISUAL STUDIO/VB In this assignment, you will create an array of ten elements, one for name, one for hours worked,and the last for hourly rate. The arrays will receive the information from inputs from the screen.For example, you will ask the following three questions: a) Employee name: b) Hours worked: c) Hourly rate: After you have received all ten records and have inserted them into the array, you will then calculate the hourly rate times the hours worked to...
Create a C++ project in visual studio. You can use the C++ project that I uploaded...
Create a C++ project in visual studio. You can use the C++ project that I uploaded to complete this project. 1. Write a function that will accept two integer matrices A and B by reference parameters, and two integers i and j as a value parameter. The function will return an integer m, which is the (i,j)-th coefficient of matrix denoted by A*B (multiplication of A and B). For example, if M = A*B, the function will return m, which...
Copy the content of the source code into Visual Studio. Fill in the __BLANKS__ with proper...
Copy the content of the source code into Visual Studio. Fill in the __BLANKS__ with proper code and make it work! (HINT: you will be creating two files with this source code; one .cpp file and one .h file]. Please alter the code so that: YOUR first and last name appears as the fourth customer [Make up your balance and phone number.] Your Instructors first and last name appears as the fifth customer [Make up the balance and phone number.]...
Create a new “Area” project. Create a new Visual Studio Project and call it “Area”. This...
Create a new “Area” project. Create a new Visual Studio Project and call it “Area”. This project will be used to calculate the area of certain figures, like circles, squares and rectangles. So add a title to the Form. The Form Title should say “Area”. Also add 3 labels, 3 Buttons, 3 Textboxes and 3 RadioButtons. The 3 Buttons should be near the bottom of the Form and say “Calc Area”, “Clear” and “Exit”. Make sure to give all your...
Create an ASP.Net Website using Visual Studio with C#: Create a simple calculator that has 3...
Create an ASP.Net Website using Visual Studio with C#: Create a simple calculator that has 3 text boxes: 2 of them to enter numbers, the 3rd one displays the results Create 4 buttons to add, subtract, multiply, and divide Prevent the user from entering text in the number fields Display a message indicating “cannot divide by” when the user click “/” and there is a zero the in the second box Create two additional buttons: - One to store data...
Create a C# .NET Core Console project in Visual Studio. (This is the same kind of...
Create a C# .NET Core Console project in Visual Studio. (This is the same kind of project we have been doing all semester.) Do all of the following in the Program class. You do not need to add any other classes to this project. 2. If it exists, remove the Console.WriteLine(“Hello World!”); line that Visual Studio created in the Program class. 3. At the very top of the Program.cs page you should see using System; On the empty line below...
In Assembly Language (Visual Studio 2017), create a procedure that generates a random string of Length...
In Assembly Language (Visual Studio 2017), create a procedure that generates a random string of Length L, containing all capital letters. When calling the procedure, pass the value of L in EAX, and pass a pointer to an array of byte that will hold the random string. Write a test program that calls your procedure 20 times and displays the strings in the console window. In your program, the random string size shall be preset as a constant. Please include...
using Visual Studio write a code containing a main() program that implements the coin change state...
using Visual Studio write a code containing a main() program that implements the coin change state machine in C++ according to the guidance given in Translating a state machine to C++ Test your code using prices 1 and 91 cents, and assume change is calculated from a dollar bill. Copy and paste your console output to a text editor and save the result in a single file named console.txt. Upload your exercise081.cpp and console.txt files to Canvas.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT