Jump to content

Welcome to Geeks to Go - Register now for FREE

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
Photo

help in declaring variables.


  • Please log in to reply

#1
grifter2420

grifter2420

    New Member

  • Member
  • Pip
  • 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

Advertisements


#2
grifter2420

grifter2420

    New Member

  • Topic Starter
  • Member
  • Pip
  • 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.

Attached Thumbnails

  • vl1.PNG
  • vl2.PNG
  • vl3.PNG
  • vl5.PNG
  • vl6.PNG
  • vl7.PNG

  • 0

#3
grifter2420

grifter2420

    New Member

  • Topic Starter
  • Member
  • Pip
  • 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.

Attached Thumbnails

  • vl8.PNG

  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP