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

  Suppose a c++ compiler for the mips

Suppose a C++ compiler for the MIPS machine associates $s5 with array a and $s6 with variable i. How does it translate a[i] = a[i+1]; into MIPS assembly language?

  Calculate the difference between two numbers

Create a template function that can be used to calculate the difference between two numbers. Make it able to use two integers, two floats, and an integer and a float.

  Consider the following code fragment

Consider the following code fragment: for (int i = 0; i = 0; j--) { System.out.println(i + " " + j); } } How would i revise this fragment to output this: 0 0 1 1 1 0 2 2 2 1 2 0 3 3 3 2 3 1 3 0

  Why information security is not factor for organization

But would not require to give for information security on those systems. Explain that environment and desribe why information security is not factor for that organization.

  Write function xsort takes list strings returns sorted list

Write the function Xsort wich takes in a list of strings and returns sorted list with all words beginning wih "X" first in the list. f.ex: xsort (['kex', 'xylofonn', 'epli', 'xenos', 'asni']) returns ['xenos', 'xylofonn', 'asni', 'epli', 'kex']

  Asks a user to enter the radius of a circle

Write a program that asks a user to enter the radius of a circle, and calcualtes the area and the circumference. The program should be written using the following methods.

  Derive taylor polynomials of degree

Derive taylor's polynomials of degree n for: f(x) = (1+x)^(1/2) and f(x) = cos x. Find the approximate value of above functions at x = pi/4 by hand calculator upto two decimal points. Show steps.

  Develop a program that determines the monthly charges

Develop a program that determines the monthly charges for a checking account. the following criteria is to be used.

  Generate dropdown to create example c++ code

Submit your C++ source code that you generated from RAPTOR with comments added to each line or where necessary to explain program flow. Also submit the RAPTOR file (flowchart) of your working program.

  Steps to follow to get evidence in investigating files

Drive that you are investigating comprises several password-protected files and other files with headers which do not match extension. What procedures would you require to follow to retrieve evidence?

  What does it mean to take a systems view of a project

As an IT project manager, you may take a systems view of a project.

  Write a method switchpairs that switches the order

Write a method switchPairs that switches the order of elements in a linked list of integers in a pairwise fashion. Your method should switch the order of the first two values, then switch the order of the next two, switch the order of the next two..

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