program Receipt
!-----------------------------------------------------------------------------------------------------------
! Christina Urbanczyk Lab 5 Assignment February 24, 2011
! This program determines the total cost of purchases made at a department store in the Arcata Plaza.
! Variables used are:
! ShirtQuantity:Number of shirts for purchase
! ShirtTotal: Cost of all shirts for purchase
! Subtotal:Cost of all purchases before sales tax
! SalesTax:Tax from total purchase
! TotalCost: Total cost of purchase
! PantsQuantity: Number of pants for purchase
! PantsTotal: Cost of all pants for purchase
! ShoesQuantity: Number of shoes for purchase
! ShoesTotal: Cost of all shoes for purchase
! SuitQuantity: Number of suits for purchase
! SuitTotal: Cost of all suits for purchase
! IOerror: Input/Output error
! GetOrder: Subprogram to request items for purchase
!
! Input: ShirtQuantity, PantsQuantity, ShoesQuantity, SuitsQuantity
! Output: ShirtTotal,PantsTotal, ShoesTotal, SuitTotal, Subtotal, SalesTax, TotalCost
!-----------------------------------------------------------------------------------------------------------
IMPLICIT NONE
integer , parameter :: dp = selected_real_kind ( 15 ) !15 Significant Figures
integer :: ShirtQuantity , PantsQuantity,ShoesQuantity, SuitQuantity, ioerror
real ( dp) :: ShirtTotal , PantsTotal, ShoesTotal, SuitTotal, Subtotal, SalesTax, TotalCost
real ( dp) ,parameter :: ShoesCost = 35.85 ,SuitCost= 125.15 ,TaxRate= .09, ShirtCost= 19.95 ,PantsCost= 22.95
CALL GetOrder(ShirtCost,'Shirts',ShirtQuantity)
CALL GetOrder(PantsCost,'Pants',PantsQuantity)
CALL GetOrder(ShoesCost,'Shoes',ShoesQuantity)
CALL GetOrder(SuitCost,'Suits',SuitQuantity)
!Calculate subtotal of individual items
ShirtTotal= ShirtQuantity* ShirtCost
PantsTotal= PantsQuantity* PantsCost
ShoesTotal= ShoesQuantity* ShoesCost
SuitTotal= SuitQuantity* SuitCost
!Calculate subtotal of all items
Subtotal= ShirtTotal+ PantsTotal+ ShoesTotal+ SuitTotal
!Calculate sales tax of purchase
SalesTax= Subtotal* TaxRate
!Calculate total cost of purchase
TotalCost= Subtotal+ SalesTax
!Print receipt for purchase
IF ( Subtotal/= 0 ) THEN
write ( * ,* ) "|--------------------------------------------|"
write ( * ,* ) "| Christina's Store |"
write ( * ,* ) "| The Plaza |"
write ( * ,* ) "| Arcata, CA 95521 |"
write ( * ,* ) "| |"
write ( * ,* ) "|--------------------------------------------|"
write ( * ,* ) "| ITEM NUMBER COST |"
write ( * ,* ) "|--------------------------------------------|"
END IF
IF ( Subtotal<= 0 ) THEN
write ( * ,* ) "Thanks for coming to Christina's Store. Have a good day."
END IF
IF ( ShirtTotal>0 ) THEN
write ( * ,'(T2,A7,T22,I2,T39,F6.2,T47,A1)' ) "| Shirt" ,ShirtQuantity,ShirtTotal,"|"
write ( * ,* ) "|--------------------------------------------|"
END IF
IF ( PantsTotal>0 ) THEN
write ( * ,'(T2,A7,T22,I2,T39,F6.2,T47,A1)' ) "| Pants" ,PantsQuantity,PantsTotal,"|"
write ( * ,* ) "|--------------------------------------------|"
END IF
IF ( ShoesTotal>0 ) THEN
write ( * ,'(T2,A7,T22,I2,T39,F6.2,T47,A1)' ) "| Shoes" ,ShoesQuantity,ShoesTotal,"|"
write ( * ,* ) "|--------------------------------------------|"
END IF
IF ( SuitTotal>0 ) THEN
write ( * ,'(T2,A6,T22,I2,T39,F6.2,T47,A1)' ) "| Suit" ,SuitQuantity,SuitTotal,"|"
write ( * ,* ) "|--------------------------------------------|"
END IF
IF ( Subtotal>0 ) THEN
write ( * ,'(T2,A26,T39,F6.2,T47,A1)' ) "| Subtotal" ,Subtotal,"|"
write ( * ,* ) "|--------------------------------------------|"
write ( * ,'(T2,A19,T39,F6.2,T47,A1)' ) "| Sales Tax" ,SalesTax,"|"
write ( * ,* ) "|--------------------------------------------|"
write ( * ,* ) "|--------------------------------------------|"
write ( * ,'(T2,A15,T39,F6.2,T47,A1)' ) "| Total" ,TotalCost,"|"
END IF
IF ( Subtotal>0 ) THEN
write ( * ,* ) "|--------------------------------------------|"
write ( * ,* ) "| THANK YOU |"
write ( * ,* ) "|--------------------------------------------|"
END IF
CONTAINS
!--GetOrder--------------------------------------------------------------------------------------------
! The subprogram asks the shopper for the amount of items for purchase to calculate cost of each item.
! ACCEPTS: ItemCost,ItemName
! RETURNS: NumItem
!------------------------------------------------------------------------------------------------------
SUBROUTINE GetOrder( ItemCost,ItemName,NumItem)
real ( dp) ,INTENT ( in ) :: ItemCost
character(*),INTENT(in)::ItemName
integer ,INTENT ( out ) :: NumItem
DO
write ( * ,'("How many ",A," would you like to buy at ",F6.2,"?")' ) ItemName,ItemCost
read ( * ,* ,iostat = ioerror) NumItem
IF ( ioerror/= 0 ) THEN
write ( * ,* ) "Please enter a positive integer."
ELSE IF ( NumItem<0 ) THEN
write ( * ,* ) "Quantity cannot be a negative value. Please reenter item quantity you would like to purchase."
ELSE IF ( NumItem>1000 ) THEN
write ( * ,* ) "Item quantity requested is not available. Please enter a smaller number of items to purchase."
ELSE
IF ( NumItem>= 0 .and . NumItem<= 1000 ) EXIT
END IF
END DO
END SUBROUTINE
END PROGRAM
cHJvZ3JhbSBSZWNlaXB0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAohLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KISBDaHJpc3RpbmEgVXJiYW5jenlrICAgICAgICAgICAgICAgICAgICAgIExhYiA1IEFzc2lnbm1lbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGZWJydWFyeSAyNCwgMjAxMQohIFRoaXMgcHJvZ3JhbSBkZXRlcm1pbmVzIHRoZSB0b3RhbCBjb3N0IG9mIHB1cmNoYXNlcyBtYWRlIGF0IGEgZGVwYXJ0bWVudCBzdG9yZSBpbiB0aGUgQXJjYXRhIFBsYXphLiAgICAgICAgCiEgICAgVmFyaWFibGVzIHVzZWQgYXJlOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKISAgICBTaGlydFF1YW50aXR5Ok51bWJlciBvZiBzaGlydHMgZm9yIHB1cmNoYXNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKISAgICBTaGlydFRvdGFsOiBDb3N0IG9mIGFsbCBzaGlydHMgZm9yIHB1cmNoYXNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKISAgICBTdWJ0b3RhbDpDb3N0IG9mIGFsbCBwdXJjaGFzZXMgYmVmb3JlIHNhbGVzIHRheCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKISAgICBTYWxlc1RheDpUYXggZnJvbSB0b3RhbCBwdXJjaGFzZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKISAgICBUb3RhbENvc3Q6IFRvdGFsIGNvc3Qgb2YgcHVyY2hhc2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKISAgICBQYW50c1F1YW50aXR5OiBOdW1iZXIgb2YgcGFudHMgZm9yIHB1cmNoYXNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKISAgICBQYW50c1RvdGFsOiBDb3N0IG9mIGFsbCBwYW50cyBmb3IgcHVyY2hhc2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKISAgICBTaG9lc1F1YW50aXR5OiBOdW1iZXIgb2Ygc2hvZXMgZm9yIHB1cmNoYXNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKISAgICBTaG9lc1RvdGFsOiBDb3N0IG9mIGFsbCBzaG9lcyBmb3IgcHVyY2hhc2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKISAgICBTdWl0UXVhbnRpdHk6IE51bWJlciBvZiBzdWl0cyBmb3IgcHVyY2hhc2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKISAgICBTdWl0VG90YWw6IENvc3Qgb2YgYWxsIHN1aXRzIGZvciBwdXJjaGFzZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKISAgICBJT2Vycm9yOiBJbnB1dC9PdXRwdXQgZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKISAgICBHZXRPcmRlcjogU3VicHJvZ3JhbSB0byByZXF1ZXN0IGl0ZW1zIGZvciBwdXJjaGFzZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKISAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKISBJbnB1dDogU2hpcnRRdWFudGl0eSwgUGFudHNRdWFudGl0eSwgU2hvZXNRdWFudGl0eSwgU3VpdHNRdWFudGl0eSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKISBPdXRwdXQ6IFNoaXJ0VG90YWwsUGFudHNUb3RhbCwgU2hvZXNUb3RhbCwgU3VpdFRvdGFsLCBTdWJ0b3RhbCwgU2FsZXNUYXgsIFRvdGFsQ29zdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKIS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKCklNUExJQ0lUIE5PTkUKaW50ZWdlciwgcGFyYW1ldGVyOjogZHA9c2VsZWN0ZWRfcmVhbF9raW5kICgxNSkgITE1IFNpZ25pZmljYW50IEZpZ3VyZXMKaW50ZWdlcjo6IFNoaXJ0UXVhbnRpdHksIFBhbnRzUXVhbnRpdHksU2hvZXNRdWFudGl0eSwgU3VpdFF1YW50aXR5LCBpb2Vycm9yCnJlYWwoZHApOjogU2hpcnRUb3RhbCwgUGFudHNUb3RhbCwgU2hvZXNUb3RhbCwgU3VpdFRvdGFsLCBTdWJ0b3RhbCwgU2FsZXNUYXgsIFRvdGFsQ29zdCAgCnJlYWwoZHApLHBhcmFtZXRlcjo6IFNob2VzQ29zdD0zNS44NSxTdWl0Q29zdD0xMjUuMTUsVGF4UmF0ZT0u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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfCIKd3JpdGUgKCosKikgInwgICAgICAgICAgICBDaHJpc3RpbmEncyBTdG9yZSAgICAgICAgICAgICAgIHwiCndyaXRlICgqLCopICJ8ICAgICAgICAgICAgICAgIFRoZSBQbGF6YSAgICAgICAgICAgICAgICAgICB8Igp3cml0ZSAoKiwqKSAifCAgICAgICAgICAgICBBcmNhdGEsIENBIDk1NTIxICAgICAgICAgICAgICAgfCIKd3JpdGUgKCosKikgInwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwiCndyaXRlICgqLCopICJ8LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS18Igp3cml0ZSAoKiwqKSAifCBJVEVNICAgICAgICAgICAgIE5VTUJFUiAgICAgICAgICAgICAgQ09TVCAgfCIKd3JpdGUgKCosKikgInwtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLXwiCiAgRU5EIElGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICBJRiAoU3VidG90YWw8PTApIFRIRU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCndyaXRlICgqLCopICJUaGFua3MgZm9yIGNvbWluZyB0byBDaHJpc3RpbmEncyBTdG9yZS4gSGF2ZSBhIGdvb2QgZGF5LiIKICBFTkQgSUYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAoKICBJRiAoU2hpcnRUb3RhbD4wKSBUSEVOCndyaXRlICgqLCcoVDIsQTcsVDIyLEkyLFQzOSxGNi4yLFQ0NyxBMSknKSAifCBTaGlydCIgICxTaGlydFF1YW50aX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