I need to code that if I input a certain place in “Leaving from”, it registers it as the designated number.
For example, I typed “Kamuning” in “Leaving From” and “Boni” in “Going to”. It will show the cost through the range. Kamuning is station 3 and Boni is station 8 so that’s going through 5 stations which will be 20 Php. Please I need help. I need this to graduate :(((
Show us what you’ve made so far and explain what works/does not work and someone can probably help you with a specific question. Include a link to your project. You can start by Googling or searching the forums for similar concepts.
Here’s Code and Explanation-
1.First of all you have to add a Data Source in which the Data of Stations, there Numbers, Fares on Distance are Saved.
2.Then you have to make a UI so that user can Choose the Leaving from and Going to Station and can also check the fares.
Now you have to code the app.
3. First add some Variables which will save data of From & To Stations, Station numbers, and Distance between stations.
4. After this, Join Blocks so that the Variable Save data of the Leaving and Going Station.
5. Because we will calculate distance between Stations by Subtracting the Stations No., we will do Code so that Variables save data of the Station No.(From & To).
6. We have now got the Station Number, so we will Subtract Station No. to each other so that we can get the Distance between them.
7. Now we will get the fare from the Data using the Value of Distance Between Stations And we will Set the Label 1’s value to the Fare.
Thank you so much! This helped a lot.