Output purchase 2 input purchase2 output purchase 3

Info icon This preview shows pages 5–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Output “Purchase 2: Input purchase2 Output “Purchase 3: Output “Purchase 4: Input purchsase4 Input purchase3 Let subTotal = purchase1 + purchase2 + purchase3 + purchase4 Let taxAmount = subTotal * TAX_RATE Let grandTotal = subTotal + taxAmount Output “Purchase subtotal: “ & subTotal Output “Total tax: “ & taxAmount Output “Your grand total: “ & grandTotal End
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Describe your solution using pseudocode or actual Visual Basic code. Use the same valid variable names you selected in Step 1. 1 Start 2 Declare constant decimal TAX_RATE = 0.07 3 Declare decimal purchase1 4 Declare decimal purchase 2 5 Declare decimal purchase3 6 Declare decimal purchase4 7 Output “Purchase 1: 8 Input purchase1 9 Output “Purchase 2: 10 Input purchase2 11 Output “Purchase 3: 12 Input purchase3 13 Output “Purchase 4: 14 Input purchase 4 15 Let subTotal = purchase1 + purchase2 + purchase3 + purchase4 16 Let taxAmount = subTotal * Tax Rate 17 Let grandTotal = subTotal + taxAmount 18 Output “Purchase subtotal: “ & subTotal 19 Output “Total tax: “ & taxAmount 20 Output “Your grand total: “ & grandTotal 21 End 5—Desk-Check
Image of page 6
Desk-check your solution by selecting appropriate test data. Test data: List the values for your test data. Expected output: What is the expected output of your program? For each variable in your program, write the variable name selected in Step 1, in the heading for the variable columns (not all columns may be used). For each step in your algorithm, write its step number in the left column (not all rows may be used). Using the sample inputs above, enter the value of each variable after each step has been executed. Note any output displayed to the user. Step Variables (write variable names in first line below) Output Enter step numb ers Ta x Ra te purcha se1 purcha se2 purcha se3 purcha se4 subTo tal taxAm ount grandT otal 7 Purcha se1 8 10.00 9 Purcha se2 10 5.00 11 Purcha se3 12 15.00 13 Purcha se4 14 50.00 15 80.00 16 5.60 17 85.60 18 Your purchas e Subtota l 19 Your total tax 20 Your
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
grand total 21
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern