Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PowerShell # Leave all comments and instructions. # Put your PowerShell code below the problem description # in an uncommented line. # Run the following

PowerShell

# Leave all comments and instructions.

# Put your PowerShell code below the problem description

# in an uncommented line.

# Run the following code to set variables

$a = 5

$b = "Hello World"

$c = @("Alice", "Bob", "Charlie")

# Sample: Write a comparision to determine if 5 equals 6

# (The solution goes on the following line)

5 -eq 6

# For the following problems, use Write-Host to output text

# For example:

Write-Host "Hello World"

#a) Write an IF statement.

# If $a is greater than 5,

# write "Big" otherwise write "Small".

#b) Write the following logic in an IF/ELSE statement.

# Print "BIG WORLD" if $b is longer than 5 characters and has the word "World" in it.

# Print "BIG NO WORLD" if $b is longer than 5 characters and does not have the word "World" in it.

# Print "SMALL WORLD" if $b is not longer than 5 characters but has the word "World" in it.

# Print "SMALL NO WORLD" if $b is not longer than 5 characters and does not have the word "World" in it.

#c) Write an IF/ELSE statement for the following logic.

# If $b's length is 0, print "empty".

# If $b's length is between 0 and 11, print "short".

# Otherwise, print "long".

#d) Create another IF/ELSE statement that evaluates the data in the $c variable in some way. Be creative.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions