Steven_Barry_Week4 Assignment

Steven_Barry_Week4 Assignment - Input Name Write...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Module Main Declare Name as String Declare Price as Real Declare UnitPrice as Real Declare Quantity as Real Declare Discount as Interger Declare Subtotal as Real Declare Total as Real Declare Tax as Real Declare Itemsubtotal as Real Declare Response as String Declare TaxRate as Real Declare TaxStatus as String Call User Input module Call Calculate Tax module Call Total Module End Main Module User Input Module Write "Please enter the item name." Input Name Write "Please enter the item price." Input Price Write “Please enter quantity of the item” Input Quantity If Quantity>=4 Then itemSubtotal= Price*Quanity-Discount Else Quantity<4 Then itemSubtotal= Price*Quanity End if Write Name” “itemSubtotal Write “Would you like to enter another Item(Y or N)?” Input Response If Response ”Y” Or “N” Then Write “Please enter your choice again (Y or N)” Input Response Repeat While Response=”Y” Write "Please enter the item name."
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Input Name Write &quot;Please enter the item price. Input Price Write Please enter quantity of the item Input Quantity If Quantity&gt;=4 Then Subtotal= Price*Quanity-Discount Else Quantity&lt;4 Then Subtotal= Price*Quanity Endif Write Name Subtotal Set itemSubtotal= Subtotal+itemSubtotal End While Until Response=N End User Input Module Calculate Tax Module Write Is the customer Tax Exempt(Y or N)? Input TaxStatus If TaxStatus=N Then Tax=(Subtotal*TaxRate) ElseIf TaxStatus=Y Then Tax=0 End If End Calculate Tax Module Total Module Total=Subtotal+Tax Write The Subtotal is Subtotal. Write Tax is Tax. Write The Grand Total of Purchases is Total . End Total Module Test Case 1: Valid Item Name = Input Inputs: Any string value Expected Outputs: Write Please enter Item price Input Price...
View Full Document

Page1 / 2

Steven_Barry_Week4 Assignment - Input Name Write...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online