Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

¿Visual Logic Controls?


  • Please log in to reply

#1
flight_173

flight_173

    New Member

  • Member
  • Pip
  • 2 posts
Hi I am a college student. I am in a programming class. We were just introduced to visual logic. the assingment is to create a programm that tells you how much change is due to you. and to have it diplay in currecy eg. dollars due are, quarters due are. i realize that in order for the programm to work corectly i have to implemt integers. here is my problem how do i incorperate them. say my change due was $12.5 i want it to take 12.5 divide by one and only give me whole ansers. such as 12 dollars not 12.5 dollars, so that i can take quarters and make it QuartersDue = ChangeDue - dollarsDue and then interger it. a correct program would say 2 quarters due not .5 i asked my proffesor about it via email and he told me to look it up online. i did so and could incorperate intigers through int(#) and mod # however it didnt work through my current vislogic programm or variables. where it states changedue = amontpayed- amount due - tax. then dollars due = change due / 1 and theres the problem i cant divide it by 1 and when i try the integer commands it tells me it wont work any tips or examples. dont answer my work for me though please. thaks dan man
  • 0

Advertisements


#2
john gonsalves

john gonsalves

    New Member

  • Member
  • Pip
  • 1 posts

I have the similar issue. In our book it says integer division and mod. I understand the concept but am struggling with the implementation.

The book (visual logic pg. 11) says Amount/25 will  determine quarters due and Amount Mod 25 would calculate change given after quarters.

However as I mentioned I am unable to implement expressions correctly. I want to do the work myself but cant put the pieces together without some kind of visual example.

Any advice or suggestions would be appreciated. - John G.


  • 0

#3
azarl

azarl

    GeekU Admin

  • Community Leader
  • 25,310 posts

Look at Modulo and Integer functions :) If you perform X MOD INT(x) you are left with the remainder. So (12.5 MOD 12) x 100 = 50 cents

INT(50/25) = 2 Quarters


  • 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