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

Username:   Password: 
 RegisterRegister   
 How do i do this?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
dian123




PostPosted: Thu Oct 28, 2010 3:32 pm   Post subject: How do i do this?

What is it you are trying to achieve?
I want to do a paycheck program..


What is the problem you are having?
but i am stuck here, we have to do a box that is enclose by a *, and when i write it the box only has 2 side. Also we need to input the name,SIN,hours worked, hourly wage, and total pay inside the box. They suppose to already exist like, 2 items on one line. But when i run it i have to type my name and SIN first and then it will appear the hours worked and the hourly wage...... and the * moved so my box didnt enclose anymore.

Describe what you have tried to solve this problem
This is my input

locate (2, 66)
put "*"
put "Name", " ", "SIN"
get name : *
locate (4, 42)
get SIN : *



locate (6, 66)
put "*"
put "Hours Worked", " ", "Hourly Wage"
get hoursW
locate (8, 42)
get hourlysW



locate (10,66)
put "*"
grossPay :=(hoursW*hourlysW)
deductions :=(grossPay*0.2)
netPay :=(grossPay-deductions)
put "GrossPay",grossPay, " ", "Deductions",deductions:5:2, " ", "Net Pay",netPay:5:2

Turing:


This is everythig i typed, sorry i know it is really long...
var name : string
var SIN : string
var hourlysW : real
var hoursW : real
var grossPay : real
var deductions : real
var netPay : real




put repeat ("*", 66)
locate (1, 66)
put "*"

locate (2, 66)
put "*"

locate (3, 66)
put "*"

locate (4, 66)
put "*"

locate (5, 66)
put "*"

locate (6, 66)
put "*"

locate (7, 66)
put "*"

locate (8, 66)
put "*"

locate (9, 66)
put "*"

locate (10, 66)
put "*"

locate (11, 66)
put "*"

locate (12, 66)
put "*"

locate (13, 66)
put "*"



put repeat ("*",66)
locate (1, 66)
put "*"




locate (2, 66)
put "*"
put "Name", "                                     ", "SIN"
get name : *
locate (4, 42)
get SIN : *



locate (6, 66)
put "*"
put "Hours Worked", "                             ", "Hourly Wage"
get hoursW
locate (8, 42)
get hourlysW


locate (10,66)
put "*"
grossPay :=(hoursW*hourlysW)
deductions :=(grossPay*0.2)
netPay :=(grossPay-deductions)
put "GrossPay","           ", "Deductions", "            ", "Net Pay"
put "$", grossPay,"            ", "$", deductions:5:2, "               ","$", netPay:5:2
Sponsor
Sponsor
Sponsor
sponsor
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  [ 1 Posts ]
Jump to:   


Style:  
Search: