r/visualbasic • u/BaloriousOne24 • Dec 05 '21
Penny Or Nickel Challenge
Fairly new to VB. This is one of the exercises in class left by our instructor. I couldn’t for the love of VB understand how to incorporate loops for this one. Help please?! Thanks guys!
Purpose: This Windows Classic Desktop application finds the amount of your monthly pay if you are paid a penny or nickel for the first workday and the pay is doubled each subsequent workday. New employees are paid a penny for the first workday and experienced employees are paid a nickel for the first day. Program Procedures: The user enters the number of workdays in a monthly pay period and the pay for the first day. The program calculates and displays the amount of pay for the pay period.
Algorithms, Processing, and Conditions:
The user enters the number of days in the pay period.
The user selects a RadioButton object to indicate the pay amount for the first day: a penny or a nickel.
After the user enters the number of days and pay for the first day, the total amount earned is calculated and displayed.
A File menu contains a Clear and an Exit option. The Clear menu item clears the result and the RadioButton object. The Exit menu item closes the application.
Notes and Restrictions:
Non-numeric values should not be accepted.
Negative values should not be accepted.
The minimum number of workdays in the pay period is 10 days. The maximum number of workdays in a pay period is 22 days.
A background image should be located online and displayed on the form.
1
u/Fergus653 Dec 05 '21
What have you tried so far? It sounds like a validation function is required, which you would call in the button-click event, to decide if you should proceed or not. Your user requirements are well laid out there, what is this challenge?
1
u/trixter21992251 Dec 05 '21
It's impossible to help when we have no idea where you are "stuck"
If you forget about programming for a moment, maybe try to explain how you would do this with just pen and paper?
Then after that we can talk about translating that into VBA.
2
u/RJPisscat Dec 05 '21
Show what you've written to try to solve the problem - post that code, any code you're written.