Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

# help in declaring variables.

### #1 grifter2420 Posted 16 September 2011 - 09:44 AM

grifter2420

New Member

• Member
• 3 posts
I am an online student which has its flaws in learning. I have asked (emailed and posted in the threads) a question regarding Visual Logic. I have browsed through visual logic questions posted here and realize that no help for homework is a rule. I ask not so much for help doing my work as much as I ask in simply declaring a letter as a readable variable.

I have an assignment that is to create a program that figures out base pay, OT pay, and taxes depending on tax bracket. I have the structure set right with all the proper "If conditions". The thing is that none of my conditions trigger. They are supposed to trigger when entering the letter corresponding with the tax status: Married, Divorced, Single, Widowed. No matter what I have done, the conditions always trigger to the false side of the conditions.

Input: (taxBracket)Please indicate if your filing status is M (married), S (single), D (divorced), W (widowed)

If (taxBracket = M) (this is how my condition is written)
then taxes = .15 * totalSal
If taxBracket = S
then taxes = .22 * totalSal
etcetc

Now, I know my structure is set because when I change the if conditions to numbers it always triggers the right conditions

If taxBracket = .15
then taxes = .15 * totalSal
If taxBracket = .22
then taxes = .22 * totalSal
• 0

### #2 grifter2420 Posted 16 September 2011 - 10:06 AM

grifter2420

New Member

• Topic Starter
• Member
• 3 posts
Here's some screenshots to show what I got and the command execution. At the end of the screenshots you will see how it doesn't work with letter variables but it works with number variables in the If conditions.

Any help on correcting this flaw would be much appreciated.

• 0

### #3 grifter2420 Posted 16 September 2011 - 12:46 PM

grifter2420

New Member

• Topic Starter
• Member
• 3 posts
Haha, nevermind guys. I just needed a break away from it to figure it out.
Had to declare each letter as a variable for itself before the tax portion ran.
Works like a charm now.

• 0

### Similar Topics

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users