##### Question

In: Computer Science

# Write a program for a beauty store that uses an InputBox to ask the guest for...

Write a program for a beauty store that uses an InputBox to ask the guest for a membership code. Embed this in a Do loop so that the user has to keep trying until the result is a valid membership code that starts with “Beauty” (case insensitive) and is followed by 4 digits with the final digit equal to either 6 or 8. Then use a message box to display the input promotion code and inform the user that the code has been applied. Hint: You can check if a character is a digit by seeing if it is >= “0” and if it is <= “9” (the quotation marks are needed).

## Solutions

##### Expert Solution

Insert this code in any excel VBA editor module (ALT +F11 >> Module > Insert)

Sub LoopInputBoxCheck()
'Scope: An example how to keep looping an input box until unless a valid answer is entered
'
Dim InputQues As String
Dim X As Boolean

X = False

'Question to pose to the user
InputQues = "Please enter Mebmership code" & vbNewLine _
& "(Hint: It starts with Beauty)"

Do
'Retrieve an answer from the user

If Left(Answer, 6) = "Beauty" Then If Len(Answer) = 10 Then If Right(Answer, 1) = 6 Or Right(myAnswer, 1) = 8 Then X = True

If X = True Then MsgBox ("Code " & Answer & "has been applied")

If X = True Then Exit Sub

End Sub

## Related Solutions

##### n-class: Write a program to store exam scores into a file. The program will ask the...
n-class: Write a program to store exam scores into a file. The program will ask the user how many exam scores to enter. Then it will ask the user for each exam score and store them in a file called scores.dat The file output should have the following format . Exam 1: 97 Exam 2: 85 C++ Coding please
##### Write a program in C, that uses standard input and output to ask the user to...
Write a program in C, that uses standard input and output to ask the user to enter a sentence of up to 50 characters, the ask the user for a number between 1 & 10. Count the number of characters in the sentence and multiple the number of characters by the input number and print out the answer. Code so far: char sentence[50]; int count = 0; int c; printf("\nEnter a sentence: "); fgets(sentence, 50, stdin); sscanf(sentence, %s;    for(c=0;...
##### Write a program that uses a while loop with a priming read to ask the user...
Write a program that uses a while loop with a priming read to ask the user to input a set positive integers. As long as the user enters a number greater than -1, the program should accumulate the total, keep track of the number of numbers being entered and then calculate the average of the set of numbers after the user enters a -1. This is a sentinel controlled-loop. Here is what a sample run should look like: Enter the...
##### C++ Bubble Sort Write a program that ask user to enter 7 numbers and store that...
C++ Bubble Sort Write a program that ask user to enter 7 numbers and store that in array. Display that all numbers before and after performing Bubble sort. You must have to create new function with required parameter to perform Bubble sort. Sample Run :- Enter 1 number :- 1 Enter 2 number :- 5 Enter 3 number :- 7 Enter 4 number :- 45 Enter 5 number :- 90 Enter 6 number :- 6 Enter 7 number :- 55...
##### Write a program that uses a structure to store the following weather data for a particular...
Write a program that uses a structure to store the following weather data for a particular month: Total Rainfall High Temperature Low Temperature Average Temperature. The program should have an array of 12 structures to hold weather data for an entire year. When the program runs, it should ask the user to enter data for each month. (The average temperature should be calculated.) Once the data are entered for all the months, the program should calculate and display the average...
##### Write a C++ program that uses array to store the salaries of 10 employees working in...
Write a C++ program that uses array to store the salaries of 10 employees working in a small firm. The program should take average of the salaries and the max and min salaries being paid to the employees
##### Write a program that uses a structure to store the following data: (Remember to use proper...
Write a program that uses a structure to store the following data: (Remember to use proper formatting and code documentation) Member Name Description name student name idnum Student ID number Scores [NUM_TESTS] an array of test scores Average Average test score Grade Course grade Declare a global const directly above the struct declaration const int NUM_TESTS = 4; //a global constant The program should ask the user how many students there are and should then dynamically allocate an array of...
##### Write a program that uses a structure to store the following data about a customer account:...
Write a program that uses a structure to store the following data about a customer account: Name Address City, State and Zip Telephone number Account balance Date of last payment The program should use an array of at least 5 structures. It should let the user enter data into the array, change the contents of any element and display all the data stored in the array. The program should have a menu-driven interface and use functions as appropriate. Input validation:...
##### IN JAVA Write a program that uses a two-dimensional array to store the highest and lowest...
IN JAVA Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. Prompt the user for 12 months of highest and lowest.   Write two methods : one to calculate and return the average high and one to calculate and return the average low of the year. Your program should output all the values in the array and then output the average high and the average low. im trying to...
##### Using JAVA Write a program that uses a 2-D array to store the highest and lowest...
Using JAVA Write a program that uses a 2-D array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and highest and lowest temperatures of the year. Your program must consist of the following methods with their appropriate parameters: a.) getData: This method reads and stores the data in the 2-D array. b.) averageHigh: This method calculates and returns the average high temperature of the year. c.)...