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
yawa3891 [41]
3 years ago
9

Assume that two int constants,FIRST_YEAR and LAST_YEAR have already been declared and initialized with year values (like 2009, 2

014), 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.
Computers and Technology
1 answer:
levacccp [35]3 years ago
8 0

Answer:

#include <iostream>

using namespace std;

int main()

{

int count;

double oil=10.88;

int FIRST_YEAR=2009,LAST_YEAR=2014;

count = FIRST_YEAR;

do

{

cout << count << ": " << oil << endl;

oil *= 1.20;

count++;

} while ( count <= LAST_YEAR );

return 0;

}

Explanation:

  • Declare the required variables.
  • Use a do-while loop that runs from first year to last year .
  • Display count of oil .
  • Increment oil by 20%  and count by 1.
You might be interested in
What is a feature of Accenture’s myNav platform?
ZanzabumX [31]
C because I said so hahahah
6 0
3 years ago
To gain one pound of fat, how many extra calories would you need to consume?
mamaluj [8]
You'll need $3,500 extra calories to gain one pound of fat.

6 0
3 years ago
A(n) ____ circular reference occurs when a formula in a cell refers to another cell or cells that include a formula that refers
weeeeeb [17]
Indirect is the correct answer. 
8 0
3 years ago
Create a Delegate to Compare two Integers.
Yanka [14]

Answer:

Delegate is a function pointer which points the address of a function.

Explanation:

Let the function to compare two integers takes two integers as arguments

C#.net syntax:

delegate void  Del(int,int);

Here delegate is the keyword. Del is the name of the delegate which stores the address of the function whose return type is void and which takes 2 integer arguments.

public void CompareIntegers(int x, int y)

{

if (x>y) Console.WriteLine("X is greater");

else Console.WriteLine("Y is greater");

}

delegate void  Del(int,int);

void main(){

Del del1=new Del(CompareIntegers);

}

6 0
3 years ago
If two classes combine some private data members and provides public member functions to access and manipulate those data member
egoroff_w [7]

Answer:

c. Using public member functions to access and manipulate the data members

Explanation:

In object oriented programming, abstraction is used in order to lessen the complexity and hiding non essential details about how a program is actually working in the background. In order to achieve abstraction, classes are defined in such a way that the data members are hidden and the member functions form public interface. The public member functions here are used to access and manipulate these hidden or private data members. So the use of public member functions shows the abstraction here. These members functions are public so they can be directly accessed and the hidden or private data members can be accessed indirectly with the help of these member functions. So internal details of the classes and its data members are hidden from the outside world. Thus abstraction used here ensures security of data members of two classes and protects them from any accidental alterations by other parts of program.

5 0
3 years ago
Other questions:
  • What is a text feature that could add visual interest and clarity to a procedural document?
    7·2 answers
  • Your employer is opening a new location, and the IT director has assigned you the task of calculating the subnet numbers for the
    14·1 answer
  • Paul is a chemical engineer working with large storage tanks of chemicals. Working from home using a program on his computer, he
    5·1 answer
  • A contiguous subsequence of a list S is a subsequence made up of consecutive elements of S. For example, if S is 5,15,-30,10,-5,
    12·1 answer
  • An IT security threat is anything that might cause serious harm to a computer system, including someone stealing a laptop that c
    8·2 answers
  • User defined blocks of code can be created in
    13·1 answer
  • Investigate the many ways that hardware and software can cause an interrupt to occur. Are ALL interrupts treated equally or do s
    13·1 answer
  • Households play a role in the circular flow of goods by
    12·1 answer
  • List 1 reason people invest in Cryptocurrency
    10·1 answer
  • Why is it important to follow a consistent naming convention for variables?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!