Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Aeveus

Pages: [1]
1
Programs / Re: Help with program
« on: May 11, 2020, 05:36:25 pm »
Thanks for the help as always! You guys are the best

2
Programs / Help with program
« on: May 11, 2020, 02:18:31 pm »

Hi there, I know this program might look crude but I've almost got it to do what I want. I can't get it to display the everything at the end, it seems to only show the two that are above 80000.

Code: QB64: [Select]
  1. GOSUB InitializeVariables
  2. GOSUB PrintHeadings
  3. GOSUB ProcessDetail
  4. '
  5. '****************************InitializeVariables**************************
  6. InitializeVariables:
  7. T1$ = "     XYZ COMPANY"
  8. H1$ = "Salesperson          Earnings"
  9. D1$ = "\               \          $$#####"
  10. '
  11. '***************************** Print Headings ****************************
  12. PrintHeadings:
  13. PRINT T1$
  14. PRINT H1$
  15. '**************************** Process Detail *****************************
  16. ProcessDetail:
  17. GOSUB ReadData
  18. DO UNTIL Name$ = "END"
  19.     GOSUB CalculateAnswer
  20.     GOSUB PrintDetail
  21.     GOSUB ReadData
  22. '************************* Print Detail ******************************
  23. PrintDetail:
  24. PRINT USING D1$; Name$,Pay
  25. '*************************** Read Data *************************************
  26. ReadData:
  27. READ Name$, Sales
  28. DATA JILL JOHNSON,90000
  29. DATA DON WILLIAMS,70000
  30. DATA DEE JONES,95000
  31. DATA AL ENNIS,40000
  32. '************************** Calculate Answer ******************************
  33. CalculateAnswer:
  34. IF Sales > 80000 THEN
  35.     PAY = (SALES * 1.1) + 10500
  36.     ELSE
  37.     PAY = SALES + 10000
  38.  
  39.  

