Monday, May 4, 2020

A1 script win213 free essay sample

You work for a medium size wholesale book publisher as the system administrator. This year management has decided, at the last minute, to sell books at its annual book conference. The company as a rule does not sell its books retail, consequently management does not want to purchase an off the shelve retail sales program. Rather, you have been assigned the task of writing a PowerShell text-based program calledLearnName_SalesProgram. ps1 which will do the following. Allow the sales clerk to the following at the console: 1. Enter the book title –data type string. If the user enters a null string, the program should beep and redisplay the needed value 2. Enter a one sentence description of the book — data type string 3. Enter the book’s ID number. Code numbers are alpha-numeric (e. g. ROM482,SCI233,BUS400). If the user enters a numeric value, the program should prompt for alphanumeric 4. Enter the list price of the book with a dollar sign and decimal format –data type decimal 5. We will write a custom essay sample on A1 script win213 or any similar topic specifically for you Do Not WasteYour Time HIRE WRITER Only 13.90 / page If the user does not enter a numeric value the program should prompt for a numeric value 6. Calculate the harmonized tax rate (HST) of 12% (list price X . 12 = tax payable) – data type constant. Display the tax payable and total purchase price for the book to the customer. (tax + list price = purchase price)- data type decimal 7. Output the above information to a file called BookSalesConference2014. txt in the following 8. Optional: include a running total called â€Å"Total Book Sales:† which is saved to the file 9. The file format should look like the following: ______________________________________ Title of Book: Description: Code Number: List Price: Tax Payable: Purchase Price: _______________________________________ Total Book Sales: (optional) Set-Variable TaxRate -Option Constant -value . 12 if ( (Test-Path . \BookSalesConference2014. txt) -ne â€Å"True† ){ New-Item -Type File . \BookSalesConference2014. txt } Clear-Host [string]$Title = Read-Host â€Å"Book Title† while ( $Title -eq â€Å"† ) { [console]::beep(1000,500) $Title = Read-Host â€Å"Please Enter Book Title Again† } [string]$Description = Read-Host â€Å"Book Description† [string]$CodeNmeber = Read-Host â€Å"Code Number† while ( $CodeNmeber -match â€Å"^\d+$† ) { $CodeNmeber = Read-Host â€Å"The Code Nmubers Are Alpha-numeric. Please Enter Again† } [string]$InputPrice = Read-Host â€Å"List Price â€Å" while ( $InputPrice -notmatch â€Å"^\$[0-9]+(\. [0-9]{0,2})? $† ) { $InputPrice = Read-Host â€Å"The Prices Are Dollar Sign Plus Numeric. Please Enter Again† } [Decimal]$ListPrice=$InputPrice. Remove(0,1) [Decimal]$Tax=$ListPrice * $TaxRate [Decimal]$PurchasePrice=$ListPrice+$Tax Write-Host â€Å"Tax Payable: $† $Tax Write-Host â€Å"Purchase Price: $† $PurchasePrice Write-Output â€Å"________________________________________________________________† . \BookSalesConference2014. txt

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.