top of page

Basic Computer Programming Language

 

1. 'Rem Variable for Calculus Fuel Consumption Rates

2. 'Rem TT = 100 [Rate Calculated at 100kms ]

3. 'Rem FC = [Fuel Capacity of Tank ]

4. 'Rem DT = [Distance Travelled]

5. 'Rem HK = [Ratio/100kms]

6. 'Rem FP = [Given Distance for Route]

7. 'Rem CR = [Rate/100kms of Route]

8. 'Rem DR = [Calculated Fuel Consumption of Route]

9. 'Rem Start Intitiating Program

10. cls   'Rem Clear Screen Function

11. a$ = "####.##"   ' Rem Print using Format Assigned to Variable a$

12. 'Rem Print Using Format Executed as [ Print using (a$,Variable) ]

13. TT = 100  'Rem Assigning Variable TT = 100 [Rate Calculated in 100/km]

14. Print chr$(7);:Input " Enter Fuel Tank Capacity in Litres ";FC     ' Rem [Input] Function

15. Print chr$(7);:Input " Enter Distance Travelled on Tank of Fuel ";DT

16. Print 'Rem Line Spacing

17. Gosub [Fuelrate]   'Rem Go to Subroutine for Fuel Rate/100kms Calculus [Gosub] Function

18. Print chr$(7);" Distance of Fuel Tank ";:Print using(a$,DT);" Divided by ";TT;" km/Rate = ";:Print using(a$,HK)

19. Print chr$(7);" Calculated Fuel Rate per 100kms = ";:Print using(a$,FC);" Litre Capacity Divided by ";:Print using(a$,HK);" Rate = ";:Print using(a$,HR);" Litres "

20. Print 'Rem Line Spacing

21. Print chr$(7);:" Rate of Fuel per 100kms = ";:Print using(a$,HR);" Litres/100kms "

22. Print chr$(7);;Input " Enter Route in kms to Calculate Fuel Rate Consumption ";FP

23. Print CHR$(7);:Input " Enter Cost of Fuel $";CF

24. Print 'Rem Line Spacing

25. 'Rem Second Subroutine Calculus

26. Gosub [Distancerate]  'Rem Go to Subroutine to Calculate Fuel in Litres consumed on Route

27. Print chr$(7);" Rate km/100 = ";:Print using(a$,FP);" kms divided by 100kms = [";:Print using(a$,CR);"] "

28. Print chr$(7);" Rate km/100 = [";:Print using(a$,FP);" / ";TT;"] = ";:Print using(a$,CR);" Times ";:Print using(a$,HR);" Litres/100kms = ";:Print using(a$,DR);" Litres "

29. Print chr$(7); "Cost of Fuel for Given Route = $";:Print using(a$,CF);" Times ";:Print using(a$,DR);" Litres = [$";:Print using(a$,TC);"] "

30. End  'Rem End Program

31. [Fuelrate]  'Rem Fuel Rate Subroutine Calculus

32. HK = DT/TT  :  HR = FC/HK

33. Return  'Rem Return Control to Program

34. [Distancerate]  'Rem Distancerate Subroutine Calculus

35. CR = FP/TT  : DR = CR*HR  :  TC = DR*CF

36. Return  'Rem Return Control to Program

 

 

 

 

 

 

 

Program Calculus Functionality

Just Basic vI.01

Just Basic Computer Programming Language.

 

This Program relys on Two Main Fixed Variables [to be entered by the User or Programmer]

[1] The Capacity of Fuel Tank

[2] The Distance in kms the Vehicle can Travel on a Tank of Fuel

 

     When the Program is in [Run] Mode it will ask to Input these Values into the Variables in the Program

 

[3] When the Variables are Entered, the Program will Calculate the Rate of Fuel consumed at 100km Rate

[4] Once the Calculus is Calculated for the Fuel Consumption Rate Per 100kms - Example 6 Litres/100kms.

 

[5] The Program then asks to input the Distance in kms of a Given Route to be taken on the next Jouney.

[6] The Program will the ask for the Cost of Fuel Per Litre when filling the Fuel Tank.

 

[7] The Program will then Calculate the Proposed Route to be Taken at a 100km Rate Intervals.

[8] Once the 100kms Rate Intervals are Calculate on the Proposed Route. The Program multiplys the Fuel Consumption per 100kms

     with the 100km Rate Intervals on the Proposed Route.

[9] This Calculation will Calculate the amount of Fuel to be used on the Proposed Route.

[10] Once the Fuel consumption for the Proposed Route has been determined . The Program will multiply the Value with the

      cost of Fuel per Litre. This calculation will give a costing of Fuel used on the Proposed Route.

 

[11] Any Value can be used in the Computation.

     Line [11] takes care of these proceeding by Using the Print Using Function.

     a$ = "####.##" denotes the Program to Round the Calculated Value to 2 Decimal Value.

     The Four Hash Tags in front of the Decimal ommit a Value in the 1000's.

     If a Higher value is to be used the Hash Tags can be increased accordingly.

 

[12] The Versatility and Computation of Just Basic Programming allows step by step Calculus Functions in understanding the

      processes involved in Value Per Rate Calculus.

      The Two Subroutines in Line 32 and 35 Calculate these Step by step Proceeding in a Sequencial Manner . Thus enabling the

      Programmer to Grasp the Functionality of the Mathematical Values involved in [Value Per Rate Calculus].

 

 

 

bottom of page