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

Username:   Password: 
 RegisterRegister   
 My first program.Try it out.
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
G-lant




PostPosted: Sat Feb 28, 2004 8:43 pm   Post subject: My first program.Try it out.

This is my first program, its for school. Ive only been talking this class for about 2weeks, and we only started programming this week so what do u think??
code:

%Dan *******.
%Feb, 24.04
%Pay Slip.
%Activity 4 Assignment.
%This program takes your name
%money you make an hour and makes your pay slip.

var name, bank, today:string
var hour, overtime, number, worked:real

%calculation var's
var Income_tax, pension, empl_cont, elployer_cont, tax:real
%just to change the colour
colour (red)

%the 'enter' thingy
put "":3,"################### ENTER INFORMATION IN THIS SECTION ###################"
put "":8,"****** Dogs Breakfast Construction Payrool Program***********"

%starting message
color (green)
put "Hello"
put "what is your name?"..
get name:*
put "thankyou ",name,"."
put " "
put "how much money do you make in one hour? " ..
get hour
put "How many hours did you work "..
get worked
put " "
put "How many hours of overtime did you work??(if none just put '0') "..
get overtime
put " "
put "what is your Enployee number? "..
get number
put " "
put "what bank will you be putting the money into? "..
get bank:*
put " "
put "Please wait wail the computer processes your stub :)."
delay(300)
cls

%processing
put "#     #     #     #     #    #   #"
delay(500)
put " "
delay(500)
put "            #     #     #    #   #"
delay(500)
put " "
delay(500)
put "                  #     #    #   #"
delay(500)
put " "
delay(500)
put "            #     #     #    #   #"
delay(500)
put " "
delay(500)
put "#     #     #     #     #    #   #"
delay(350)
cls

%second processing
put "#     #     #     #     #    #   #"
delay(500)
put " "
delay(500)
put "#     #     #    #   #"
delay(500)
put " "
delay(500)
put "#     #    #   #"
delay(500)
put " "
delay(500)
put "#     #     #    #   #"
delay(500)
put " "
delay(500)
put "#     #     #     #     #    #   #"
delay(350)
cls
put "############### PREPARING TO PRINT YOUR PAYSLIP ######################"
delay(1200)
put "_____________--------------______________------------____________----------"
delay (1100)
put "-------------______________--------------_____________-----------__________"
delay (1000)
put "_____________--------------______________------------____________----------"
delay(500)
put "FIN."
delay (1500)
cls

%out put for stub
date (today)

%main calculations
const pay:=hour*worked
const otrate:=hour*1.5
const otpay:=otrate*overtime
const Gross:=otpay+pay
Income_tax:=Gross*0.27
pension:=Gross*0.003
const EI:=Gross*0.028
const CPP:=Gross*0.025
const Total:=Gross-EI
const total:=Total*0.27
const emp_EI:=1.4*EI
const emp_ben:=0.03*Gross
const emp_pen:=1.2*pension
const total_emp:=emp_EI+emp_ben+emp_ben
const net:=Gross-EI
const ne_t:=net*.27
const net2:=Gross-ne_t
const net3:=net2-EI-CPP

%out put, final
put " "
put "":6, "Elployee Payroll Slip":10,"":7,today
put"********************************************************************************"
put "":3, "Company Name: Dogs Breakfast Construction"
put " "
put " "
put "":6,"Employee: ",name,"":9,"Regular Hours: ", worked
put "":3,"Employee number: ", number,"":13,"Overtime Hours: ", overtime
put "Hourly Rate of pay: $", hour, "":12, "OT Rate of pay: $", otrate
put "":7,"Regular pay: $", pay,"":14, "Overtime pay: $", otpay
put" "
put "":3,"Employee Deductions", "":10,"Employer Contributions"
put "********************************************************************************"
put "":7, "Gross Pay: $", Gross
put "":3, "CPP Deduction: $", CPP,"":25, "Employer CPP: $", CPP
put "":5, "EI Dudction: $", EI, "":24, "Employer EI: $", 1.4*EI
put "":6, "Income Tax: $", Income_tax,"":19,"Employer benfits: $", 0.03*Gross
put "":4, "Pension Plan: $", pension,"":19, "Employer pension: $",1.2*pension
put "":0, "Total Deductions: $", total:0:2,"":2, "Total Employer Contributions: $", total_emp
put "********************************************************************************"
put "":9, "Net pay: $","":0, net3:0:2
put "":23, "Employers bank: Gotham City Bank"
put "":18, "Employers Account Number: 329596031"
put""
put "":20, "Direct Deposited to: ", bank


What do u think??Post and give me feedback, thanks.
Sponsor
Sponsor
Sponsor
sponsor
Paul




PostPosted: Sat Feb 28, 2004 8:47 pm   Post subject: (No subject)

Hm, nicely formated, but put it in the code box thingy (alt+c), also whats up with this?
code:

%second processing
put "# # # # # # #"
delay(500)
put " "
delay(500)
put "# # # # #"
delay(500)
put " "
delay(500)
put "# # # #"
delay(500)
put " "
delay(500)
put "# # # # #"
delay(500)
put " "
delay(500)
put "# # # # # # #"
delay(350)
cls
put "############### PREPARING TO PRINT YOUR PAYSLIP ######################"
delay(1200)
put "_____________--------------______________------------____________----------"
delay (1100)
put "-------------______________--------------_____________-----------__________"
delay (1000)
put "_____________--------------______________------------____________----------"
delay(500)
put "FIN."
delay (1500)
cls

A really bad graphic badly coded loading thing?
That and the typo, its not bad.
shorthair




PostPosted: Sat Feb 28, 2004 8:48 pm   Post subject: (No subject)

your new and thats cool , and your program is fun , ( in 1 year i garuntee that you can make that 50 lines shorter ) and you look like a ery prospective tuging guru , but if you learn one thing when posting here learn this, " Get rid of hte stupid loading bars " none of us apreciate it , but your new and you wouldnt know that so dont sweat it at all , just for future referance Very Happy Very Happy keep up your good work
Delos




PostPosted: Sun Feb 29, 2004 11:38 am   Post subject: (No subject)

That was cool!

And here's the best part...shorthair did NOT bite your head off for using a fake loading/processing bar. He was NICE to you!

Hang around for a few wee...err...days, and you'll see why that is such a rarity!
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: