Write a perl script to help users calculate compressed file

Assignment Help Computer Engineering
Reference no: EM132207490

Write a PERL 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 Perl 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's your choice what to run, but do not use the same commands as in the example). When the command is finished, display the menu again. If 4 is entered, then quit the program.

Sample Screenshot

Welcome to Menu:

1.) ls

2.) ls -i

3.) ls -a

4.) Exit

Please enter a choice 1-4: 1

case.sh file-test.sh menu.sh script-args.sh timer.sh

compund.sh for.sh math.sh pattern.sh simple-script.sh while.sh

Welcome to Menu:

1.) ls

2.) ls -i

3.) ls -a

4.) Exit

Please enter a choice 1-4: 4

Exit ...

root@ubuntu0:~/Documents/script#

Reference no: EM132207490

Questions Cloud

Incorporated into the final divorce degree : When Roger and Susan divorced, they entered into a property settlement agreement that was incorporated into the final divorce degree.
Elements of keurig external and internal environments : How does Keurig’s strategy stand up against competitive rivalry in the industry? Review the important elements of Keurig’s external and internal environments.
How did each painting reflect or inspire social change : How did each painting reflect or inspire social change or revolution? What was the social or revolutionary context of the painting?
Write a program that allows you to input up to 20 names : Write a program that allows you to input up to 20 names of maximum length 40 and sorts these names into alphabetic order and outputs them.
Write a perl script to help users calculate compressed file : Write a PERL script to help users calculate compressed file size. Display the result on the screen.
Define how mcdonald can improve : Your presentation should look professional. Do not copy and paste tables of data from the Internet, but recreate the data within the Powerpoint slide.
Write a main program to test your class : Methods to print last name, first name, and ID Number. Write a main program to test your class.
Failure to cooperate with workplace violence program : The woman was eventually terminated for her failure to cooperate with the workplace violence program. She sued. What should the court decide?
Convert a 4-byte packed decimal number to a string : Write a procedure named PackedToAsc that converts a 4-byte packed decimal number to a string of ASCII decimal digits.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd