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
Draw a chart showing the crossing between red and white flowered pea plants till F2 generation. Find out the genotypic and pheno
adelina 88 [10]

Answer:

part 1

F1 cross -

RR * rr

Rr, Rr, Rr, Rr

F2 Cross

Rr * Rr

RR, Rr, Rr, rr

Part 2

Black is dominant over white

Explanation:

Let the allele for red color trait be R and white color trait be r

Red is dominant over white

Genotype of true breeding parents

Red - RR

white - rr

F1 cross -

RR * rr

Rr, Rr, Rr, Rr

All the offspring are red and of genotype Rr

F2 Cross

Rr * Rr

RR, Rr, Rr, rr

RR: Rr: rr = 1:2:1

Phenotype ration

red (RR, Rr) : white (rr)

3:1

part 2

Black is dominant over white

hence, in first generation cross all mice become white

3 0
3 years ago
kelly wants to buy a new operating system for a laptop. under which category will it be in online store?
GuDViN [60]

Answer:

Kelly should look at the electronics section, where the laptops are because a laptop is an electronic. Just like an iPhone, iPad, and a TV.

7 0
4 years ago
One modeling technique drawn from systems analysis and design that can provide an excellent way to illustrate how a business fun
stealth61 [152]

Answer:

collaboration diagram

Explanation:

Collaboration diagram -

It refers to the diagram , which showcase the link between the unified modeling language with the software object , is referred to as the collaboration diagram.

It is also called the communication diagram .

These diagram are very important for a company as it is the  pictorial representation.

Various software are used to make these diagrams.

5 0
3 years ago
Which OS does NOT provide users with a GUI?
vesna_86 [32]
The answer is C ms-dos
Side note:
GUI means graphical user interface. In other words, that means it looks pretty and has cool buttons, animations and cute stuff. MS-DOS is just a black screen with words on it. Definitely not cute or cool.
3 0
4 years ago
Who was the founder of the location-sharing site Whrrl
Lilit [14]
By Pelago, INC. Founders of Pelago are: Jeff Holden<span> and </span><span>Darren Vengroff.</span>
3 0
3 years ago
Other questions:
  • Given two variables hasToner and hasPaper of type bool, that have been declared and given values, write a code block that will o
    15·1 answer
  • What components are in hard drives?
    12·1 answer
  • Write a program that calculates taxi fare at a rate of $1.50 per mile. Your pro-gram should interact with the user in this manne
    12·1 answer
  • In modern web design, color, font, font size, and style should be declared using:
    5·1 answer
  • what are the benefits of VolP? select all that apply. A:cheaper printings B:clearer calls C: faster download D: increased effici
    11·2 answers
  • The program asks the user to enter the time the call is made (day, evening, or night) and the duration of the call (a number tha
    5·1 answer
  • CLICK ME IF U DARE hehehe
    10·2 answers
  • Which of these statements about the truck driving occupation in the U.S. are accurate?
    12·2 answers
  • Explain the different type of shift register counter ​
    14·1 answer
  • The lost boy gave the correct
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!