3
Programs / Help with program
« on: April 05, 2020, 03:09:08 am »
Hello, I'm having trouble with this program. When I run it it seems like it's looping the menu over and over or something and it won't let me do inputs, and I'm not sure why (or even if that's the case). Any help is appreciated! :)

Code: QB64: [Select]
  1. '******************************* Program Mainline **************************
  2.     GOSUB DisplayMainMenu
  3.     SELECT CASE Choice$
  4.         CASE "1"
  5.             GOSUB UStoPounds
  6.             CASE "2"
  7.             GOSUB PoundstoUS
  8.             CASE "3"
  9.             GOSUB UStoCanadian
  10.             CASE "4"
  11.             GOSUB CanadiantoUS
  12.     END SELECT
  13. LOOP UNTIL Choice$ = "5"
  14. '******************************* Display Main Menu ***********************
  15. DisplayMainMenu:
  16. GOSUB PrintMainTitle
  17. LOCATE 5, 26
  18. PRINT "CURRENCY CONVERTER"
  19. LOCATE 8, 18
  20. PRINT "1. CONVERT US DOLLARS TO POUNDS"
  21. LOCATE 10, 18
  22. PRINT "2. CONVERT POUNDS TO US DOLLARS"
  23. LOCATE 12, 18
  24. PRINT "3. CONVERT US DOLLARS TO CANADIAN DOLLARS"
  25. LOCATE 14, 18
  26. PRINT "4. CONVERT CANADIAN DOLLARS TO US DOLLARS"
  27. LOCATE 16, 18
  28. PRINT "5. END"
  29. LOCATE 19, 16
  30. PRINT "ENTER SELECTION:";
  31. '*************************Print Main Title *******************************
  32. PrintMainTitle:
  33. LOCATE 3, 12
  34. PRINT " C O N V E R T  C U R R E N C Y "
  35. '**************************UstoPounds************************************
  36. UStoPounds:
  37. PRINT "ENTER AMOUNT:"; Amount
  38. ConvertedAmount = AMOUNT * .81
  39. PRINT ConvertedAmount
  40. '****************************PoundstoUS***************************
  41. PoundstoUS:
  42. PRINT "ENTER AMOUNT:"; Amount
  43. ConvertedAmount = AMOUNT * 1.23
  44. PRINT ConvertedAmount
  45. '**************************UStoCanadian****************************
  46. UStoCanadian:
  47. PRINT "ENTER AMOUNT:"; Amount
  48. ConvertedAmount = AMOUNT * 1.42
  49. PRINT ConvertedAmount
  50. '*******************************CanadiantoUS************************
  51. CanadiantoUS:
  52. PRINT "ENTER AMOUNT:"; Amount
  53. ConvertedAmount = AMOUNT * .7
  54. PRINT ConvertedAmount
  55.  

4
Programs / Re: Help with program
« on: March 13, 2020, 02:56:44 pm »
Type-O line #3 spelling not same as sub

Looks good after that (well you could fix up alignments of header labels with data columns).

Thank you so much, lol! I swear I was staring at my screen for an hour looking for typos but I just kept glossing past it I guess.

5
Programs / Help with program
« on: March 13, 2020, 02:32:56 pm »
Hi I'm taking a class where we are learning with qb64 and I can't seem to get this program to run and I just can't figure out why. Any help is very much appreciated!
Code: QB64: [Select]
  1. '*************************** Program Mainline ******************************
  2. GOSUB InitializeVariables
  3. GOSUB PrintHeadings
  4. GOSUB ProcessDetail
  5. GOSUB PrintOutput
  6. '*************************** Initialize Variables ************************
  7. IntitializeVariables:
  8. T1$ = "     MODEL CARS"
  9. H1$ = "Manufacturer#   Yr  Make    Model       Description         Price"
  10. D1$ = "\          \  ##  \     \  \    \   \                          \    ##.##"
  11. TL$ = "TOTAL PRICE                                                  ###.##"
  12. '************************** Print Headings *******************************
  13. PrintHeadings:
  14. PRINT T1$
  15. PRINT H1$
  16. '***************************  Process Detail *****************************
  17. ProcessDetail:
  18. GOSUB ReadData
  19. DO UNTIL Manufacturer$ = "END"
  20.     GOSUB CalculateAnswer
  21.     GOSUB PrintDetail
  22.     GOSUB ReadData
  23. '***************************** Read Data *********************************
  24. ReadData:
  25. READ Manufacturer$, Year, Make$, Model$, Description$, Price
  26. DATA BMR-R79,49,FIAT,500B,GILLETE RAZOR,7.99
  27. DATA HOTWELS-34,57,CHEVY,NOMAD,4/DR STATION WAGON,12.95
  28. DATA MATCHBX-878,73,FORD,BRONC,3/DR 4X4 RED SPARE WHL,25.99
  29. DATA MATCHBX-72,69,BUIK,CENTY,YELLOW TAXI,1.49
  30. DATA BRM-R88,34,BUGAT,TY575,RACER BLACK,35.00
  31. DATA MATCHBX-25,80,LINCO,MRKIV,WHITE LIMOUSINE,14.99
  32. DATA LESNEY-Y42,82,CHEVY,MALBU,4/DR GREEN PASSENGER,1.99
  33. DATA HASBRO-119,75,AMC,GRMLN,2/DR SEDAN YELLOW,1.69
  34. DATA TABY-6332,71,TOYOT,CELIC,2/DR SEDAN BLUE,2.99
  35. DATA BMR-SY238,36,ROLRY,SYLVC,4/DR SEDAN SILVER-GRAY,60.00
  36. DATA "END",0,0,0,0,0
  37. '**************************** Calculate Answer ************************
  38. CalculateAnswer:
  39. TotalPrice = TotalPrice + PRICE
  40. '*************************** Print Detail *******************************
  41. PrintDetail:
  42. PRINT USING D1$; Manufacturer$, Year, Make$, Model$, Description$, Price
  43. '**************************** Print Output ********************************
  44. PrintOutput:
  45. PRINT USING TL$; TotalPrice
  46. '

Pages: [1]