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
4vir4ik [10]
3 years ago
6

An oil slick occurs when an underwater refinery pipe ruptures, pumping oil into the water. The spilled oil sits on top of the wa

ter and causes a natural disaster. For simplicity, suppose that the oil sits on top of the water in the form of a circle. Write a program that prompts the user to enter the rate at which the ruptured pipe pumps oil (in gallons) per minute, the thickness of the oil on top of the water, and the number of days for which the area is covered by the spilled oil. The program outputs the spilled area (in kilometers) and the volume of oil (in gallons) on top of the water after each day.
Computers and Technology
1 answer:
yaroslaw [1]3 years ago
8 0

Answer:

Here the code is given as follows,

Explanation:

#include <iostream>

#include <iomanip>

using namespace std;

const double CUBIC_CENTIMETERS_IN_ONE_GALLON = 3785.41;

const double CENTIMETERS_IN_ONE_KILOMETER = 100000.00;

double oilSlickArea(double oilThick,

double oilReleasedRate, double spilTimeInHours);

int main()

{

double oilThickness;

double oilReleasedGallonsPerMinute;

int slickDays;

double spillArea = 0.0;

cout << fixed << showpoint << setprecision(8);

cout << "Enter the oil spill rate per minute (in gallons): ";

cin >> oilReleasedGallonsPerMinute;

cout << endl;

cout << "Enter oil thickness on top of the water (in centimeters): ";

cin >> oilThickness;

cout << endl;

cout << "Enter the number of days for which you want to know "

<< "the area covered by the spilled oil: ";

cin >> slickDays;

cout << endl;

cout << "Oil slick area after each day for " << slickDays << "days."

<< endl << endl;

cout << setw(5) << " " << setw(20) << left << "Slick Area in"

<< setw(20) << left << " Volume of Oil in" << endl;

cout << setw(5) << left << "Day " << setw(20) << left << "Square Kilometers"

<< setw(20) << left << " in Gallons" << endl;

for (int i = 1; i <= slickDays; i++)

{

spillArea = spillArea + oilSlickArea(oilThickness,

oilReleasedGallonsPerMinute, 60 * 24);

cout << setw(4) << left << i << " " << setw(12)

<< setprecision(8) << spillArea / (CENTIMETERS_IN_ONE_KILOMETER * CENTIMETERS_IN_ONE_KILOMETER)

<< " " << setprecision(2)

<< right << setw (15) << (oilReleasedGallonsPerMinute * 60 * 24 * i) << endl;

}

return 0;

}

double oilSlickArea(double oilThick,

double oilReleasedRate, double spilTimeInHours)

{

double oilVolumeInGallons;

double oilVolumeInCubicCentimeters;

double spillArea;

oilVolumeInGallons = oilReleasedRate * spilTimeInHours;

oilVolumeInCubicCentimeters = oilVolumeInGallons * CUBIC_CENTIMETERS_IN_ONE_GALLON;

spillArea = oilVolumeInCubicCentimeters / oilThick;

return spillArea;

}

You might be interested in
How will you define a text?
Phantasy [73]

Answer:

Text refers to content rather than form; for example, if you were talking about the text of "Don Quixote," you would be referring to the words in the book, not the physical book itself. Information related to a text, and often printed alongside it—such as an author's name, the publisher, the date of publication, etc.—is known as paratext.

The idea of what constitutes a text has evolved over time. In recent years, the dynamics of technology—especially social media—have expanded the notion of the text to include symbols such as emoticons and emojis. A sociologist studying teenage communication, for example, might refer to texts that combine traditional language and graphic symbols.

Explanation:

<h2>I Hope it help</h2>
8 0
3 years ago
A customer wants to migrate to Autonomous Database (ADB) but only allows for a very small window of downtime. Golden Gate was ad
kow [346]

Answer:

C

Explanation:

Golden Gate Gate Cloud Service is more appropriate as it is a cloud based replication service with sub-second latency. This minimises downtime for the customer as Golden Gate Cloud can be used immediately after a fault, as the database will be fully replicated up to the moment of the fault occurring.

6 0
3 years ago
What time is spellrd the same forwards and backwards​
Juliette [100K]
12:21 is the correct answer
6 0
3 years ago
What are some tips you can use when taking close up photos
Anit [1.1K]

Set your camera up on a tripod

Choose a subject (anything really)

Get your camera up close to the subject

Switch your camera to Manual focus. You can try auto focus, but generally you will be able to focus a little closer on manual focus.

(If you are using manual focus, the tripod will be important.)

4 0
3 years ago
Read 2 more answers
A developer of a relational database refers to a file as a
goldenfox [79]
This is the correct Answer    <span>Attribute</span>
5 0
3 years ago
Other questions:
  • Question 4 / 5
    11·1 answer
  • Write a program that prints the following text: In C, lowercase letters are significant. main() is where program execution begin
    14·1 answer
  • Fill in the code to complete the following function for computing a Fibonacci number. public static int fib(int index) { if (ind
    6·1 answer
  • A large lens can be very heavy and can only be supported at the_______.
    13·1 answer
  • A ____ is an electronic device, operating under the control of instructions stored in its own memory, that can accept data, proc
    11·1 answer
  • You are troubleshooting a mobile device that will not pair with a Bluetooth headset. The device was functioning properly with th
    7·1 answer
  • Create a python code with 5 circles, 5 polygons, 5 line commands, 2 for loops, and 1 global variable
    12·1 answer
  • Java Eclipse homework. I need help coding this
    6·1 answer
  • Who is he can anyone help me​
    14·2 answers
  • What kind of email formatting change can you make using the Rules Wizard?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!