Weekly Qbasic and Qb64 Lesson Topics

General Category => General QB64 Forum => Topic started by: QB513 on January 04, 2014, 12:39:28 pm



Title: Help on simple QBASIC program
Post by: QB513 on January 04, 2014, 12:39:28 pm
Hello everyone,

I am going through a really good (but old) BASIC programming book - "Programming with Microsoft BASIC" Wayne M. Zage and I came across a programming problem that is probably really simple to code but I haven't found a way to make it work. I have attached a word file with the instructions. I appreciate any insight any of you might have.



Title: Re: Help on simple QBASIC program
Post by: GarrisonRicketson on January 06, 2014, 06:50:05 pm
Hello and welcome to the forum, and sorry about the slow response, it would be better if you could post the code here, if it is not to long,
Edited:
There is no code in that file, ?? If you read the book, ""Programming with Microsoft BASIC" Wayne M. Zage "", you should find out, how to write the code to do the problem,  Like wise, if you at least make an attempt at writing the code, and if it won't work, post what you have here, and maybe I can help you, but I do not have time to do your home work for you, and that is what the assignment looks like,..
sorry.


Title: Re: Help on simple QBASIC program
Post by: yash on October 10, 2015, 12:25:53 pm
This will help you to understand QB64 :)
(? -Print , ' - comment )
? "my name"
locate 10 , 10

'this will print your name in column 10 and raw 10.
HAVE A GREAT JOB.
Thanx.
 8) 8) ::)


Title: Re: Help on simple QBASIC program
Post by: Dimster on August 30, 2017, 10:22:34 am
I am new to this website, please consider this reply as me just exploring the site and trying out things to do. I'm sure QB513 has figured out this problem or abandoned coding altogether by now. If QB513 is familiar with Arrays and the Dim function, one way the problem could be solved is to dimension an array to hold each day's pay - so Dim Pay(30). You would then create a for/next loop . for P = 1 to 30. Within the loop you will need a line of code to do the math, ie take a the last day's pay and double it. Then store that value in Pay(P). (Note:Whatever variable you are using for the "last day's pay" should be made equal to "0" before the for/next loop. After the looping has ended you will need another for/next loop to calculate the total of all the values stored in Pay(30). As for the Printed Report, Yash has given a very good hint. The "?" is a shorter way to code the command word "Print" and the use of "Locate" for your columns and rows is the way to go. You simple need to print what you have stored in your Arrays and the Variable you have storing the total amount paid.

Seems there is quite a bid of room for these replies. The Preview shows only one line at a time but that's cool, it does pick up the Bolding and Italic and color.