Declare Integer Employees
Declare Constant Integer Max_value = 250
Declare String employeesName
Declare Real hoursWorked
Declare Real hourlyPayRate
Declare Real grossPay
Declare Real overtimeHrsWorked
Declare Real overtimePay
Declare Real tax
Declare Real netPay
Display "Pay Calculator"
Display "Enter the values to calculate the gross pay of an employee"
Display "Please enter employee's name."
Display "Please enter number of hours the employee worked."
Display "Please enter employee's hourly pay rate."
Set grossPay = hoursWorked * hourlyPayRate
If hoursWorked>40 Then
overtimeHrsWorked = hoursworked - 40
overtimePay = (hoursWorked * (hourlyPayRate * 1.5)
If grossPay < 1500 Then
tax = .15 * grossPay
Else If grossPay >= 1500 And If grossPay <3000 Then
tax = .19 * grossPay
Else If grossPay >= 3000 And If grossPay <4500 Then
tax = .21 * grossPay
Else If grossPay >= 4500 And If grossPay <6000 Then
tax = .23 * grossPay
tax = .27 * grossPay
netPay = grossPay + overtimePay – tax
Display “The Employees Name is: “ + employeesName
Display “Hours worked: “ + hoursWorked
Display “Hourly pay rate: $ “ + hourlyPayRate
Display “Gross pay: $ “ + grossPay
Display “Tax: $ “ + tax
Display “Net pay: $ “ + netPay
Display “Thank you for using the Pay Calculator.”
Display “Press any key to quit Pay Calculator.”
My question is "Is this the way it should look or am I missing something? In visual logic they don't give you examples similar to what we have to code. I am very new at this and I am feeling rather overwhelmed by this class. I love the idea of being able to code almost anything but I'm not sure how things should look. I have bought numerous books on different languages but they don't offer anything in the way of good examples. Is there a beginning programming book that you could recommend that has vast examples for me to follow or get an adequate idea of how to do something in that fashion. I don't want anyone to do my homework for me but how can I learn to do this if there is not structure example for me to get any info from. I'm so frustrated with this class that I'm on the edge of calling it quits. It's not even a programming class yet, it's called logic and design, a pre-class to pre-programming. What will I do when I have to actually code? Someone please help me?
More examples of Visual logic flowcharts
Page 1 of 1
0 Replies - 5168 Views - Last Post: 29 January 2010 - 01:47 PM
Page 1 of 1