How do i do this?
Author |
Message |
dian123
|
Posted: 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
|
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
|
|