Jump to content

Convert to JS


user4fun

Recommended Posts

Hello everyone, i am new at this and i wanted to take the time to understand how the if---elseif statments work so i can give you as much info as i can so you might jsut be able to help mehere is what i would like to do in HUMAN CODE lolUser Inputs two values in two textboxes1 – SalesNum2 – TrafficThen the user would click on a command button “calculate”CONSTANT VALUESErrorMess= Wrong ValueMessage1=You have an EXTREMELY LOWMessage2= You have a VER LOWMessage3= You have a fairly lowMessage4= You currently have a reasonable number at Message5= You currently have the potential of dramatically…..Message6= You have a ver successful…..”Message 7= Thank you for visiting, we have no service to provideEquation to be used when user hits the command buttonSalesPercent = SalesNum/Traffic * 100MissTraffic = SalesPercent – 100If SalesNum > TrafficPrint ErrorMessElseIf SalesPercent < 10Message1 (red bold font) ‘SalesPercent’ (end red bold font) and losing on potential sales of (red bold font) ‘MissTraffic’ (stop red bold font)If 20 > salesPercent < 10 ( if SalesPercent is between 10 and 20)Message2(red bold font) ‘SalesPercent’ (end red bold font) and losing on potential sales of (red bold font) ‘MissTraffic’ (stop red bold font)If 30 > salesPercent < 20 ( if SalesPercent is between 20 and 30)Message3(red bold font) ‘SalesPercent’ (end red bold font) and losing on potential sales of (red bold font) ‘MissTraffic’ (stop red bold font)If 30 > salesPercent < 65 ( if SalesPercent is between 30 and 65)Message4(red bold font) ‘SalesPercent’ (end red bold font) and losing on potential sales of (red bold font) ‘MissTraffic’ (stop red bold font)If 65 > salesPercent < 95 ( if SalesPercent is between 65 and 95)Message5(red bold font) ‘SalesPercent’ (end red bold font) and losing on potential sales of (red bold font) ‘MissTraffic’ (stop red bold font)If 95 > salesPercent < 99.9 ( if SalesPercent is between 95 and 99.9)Message6 (red bold font) ‘SalesPercent’ (end red bold font) and losing on potential sales of (red bold font) ‘MissTraffic’ (stop red bold font)If SalesPercent = 100Message7End all If’sThank you all for your helpIT WOULD be great if i get the code for like the first 2 messages and then i can jsut add the rest myself.THANKX FOR HELPING THE NEW GUY

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...