|
Post by K on Jul 22, 2005 23:37:43 GMT
Okay I have an assignmet for one of my classes to write a program with QBasic using this information:
Write a program where the user enters the hours worked by an employee, the rate of pay for an employee, and the number of deductions for an employee. Using the information entered into the program, the program calculates the gross pay using the formula Gross Pay=Hours worked x Pay rate, amount of deductions using the formula Amount of Deduction=.30 x No. of Deductions, and taxes paoid using the formula Taxes Paid =(Gross Pay-Amount of Deductions) x .12 and the Net Pay using the formula, Net Pay=Gross Pay-NetPay. The program should print the following things, the number the employee worked, the pay rate of the employee, the number of deductions, the gross pay, the amount of the deductions, taxes paid and the net pay.
This is what I've done, but I keep getting errors, if someone could please help me write it correctly it would be GREATLY appreciated!!
LET inthrsworked =0 LET intrateofpay =0 LET intnumofdeductions =0 LET intgrosspay =0 LET intnetpay =0 LET intamtofdeductiosn =0 LET inttaxespaid =0 LET intnumofemployees =0 INPUT Gross Pay=inthrsworked * intrateofpay INPUT Amount of Deductions =.30 * intnumofdeductiosn LET inttaxespaoid =(intgrosspay-intamtofdeductions0 x .15 LET intnetpay =intgrosspay - intnetpay PRINT intnumofemployees, intrateofpay, intnumofdeductions, intgrosspay, intamtofdeductions, inttaxespaid, intnetpay
|
|
|
Post by Ildûrest on Jul 23, 2005 7:59:57 GMT
|
|
|
Post by oo2352 on Sept 17, 2005 13:41:43 GMT
try smaller word as qbasic is 8 octets and the ssytem work on the 16 or even 32 octets.
it may seem obvious but i have done the same insane mistake in the past.....
|
|
|
Post by Mikrondel on Sept 17, 2005 22:32:59 GMT
try smaller word as qbasic is 8 octets and the ssytem work on the 16 or even 32 octets. it may seem obvious but i have done the same insane mistake in the past..... What the.....? Firstly, this has nothing to do with the question, it's the = signs in the INPUTs. Secondly, QBASIC runs in DOS. DOS runs on a Intel x86 16-bit processor. Windows (in general) runs on an Intel x86 32-bit processor. Windows runs a DOS emulator which both acts like it's running on a 16-bit system and performs most of the functions for DOS. So it's BITs, not octets, and QBasic is the same as DOS, i.e. 16 (16 bits is 2 octets, 32 bits is 4 octets)
|
|