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

I need a script for PERL and BASH for each of these questions!!! 1. Write a scri

ID: 3543109 • Letter: I

Question

I need a script for PERL and BASH for each of these questions!!!


1. Write a script to help users calculate compressed file size. Prompt the user to enter the original size of a file (in

bytes) from the keyboard. Then use the following rules for calculating the compressed file size. Display the result on

the screen.

? If the size is less than 5000 bytes, the compression ratio is 90%;

? If the size is between 5000 and 50000 bytes, the compression ratio is 70%;

? If the size is more than 50000 bytes, the compression ratio is 40%.



2. Develop a small console program driven by a text menu (see the sample screenshot below):

? It displays a simple menu with 4 items indicated by number 1-4.

? Users will enter number 1 to 4 to run some commands.

? Item #1 to #3 will run some shell commands (it

Explanation / Answer

HI Zach Stone i definitly help you i am giving the code once you try on your system you definitly get the answer #!/usr/local/bin/perl use Image::Magick; my($image, $x); $image = Image::Magick->new; $x = $image->Read('girl.png', 'logo.png', 'rose.png'); warn "$x" if "$x"; $x = $image->Crop(geometry=>'100x100+100+100'); warn "$x" if "$x"; $x = $image->Write('x.png'); warn "$x" if "$x";here i am giving the next example: iam giving the script this script reads the 3 images and give you a single image in that timethis code will helpyou...............#!/usr/local/bin/perl use Image::Magick; my($image, $p, $q); $image = new Image::Magick; $image->Read('x1.png'); $image->Read('j*.jpg'); $image->Read('k.miff[1, 5, 3]'); $image->Contrast(); for ($x = 0; $image->[$x]; $x++) { $image->[$x]->Frame('100x200') if $image->[$x]->Get('magick') eq 'GIF'; undef $image->[$x] if $image->[$x]->Get('columns') < 100; } $p = $image->[1]; $p->Draw(stroke=>'red', primitive=>'rectangle', points=>20,20 100,100'); $q = $p->Montage(); undef $image; $q->Write('x.miff'); YOU asking abt compress the size i have done my system alredyi am giving this example i think this will help you better$image = Image::Magick->new; $image->Set(size=>'100x100'); $image->ReadImage('canvas:white'); $image->Set('pixel[49,49]'=>'red');i think this will help youthanks & regadsBhagyaraj
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