$ perl ./gg.perl Orders of the day: ORDER: Grocer1 pick up apples ORDER: Market1 buy bread ORDER: Warehousel sell asparagus ORDER: Market1 buy lettuce ORDER: Market1 buy lettuce ORDER: Warehouse1 deliver rice ORDER: Market2 buy oranges ORDER: Market2 pick up asparagus ORDER: Grocer1 deliver oranges ORDER: Market2 buy oranges ORDER: Grocer1 deliver lettuce ORDER: Warehouse2 pick up oranges ORDER: Grocer1 pick up oranges ORDER: Grocer2 deliver rice ORDER: Market1 sell celery ORDER: Warehouse2 deliver lettuce ORDER: Market2 sell oranges ORDER: Warehousel sell asparagus ORDER: Market2 buy oranges ORDER: Market2 pick up lettuce ORDER: Market1 buy apples ORDER: Warehouse1 pick up apples ORDER: Warehouse2 sell asparagus ORDER: Market1 pick up apples ORDER: Grocer1 pick up asparagus ORDER: Market1 pick up rice ORDER: Warehouse2 sell apples ORDER: Grocer1 deliver oranges ORDER: Grocer2 buy bread ORDER: Grocer2 pick up apples ORDER: Market1 buy bread ORDER: Market2 buy rice ORDER: Warehouse2 sell apples ORDER: Warehouse1 buy rice ORDER: Warehouse2 buy celery ORDER: Warehouse2 buy lettuce EPSILON
Added by Kimberly C.
Close
Step 1
Read the input file: gg.perl Show more…
Show all steps
Your feedback will help us improve your experience
Michael Feffer and 92 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Check Your Understanding Practice and Problem Solving: Solve each problem using a percent equation. 364 | Lesson 7-5 | Using Percent Equations
Sherrie F.
Practical Test Solve each problem below. You may use a piece of scratch paper to work your problems. You in your scratch work sheet. Write only the answer in the space provided for each question. 86. Robert bought a used car for $1,500.00. If the sales tax is 5%, what will be the total that for the car? 87. Solve 2/3 + 4/6 88. What is the perimeter of a triangle which sides measure 6, 8, and 10 inches? 89. What would be the radius of a circle with a diameter of 8 inches? 90. Solve 2X + 3 = 9. X = 91. What is the area of a rectangle with a width of 12 feet and a length of 10 feet? 92. Using the fraction 4/6, which number is the denominator? 93. What percent of one US dollar is $.25? 94. Tom, Bill, Susan and Sandy went bowling. Toms' score was 132, Bills' score was 140 and Sandys' score was 128. What was the average score of all four bowlers? 95. A dress that sells for $50.00 now has a 10% discount marked on the tag. How much is the regular price of the dress? 96. Sam bought a pair of socks for $2.95 and a tie for $7.50. He gave the cashier a twenty dollar bill. How much change should Sam receive from the cashier? 97. A cube measures 3 inches on all of its sides. What is the volume of the cube in inches? 98. Canned corn is on sale at the grocery store, Three cans for a dollar. Another brand is which is the better buy? 99. Your paycheck each week is $500.00. If you want to save $2000.00 in one year, how much do you need to save aside from your paycheck each week? 100. Write the number for six million, four hundred thousand, nine hundred twenty-seven.
Sri K.
Write a Perl program to accomplish each of the following on the file solar.txt: 1. Print all records that do not list a discoverer in the eighth field. 2. Print every record omitting the second field. 3. Print the records for satellites that have negative orbital periods. (A negative orbital period simply means that the satellite orbits in a counterclockwise direction.) 4. Print the data for the objects discovered by the Voyager2 space probe. 5. Print each record with the orbital period given in seconds rather than days. About solar.txt file: This file contains lines of 9 items, the first being: Adrastea XV Jupiter 129000 0.30 0.00 0.00 Jewitt 1979 in alphabetical order by the name of the planet or moon (first field). The fields in this file are: 1. Name of planet or moon [Adrastea] 2. Number of moon or planet (roman numerals) [XV] 3. Name of the object around which the satellite orbits [Jupiter] 4. Orbital radius (semimajor axis) in kilometers [129000] 5. Orbital period in days [0.30] 6. Orbital inclination in degrees [0.00] 7. Orbital eccentricity [0.00] 8. Discoverer [Jewitt] 9. Year of discovery [1979] Separate, count, and sort the words in the example text file, electricity.txt. Sort in the following orders, and your output should be nicely lined up in columns to the output file: 1. Alphabetically (ignoring capitalization) 2. Alphabetically with uppercase words just in front of lowercase words with the same initial characters 3. By frequency, from high to low (any order for equal frequency) 4. By frequency, with alphabetical order for words with the same frequency Write a Perl program that replaces all digits with the name of the digit, so every "0" is replaced with "zero", "1" is replaced with "one", ... "9" is replaced with "nine". Test your program with your own input file containing digits and letters. Your program should write the result to an output file, and you need to print both the input and output files along with your source code.
Akash M.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD