A1 script win213

7 July 2016

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 Waste
Your 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

How to cite this essay

Choose cite format:
A1 script win213. (2016, Jul 29). Retrieved June 25, 2019, from https://newyorkessays.com/essay-a1-script-win213/
A limited
time offer!
Get authentic custom
ESSAY SAMPLEwritten strictly according
to your requirements