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 1.5 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 = 23.333333 feet
Ideal number of sticks = 28.333333/1.5 = 18.888888
Ideal powder charge = 18.888888*6 = 113.333333 pounds
Actual number of sticks = floor(18.888888) = 18
Actual charge = 18*6 = 108 pounds
An input data file called explore 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 C program that will read the required values from the input file into two one-dimensional arrays: one array for the well site number and one array for the hole depth. Using the hole depth array, 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. Your program will produce a table as the report. Print the table to the computer screen and to an output file called blasting.
Once the program is working, modify the program 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 Sections.c” 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. **
*******************************************************
explore.txt
10
1715,87
5858,106
907,30
3647,59
1834,62
719,243
5280,25
150,134
53247,460
22,28
template
#include <stdio.h>
#include <math.h>
/* Main function */
int main(void)
{
/* Declare variables */
/* Print headings */
printf("********************************************");
printf("\n");
/* Input values */
/* Compute */
/* Print output values */
printf("\nRESULTS");
printf("\n********************************************\n\n\n");
/* Exit the program */
return 0;
}
/******************************************************************************/
Here is the answer for your question in C Programming Language.
Kindly upvote if you find the answer helpful.
CODE :
|
#include <stdio.h> /* Main function */ |
explore.txt
| 10 1715,87 5858,106 907,30 3647,59 1834,62 719,243 5280,25 150,134 53247,460 22,28 |
SCREENSHOTS :
Please see the screenshots of the code below for the indentations of the code.

![fscanf(inFile, %d,%d,&wellSiteNumbers[i],&holedepths[i]); i++; ܝܟ /* Compute and output/ 33 34 35 36 37 38 39 40 41 42 43 4](http://img.homeworklib.com/questions/5a031d50-a230-11eb-a545-792d0d535ce6.png?x-oss-process=image/resize,w_560)
explore.txt

OUTPUT :

Any doubts regarding this can be explained with pleasure :)
INTRODUCTION: Oil exploration is being conducted by drilling holes and blasting the ground with specific amounts...
Heres what I have so far:
/* Preprocessor directives */
#include <stdio.h>
#include <math.h>
#define pi 3.14159
#define inputfile "c:\\engr 200\\oil_explore.txt"
#define outputfile "c:\\engr 200\\oil_report.txt"
/* Main function */
int main(void)
{
/* Declare variables */
double ratio, depth, ideal_charge, length, weight, number_sticks,
wellsite;
int i;
FILE *explore, *report;
/* Open input file */
explore = fopen(inputfile,"r");
report = fopen(outputfile,"w");
/* Verify input file */
if(explore == NULL)
{
printf("\n\nERROR OPENING INPUT FILE\n\nPROGRAM
TERMINATED\n\n");
return 0;
}
/* Read...
I have this case study to solve. i want to ask which
type of case study in this like problem, evaluation or decision? if
its decision then what are the criterias and all?
Stardust Petroleum Sendirian Berhad: how to inculcate the pro-active safety culture? Farzana Quoquab, Nomahaza Mahadi, Taram Satiraksa Wan Abdullah and Jihad Mohammad Coming together is a beginning; keeping together is progress; working together is success. - Henry Ford The beginning Stardust was established in 2013 as a...