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

Username:   Password: 
 RegisterRegister   
 creating a 5 pixel wide red box
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
drewthevander




PostPosted: Tue Apr 13, 2010 9:14 am   Post subject: creating a 5 pixel wide red box

need to create a red box, 5 pixels wide around the final paystub. any help would be appreciated. tkanks in advance


%Variable Dictionary
var name, partTime, overTime : string
var hours, overtimehours, rateofpay, Regularpay, Overtimepay, overtimerate, Federaltax, grosspay, netpay : real
var response : string
var depth, width : int

% Start Coding

put "Please enter your name:"
put "Enter name as 'exit' to quit the program."
get name
if name = "exit" then
end if
put "Please enter your regular hours worked."
put "Example: 40"
get hours
put "Please enter your overtime hours worked."
get overtimehours
put "Your total hours worked are ", hours + overtimehours
put "Your regular hours are ", hours, ". Your overtime hours are ", overtimehours, "."
put "Please enter your hourly rate of pay:"
get rateofpay
put "Are you Full or Part Time?"
put "Enter 'F' for full, or 'P' for part time."
get partTime
if partTime = 'F' then
put "You are full time."
else
put "You are part time."
end if
put "What is your over time rate. 1.5x or 2.0x ?"
get overtimerate
put "A federal tax of %20 will be deducted from your pay."
cls
netpay := (hours * rateofpay) + (overtimehours * (rateofpay * overtimerate))
Federaltax := netpay * 0.2
Overtimepay := overtimehours * (rateofpay * overtimerate)
Regularpay := hours * rateofpay
grosspay := Regularpay + Overtimepay
netpay := grosspay - Federaltax

put "Employee Name: ", name, " ", "Hours Worked: ", hours, " ", "Hourly Rate: $", rateofpay
put "Regular Pay : $", Regularpay, " ", "Federal Tax : $", Federaltax
put "Overtime Hours: ", overtimehours
put "Overtime Pay : $", Overtimepay
put "Union Dues : "
if partTime = "F" then
put "$10.00"
else
put "$0.00"
end if
put "Grosspay : $", grosspay, " ", "Netpay: $", netpay

put" "
put" "
put "copyright Drew Vandervechte programming 2010
Sponsor
Sponsor
Sponsor
sponsor
SNIPERDUDE




PostPosted: Tue Apr 13, 2010 10:34 am   Post subject: RE:creating a 5 pixel wide red box

For the final output, look into Font.Draw so you can centre the output on the screen.
Then you will use the Draw.Box command to draw your box. Because it only draws at a width of 1px, you will need to repeat the command changing the values.

Both of these you can learn about in the Turing Walkthrough.
USEC_OFFICER




PostPosted: Tue Apr 13, 2010 11:48 am   Post subject: RE:creating a 5 pixel wide red box

You could draw two Boxen, one red and the other white/whatever colour you need. The non-red one is smaller. (Duh)
SNIPERDUDE




PostPosted: Tue Apr 13, 2010 3:03 pm   Post subject: RE:creating a 5 pixel wide red box

That makes sense.
So use two opaque (Draw.FillBox) boxes:
- one is larger and red
- the other is drawn on top, smaller, and is white.
USEC_OFFICER




PostPosted: Tue Apr 13, 2010 6:59 pm   Post subject: RE:creating a 5 pixel wide red box

Both ways will work though. Pick the one that works for you.
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  [ 5 Posts ]
Jump to:   


Style:  
Search: