Computer Science Canada

Having a hard time with the syntax here, "syntax error at tax, rateofPay and taxRate"

Author:  Ducky [ Tue Mar 05, 2019 4:08 pm ]
Post subject:  Having a hard time with the syntax here, "syntax error at tax, rateofPay and taxRate"

var name : string;
var hoursWorked : real;
var rateofPay : real;
var netPay : real;
var taxRate : real;
var totalPay : real;
var netpay : real;
var tax : real;
tax := 28%
var grossPay : real;

put "Please enter your name:"
get name;
put "Please enter the hours you have worked"
get hoursWorked;
put "How much money do you earn?"
get rateofPay;
put"What is tax rate?"
get taxRate;

hoursWorked*rateofPay=grossPay;
grossPay*taxRate=tax;
grossPay-tax=totalPay;

Author:  Insectoid [ Wed Mar 06, 2019 11:44 am ]
Post subject:  RE:Having a hard time with the syntax here, "syntax error at tax, rateofPay and taxRate"

Your last 3 lines are completely wrong. The variable being assigned to goes first, followed by the assignment operator which is :=, not =. Finally, nowhere in your code is a semicolon necessary.


: