Assume that two int constants,FIRST_YEAR and LAST_YEAR have already been declared and initialized with year values (like 2009, 2014), along with a double variable oil that has been initialized with the number of barrels of oil consumed in Canada in the year given by FIRST_YEAR. Write some code that uses a while statement to print on a line by itself, each of the years from FIRST_YEAR to LAST_YEAR inclusive. On each line, after the year, separated by a colon and a space, print the new value amount of oil, taking into account that each year the oil consumed increases by 20%.

Answers

Answer 1

// While loop

while(FIRST_YEAR < LAST_YEAR)

{

cour<<"Year : " << First_YEAR << " Oil consumed is : " << oil <<"."<<endl;

FIRST_YEAR+=1;

// calculate the 20% increase

oil = oil + (oil *.20)

}


Related Questions

An administrator has created a new custom object in a sandbox environment and now is ready to deploy in production. How can the administrator ensure that the field-level security that was tested and approved in the sandbox environment is maintained as part of the deployment? a) Create a change set that includes the custom object and all custom fields b) Create a change set that includes the custom object and all profiles c) Create a change set that includes the custom object, check the retain field-level security option d) Create a change set for the custom object; use Data Loader to transfer field-level security

Answers

Answer:

Option D

Explanation:

Option A is rejected because adding a custom object will cost both in memory and computation power. Consider that you have 1 million users, than there will be 1 million custom objects in the memory for checking the security which is not good.

Option B is not answer because again making a custom object will cost in memory and computation power.

Option C is not good because it also makes the custom object.

Option D is selected because change sets can be made which will not cost as much as the other options are costing. Also Data Loader can have come credentials defined in it which we can use to check if the user activities are according to the rules at each level.These days these data loader object technique is used because there will be static change sets for the class of users to check security.

Other Questions
Mis padres siempre -las llaves.A. perderOB. pierdeC. pierdenOD. perdemos Match the words on the left with their definitions on the right. You may use a dictionary. 1. buoyant 2. euphoric 3. jubilant 4. rapturous 5. untroubled 6. cajole 7. harangue 8. quibble 9. whine 10. rant a. in a state of great happiness b. having a feeling of great happiness and excitement c. calm and tranquil d. feeling or expressing great joy e. happy and confident f. to talk bombastically g. to evade the truth or the point at issue by arguing over trifles h. to express oneself at considerable length i. to talk coaxingly and flatteringly j. to complain in a childish, fretful manner and in a nasal tone 478,387 to the nearest ten thousand How does the oxymoron "tranquil patter" affectthis sentence?And as my reverie softened down to a sadderand sadder pathos, the shrieking of the windsoutside softened to a wail, the angry beating ofthe rain against the panes diminished to atranquil patter, and one by one the noises inthe street subsided, until the hurrying footstepsof the last belated straggler died away in thedistance and left no sound behind.A. It contrasts the shrieking winds withinthe quiet of the streetB. It implies that the noise of the rainon the windowpane is relaxing.C. It indicates that the loud soundsfrom the street are soothingD. It shows the calming effect thepeople on the street have on thenarrator Please help!!A multiple-choice test consists of 28 questions with possible answers of a,b,c,d. Estimate the probability that with random guessing, the number of correct answers is at least 12. A flare is shot straight up from a flare gun, from a height of 6 meters, and with a velocity of 60 m/s. How many seconds it takes for the flare to hit the ground? Use the formula below where v0 is the initial velocity and h0 is the initial height. Approximately how long will is take the object to hit the ground?[tex]h(t) = -4.9t^2 + v_0t + h_0[/tex]10.8 sec11.4 sec11.8 sec12.3 sec In what way did the Second Continental Congress begin to act like a government?The Congress took steps to expel people who were loyal to Britain from the colonies.The Congress took steps to pay for its army by printing paper money.The Congress sent petitions to King George.The Congress met to discuss issues relating to Britain. 7The market structure of pure competition is distinctive because ? Which best completes this summary of the first paragraph of The Dark Game?In 1861, many did not believe the Civil War would last long; however, . Suppose a 20-foot ladder is leaning against a building, reaching to the bottom of a second-floor window 15 feet above the ground. What angle, in radians, does the ladder make with the ground Round your answer to two decimal places True of False - use T or FThe Exception class can be extended. Mexican War to write a brief persuasive article that supports or opposes US actions against Mexico. ONE HALF OF AN ANNUALLY SALARY OF $35,700. IS APPROXIMATELY When Gina was 10, she swam in the ocean for the first time. She remembers the feeling of kicking her feet, slicing her arms through the water, tasting the tangy salt water, floating, and learning from her father that salt water is more dense than fresh water, which makes floating easier. Which element is a semantic memory?A. The feeling of floating on her backB. That salt water is more dense than fresh waterC. The familiar feel of kicking her feet and slicing her arms through the waterD. How tangy the salt water was Assume the random variable x is normally distributed with mean muequals=8787 and standard deviation sigmaequals=55. Find the indicated probability. P(x less than European counties went to war with France partly to stop ____ from spreading solve l 3x-7 l = 2and solve l 2x-5 l< or equal to 8the lines (l) signifies absolute values therefore l 3x-7 l is the absolute value of that and same thing for 2x-5 Selected information from Large Corporation's accounting records and financial statements for 2013 is as follows ($ in millions): Cash paid to acquire a patent $48 Treasury stock purchased for cash 45 Proceeds from sale of land and buildings 75 Gain from the sale of land and buildings 46 Investment revenue received 15 Cash paid to acquire office equipment 70 Large prepares its financial statements in accordance with IFRS. In its statement of cash flows, Large most likely reports net cash outflows from investing activities of:a. $28 million.b.$48 million.c.$118 million.d.$58 million. Which is appropriate for initial rate method experiments to analyze an enzyme-catalyzed reaction?Both enzyme and substrate concentrations are constant.The temperature is varied and the rate is measured.Enzyme concentration is constant and the rate is measured at different substrate concentrations.Substrate concentration is constant and the rate is measured at different concentrations of enzyme.The substrate and enzyme concentrations are varied inversely with respect to one another and the rate is measured. A solenoid has a radius Rs = 14.0 cm, length L = 3.50 m, and Ns = 6500 turns. The current in the solenoid decreases at the rate of 79.0 A/s. A circular coil with a single turn and radius rc = 20.0 cm encircles the solenoid with its plane perpendicular to the axis of the solenoid. Determine the magnitude of the average induced electric field in the coil.