[SOLVED] CS 3424 Quiz 4

30.00 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

5/5 - (1 vote)

(1) create a sed script which makes all comments consistent. Comment lines begin with either “//” or “#” and can have any number of whitespaces before and after the “//” or “#”. Replace these comment lines with only “//” followed by a single space and the rest of the original comment. Finally, remove any lines that begin with a “%”. Include the command to run the script for a file named file1.php (contents below) and print output to file1Clean.php.
Before Comment Fixes:
// file1.php // Week 4 // Quiz //comment3 // comment4 / /comment5 / /comment6 %comment7 % comment8 %comment9
#comment10 # comment11 #comment12
<?php # print something echo “hello world”; # close php tag ?> % this isn’t a correct comment
After Comment Fixes:
// file1.php // Week 4 // Quiz // comment3 // comment4 / /comment5 / /comment6
%comment9
// comment10 // comment11 // comment12
<?php // print something echo “hello world”; // close php tag ?>

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.