Cis 115 Week 3 Exercise Solution

869 words 4 pages
Week 3 Activity—Calculate Overtime Pay
-------------------------------------------------
TCO 3—Given a simple problem, design and desk-check a solution algorithm requiring a modular design that is expressed in terms of pseudocode or program notes, input-process-output (IPO) analysis, and flow chart.
-------------------------------------------------
TCO 4—Given a simple problem that requires one or more decisions, create a working solution that uses decisions with logical and relational expressions.
-------------------------------------------------
TCO 8—Given a more complex problem, develop a complete solution that includes a comprehensive statement of the problem, complete program design, and program documentation.
…show more content…
Use the same valid variable names you used in Step 1.

Note: Students may use multiple If statements instead of Select Case
Note: Students may use multiple If statements instead of Select Case

4) Pseudocode
Describe your solution using pseudocode. Use the same valid variable names you selected in Step 1.

Start Declare Constant MARRIED_RATE .15 Declare Constant SINGLE_RATE .22 Declare Constant WIDOWED_RATE .13 Declare Constant DIVORCED_RATE .23

Input hourlyRate Input hoursWorked Input maritalStatus

Select Case maritalStatus Case ‘M’ taxRate = MARRIED_RATE Case ‘S’ taxRate = SINGLE_RATE Case ‘W’ taxRate = WIDOWED_RATE Case ‘D’ taxRate = DIVORCED_RATE End Select If hoursWorked <= 40 grossPay = hoursWorked * hourlyRate Else regularPay = 40 * hourlyRate overtimePay = (hoursWorked-40) * (hourlyRate * 1.5) grossPay = regularPay + overtimePay Output regularPay Output overtimePay End IF taxAmount = grossPay * taxRate netPay = grossPay – taxAmount

Output grossPay Output netPay
End

5) Visual Basic Code
Screenshot of Running Program
Zipped Project File (submitted to DropBox)

Copy/paste your Visual Basic code here.

Sub Main() Const MARRIED_RATE As Decimal = 0.15 Const SINGLE_RATE As Decimal = 0.22 Const WIDOWED_RATE As Decimal = 0.13 Const DIVORCED_RATE As Decimal = 0.23

Dim

Related

  • Week 3 Assignment
    1666 words | 7 pages
  • BUS610 Week 3 Assignment
    1682 words | 7 pages
  • Cis 210 Week 2 Assignment 1
    1408 words | 6 pages
  • Psych 610 week 7 homewrok exercise
    1328 words | 6 pages
  • Week 3 Quiz
    2608 words | 11 pages
  • Acc 423 Week 3 Wileyplus Assignment - Exercises
    946 words | 4 pages
  • Cis 109 Assignment 3
    1082 words | 5 pages
  • Homework #3 Solutions
    2613 words | 11 pages
  • Week One Exercise Solutions -Set a
    2159 words | 9 pages
  • Sci207: Week 3 - Outline
    2347 words | 10 pages