Write a script to help users calculate compressed file size

Assignment Help Basic Computer Science
Reference no: EM13309837

InstructionFor each question, please write a Bash script and a Perl script:

1. Write a script to help users calculate compressed file size. Prompt the user to enter the original size of a file (inbytes) 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's your choice what to run, but do not use the samecommands as in the example). When the command is finished, display the menu again.? If 4 is entered, then quit the program.

 

Reference no: EM13309837

Questions Cloud

Calculate flow velocities at each section of the pipe : A pipe carrying oil of specific gravity (SG = 0.877) changes in size from 150 mm at section E to 450 mm at section R (E and R are arbitrary designations of the two points in the system).
Calculate the return on assets ratios for the company : Large traded companies like Target, Ford, Apple, etc. are easy to find this type of information on. We recommend you go straight to Hoover's Pro database to find a company profile. This database is the best database available for this type of info..
Calculate the ph when acetic acid is a weak acid : acetic acid is a weak acid. Its Ka is 1.8(10^-5). For a concentration of 0.015 M, calculate the pH.
Find how far apart would the plates have to be : Some sharks respond to very weak electric fields, as weak as 1.0 µV/m. To grasp how weak this field is, how far apart would the plates have to be
Write a script to help users calculate compressed file size : Write a script to help users calculate compressed file size. Prompt the user to enter the original size of a file (inbytes) from the keyboard.
Identify primary characteristics of product : Discuss the type of product the company will offer and identify its primary characteristics.
Elements that might be presented in a balanced scorecard : Define the elements that might be presented in a balanced scorecard and explain how it is used - Make a recommendation of whether or not EEC should adopt the balanced scorecard
Determine reverse-saturation current of the pn junction : Find the voltage v0 and current i0 of the diode circuit shown in the figure below. You may assume a diode cut-in voltage of vy = 0.7V - difference in forward-bias voltages between the two diodes is 0.3V. Determine the reverse-saturation current of t..
Determine the hydraulic conductivity of the sand in field : In the field, if the relative compaction is 90%, determine the hydraulic conductivity of the sand in the field compaction condition (given that k for the sand at the maximum dry density condition is .040 cm/sec and Gs = 2.65).

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Determining privacy policy for organization

Many countries need organizations which gather personal information to publish privacy policy. Determine a copy of the privacy policy for an organization.

  Translate the following function into mips assembly language

Translate the following function into MIPS assembly language

  What purposes do cpus, memory and i-o devices

What purposes do CPUs, memory and I-O devices individually serve in a computer system

  Analyze faster processor chip result increase in performance

Analyze the following statement: "Using the faster processor chip results in corresponding increase in performance of a computer even if main memory speed remains same."

  Write one java statement to display the string

Write one Java statement to display the string "The average is xxx" to the console, where the xxx displays the value from the double variable sum divided by 3. Make sure the value is displayed with 3 digits following the decimal point.

  Program should display a menu

The program should display a menu allowing the user to enter pointer values by selecting option 1, then perform shallow or deep copy by selecting options 2 or 3. After whcich, your program needs to display the new results after the copy is performed.

  Problem of determining whether a dfa

Consider the problem of determining whether a DFA and a regular expression are equivalent. Express this problem as a language and show that it is decidable.

  Kind of information monitor check to see if it sanitize

Which kind of information should the monitor check to see if it must sanitize the data to conceal the names of the users and the names and addresses of the computers involved?

  Write a program that creates two vectors from x-one

write a program that creates two vectors from x-one (call it P) that contains the positive elements of x, and a second (call it N) that contains the negative elements of x. In both P and N, the elements are in the same order as in x.

  How much cpu time each user process has had recently

Modify the MINIX 3 scheduler to keep track of how much CPU time each user process has had recently. When no task or server wants to run, pick the user process that has had the smallest share of the CPU.

  Find the sum of the squares of the integers

Find the sum of the squares of the integers from 1 to My Square, where My Square is input by the user.be sure to check that the user enters a positive integer.

  Privilege to e-mail addresses in discount warehouse database

Checkout clerk with ____ privileges to e-mail addresses in discount warehouse database could view addresses but not change them.

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