Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello, can anyone help me on this question and answer it all for me? I\'m quite

ID: 3788426 • Letter: H

Question

Hello, can anyone help me on this question and answer it all for me? I'm quite struggling and don't know what to do here your help will be a life saver and i appreciate it. thank you!

Assignment 4 questions and inputs:

write egrep commands to match all lines that contain the letter a and b(either upper or lower case) and all lines that conatin the word a(either upper or lower case) followed by a word starting with a vowel and test it on the given input.

Assignment 4 input test:

a apple
A elephant
a banana
zero
yellow yaks
zippy zebras

Assignment 5 questions and input:

edit the regex [0-9]?[0-9]:[0-9][0-9](am|pm) so it doesn't match illegal time like 99:99pm

Assignment 5 test input: use the egrep command to teest it on the inputs

10:31am
9:30pm
9:30
9:3am
99:99pm

Assignment 6:

print "Enter a temperature (i.e. 32F, 100C): ";
$input = ; # this will read one line from the user
chop($input);   # this removes the ending newline from $input

if ($input =~ m/^([-+]?[0.-9]+)([Cc|fF])$/)
{
   # If we get in here, we had a match.
   # $1 is the number and $2 is "C" or "F"
   $InputNum = $1;   # save to named variables to make easier to read
   $type = $2;
   $space = " ";
   if ($type eq "C") {
       $celsius = $InputNum;
       $fahrenheit = ($celsius * 9 / 5) + 32;
   }
   else {
       $fahrenheit = $InputNum;
       $celsius = ($fahrenheit - 32) * 5 / 9;
   }
   printf "%.2f C = %.2f F ", $celsius, $fahrenheit;
}
else {
   print "Expecting a number, so don't understand "$input". ";
}

Assignment 2 Write a regular expression for each of the following languages and test it for correctness in LAP. 1. The language with an even number of a s followed by an odd number of b's 2. The language with zero or more a's followed three or fewer b's by 3. The language in which every a must have b adjace to it on both sides.

Explanation / Answer

Assignment 2:

b)

^a*(bbb)*

c)

(bab)*

Assignment 4:

a)All lines that contain letter a and b (either Upper or lower)

egrep "*[abAB]*" filename

note: here filename can be any path or name of a file

as given in question 4 filename will be jillz/cs250/lab3/testfile1

b)All lines that contains the word a and followed by word starting with vowel

egrep "^[aA] [aeiou]*" filename

Assignment 5:

edit the regex [0-9]?[0-9]:[0-9][0-9](am|pm) so it doesn't match illegal time like 99:99pm

egrep "[0-1]?[0-2]:[0-5][0-9](am|pm)"jillz/cs250/lab3/testfile1

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote