1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Andru [333]
3 years ago
4

A data file "parttolerance.dat" stores on one line, a part number, and the minimum and maximum values for the valid range that t

he part could weigh. Write a script "parttol" that will read these values from the file, prompt the user for a weight, and print whether or not that weight is within range. For example, IF the file stores the following:>> type parttolerance.dat123 44.205 44.287Here might be examples of executing the script:>> parttolEnter the part weight: 44.33The part 123 is not in range>> parttolEnter the part weight: 44.25The part 123 is within range
Computers and Technology
1 answer:
makvit [3.9K]3 years ago
7 0

Answer:

First, create the parttolerance.dat file with the line in the question. This can easily be done by using the echo command from the command line:

echo 123 44.205 44.287 >> parttolerance.dat

Then write a simple script file that prompts the user for the weight and then compares that input to the values within the file created above. If the value of the weight is within the range, then print the value is within range. Otherwise print it is not within range.

Explanation:

// create the parttolerance.dat file

echo 123 44.205 44.287 >> parttolerance.dat

Shell script

 #!/bin/bash echo

 "Enter the part weight: "

 read input_weight

  IFS=' ' while IFS=' '

 read -r col1 col2 col3  do    

   part_number="$col1"    

   file_weight_lower="$col2"    

   file_weight_upper="$col3"

 done <parttolerance.dat

  if (( $(bc <<< "$input_weight >= $file_weight_lower && $input_weight <= $file_weight_upper") > 0 )); then  

   echo "The part $part_number is within range"

 else  

   echo "The part $part_number is not in range"

 fi

run script:

./parttol.sh

You might be interested in
Which of the following are slide layouts in
hjlf

Answer:

title slide

title and content

blank

picture with caption

Explanation:

Slide layouts contain boxes known as placeholders that bear the contents of a slide. They allow users to format, and position content. Colors and fonts are also available. Text, titles, pictures, video, audio, graphics, etc., can be attached to the placeholders. Layouts are adjustable according to the preferences of the user.

There are also features that the sharing of these layouts with other users. To select a layout to be used, the user goes to Home and chose Layout which then supplies the different options.

5 0
3 years ago
You can open the format cells dialog box by pressing the ____ keys
Vsevolod [243]
Ctrl+shift+q+q is the answer 
6 0
3 years ago
Object Linking and Embedding (OLE) data integration allows you to
worty [1.4K]
Hey mate thanks for letting me help you

l just look into this and l got this A set of APIs to create and display a (compound) document, but that is not a choice. so <span>D. edit data in a plain text editor
</span><span>
hope l helped   
</span>
4 0
3 years ago
What is one advantage and disadvantage of designing a support security that might be based on a centralized model, where all sen
defon

Co-Ordination Difficulty: ...
Waste of Resources: ...
Larger Interests of the Enterprise Neglected: ...
Emergency Decision not Possible: ...
Lack of Qualified Managers: ...
Certain Activities Decentralization not Possible:
8 0
3 years ago
Does anyone watch JackSepticEye or Markiplier?
Doss [256]

Answer:

hell yeah we do

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • In a random digit telephone survey, homeless people or people with only cell phones do not have telephones that can be called wi
    13·1 answer
  • Does this Java Program look correct? First, let me paste the question:Five friends are going to the theater. They have purchased
    10·1 answer
  • A function prototype can always be omitted when: A function is defined before it is first invoked. A function does not return a
    9·1 answer
  • Give fields descriptive so that you can easily identify them when you view or edit records.
    13·1 answer
  • Our bank needs a tool that will help us in determining credit worthiness of loan applicants. We will enter the following informa
    5·1 answer
  • What are the economic, social, political and cultural effects of the West Indian Day Parade
    12·1 answer
  • n a particular board game, there is exactly one row and it comprises N spaces, numbered 0 through N - 1 from left to right. Ther
    12·1 answer
  • Felicity wants to capture the attention of the regular subway commuters in her area though her print advertisements​
    13·1 answer
  • You want your computer to boot off of the network and have the ability to be brought out of sleep mode over the network. Which t
    5·1 answer
  • Where should broadheads be kept while traveling to and from the field? in a plastic bag to protect from moisture in a carrier at
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!