Homework 9
Description
Having Trouble Meeting Your Deadline?
Get your assignment on Homework 9 completed on time. avoid delay and – ORDER NOW
INTRODUCTION:
Oil exploration is being conducted by drilling holes and blasting the ground with specific amounts of dynamite to generate seismic readings that can be interpreted. To obtain useful seismic readings, a specific ratio between the amount of dynamite and the depth of the hole is needed. The ideal powder charge to depth-of-hole ratio is 1:3. For blasting operations, each stick of dynamite will be 2 feet long and will weigh 6 pounds. Ideally, we would use the exact amount of powder specified; however, in reality, useful readings aren’t generated when part of a stick of dynamite protrudes above the hole. Therefore, we will compute the actual powder charge in 6-pound increments and use fewer sticks than necessary, if needed.
A sample hand calculation follows below:
Hole depth = 85 feet
Ideal powder-to-hole depth ratio = 85/3 = 28.333333 feet
Ideal number of sticks = 28.333333/2 = 14.166667
Ideal powder charge = 14.166667*6 = 85 pounds
Actual number of sticks = floor(14.166667) = 14
Actual charge = 14*6 = 84 pounds
An input data file called explore.txt contains exploration information for each well site. The first record line of the input file is the control number, which defines the number of sites to be read into the program. Each succeeding record line has two columns, where the first column is the well site number and the second column is the hole depth of the well in feet. The input file is comma delimited.
ASSIGNMENT:
Write a Python script to read the information for each hole from the explore.txt data file. Using the hole depth, compute the ideal powder-to-hole depth ratio, the ideal number of sticks, the ideal powder charge, the actual powder charge, and the actual number of sticks. Use lambda functions to do the calculations. Most of your code will be in the main function; you will have an external function to verify the input file. Your program will produce a table as the report. Print the table to the computer screen and to an output file called blasting.txt.
Once the program is working, modify the program to print the data in descending order based on ideal powder charge. Hint: I suggest using a bubble sort, as this is the simplest algorithm to program. Set up this sort in an external function
Once this is working, modify the program again to account for any hole depth that is less than 30 feet. Instead of printing the normal column items, for any hole that is less than 30 feet in depth, print the well site number, the well depth, and then print a message that the hole is too shallow.
Use the “Code Setup.py” template on Blackboard to write your code.
Your program output will look like the illustration shown below. Use your PC’s cursor to determine the horizontal and vertical spacing for the output format.
OUTPUT FORMAT:
*******************************************************
DAILY DRILLING REPORT
Site ID Depth Ideal Powder Actual Powder Sticks
(ft) Charge (lbs) Charge (lbs)
xxxxx xxx xx.xx xxx xxx
. . . . .
. . . . .
. . . . .
. . ** Hole too shallow for blasting. **
*******************************************************
SUBMITTING ASSIGNMENTS:
Once you have your program working, exit the Python IDE that you are using. Make sure that your source program file name conforms to the following specifications:
sn_pn_first_last
where: sn is your section number (01, 02, 03 …)
pn is the program number (9)
first is your first name
last is your last name
An example for the eighth coding assignment would be 1_8_elmer_fudd.py.
Submission:
Submit both your handwritten problem-solving process and your Python source code using the Assignments button in Blackboard. Remember to submit your Python source program in Python 3 only, using code as demonstrated in class. No other format will be accepted.
If you make changes to your program and need to resubmit, rename the file such as 1_8_elmer_fudd_2.py or 1_8_elmer_fudd_3.py, etc. Then use the Assignments button in Blackboard to submit the new version. Only the most current submitted program version will be graded.
FILE PATHS:
Files on the grader’s computer and Dr. B.’s computer will be located at:
C:Engr 200explore.txt and C:Engr 200blasting.txt
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Order Now and we will direct you to our Order Page at Litessays. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.