Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Having a hard time with the syntax here, "syntax error at tax, rateofPay and taxRate"
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Ducky




PostPosted: 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;
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: