Question: Using PowerShell ISE or VSCode, create a PowerShell script that will do the following: Ask for the users name Ask the user for a 2-digit

Using PowerShell ISE or VSCode, create a PowerShell script that will do the following:

  1. Ask for the users name
  2. Ask the user for a 2-digit number
    1. Validate this number is two numeric digits
    2. Take into account leading zeroes
    3. If the number is invalid, have the user try again
  3. Ask the user for a 3-digit number
    1. Validate this number is three numeric digits
    2. Take into account leading zeroes
    3. If the number is invalid, have the user try again
  4. Perform the following mathematical calculations on the numbers
    1. Multiply the two numbers
    2. Add the two numbers
    3. Subtract the two numbers (negative results are acceptable)
    4. Divide the two numbers
      1. Check for divide by zero
      2. Let the user know if this wont work
    5. Output the following information to the screen
      1. Name: users name
      2. First number: first number
      3. Second number: second number
      4. First number x second number: result
      5. First number + second number: result
      6. First number - second number: result
      7. First number / second number: result or error message if it cannot be done

Upload the script. Paste screenshot of the results here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!