Answer:
Libraries in c++ allows us to use common functions and data structures such as vectors,queue,stack etc.You have already used iostream library by which you are taking input and printing the output with the help of cin and cout functions.
for example you should use vector library to be able to use vector in your program.
You can incorporate library in your c++ program by writing #include<library name> at the starting odf the program.
for example:-
#include<iostream> //including iostream library.
#include<queue> //including queue library.
using namespace std;
int main()
{
queue<int> q; //declaring a queue of integer type.
q.push(23);//adding 23 in the queue q.
q.push(56);//adding 56 in the queue q.
q.pop();//deleting element from the queue.
cout<<q.front()<<endl;//printing fornt of the queue..
return 0;
}
output :-56
Answer:
For values when n<32 use fb(n) else use fa(n).
See explaination for details
Explanation:
Earlier when n=1 fa(n)=2000 while fb(n)=2. for n=2 fa(n)=2000*22 =2000*4=8000 while fb(n)=2*24=2*16=32. It is observed that fa(n) requires more time than fb(n) for small values.
Now, we will see when fb(n) crosses fa(n). This can happen only when fb(n) values equals or greater than fa(n)
therefore,
2000n2<=2n4
Solving equation we get n2>=1000 which can happen when n>=32.
So for values when n<32 use fb(n) else use fa(n)
<h2>Please wait until more research is discovered...</h2>
Question
A size of a jumbo candy bar with rectangular shape is l x w x h. Due to rising costs of cocoa, the volume of the candy bar is to be reduced by p%.
To accomplish this, the management decided to keep the height of the candy bar the same, and reduce the length and width by the same amount.
For example, if l = 12, w = 7, h = 3, and p = 10, then the new dimension of the candy bar is 11.39 x 6.64 x 3.
Below is an example of how the completed program should work:
Enter the length, width, and height of the candy bar separated by space(s): 12 7 3
Enter the amount of the reduced volume as a percentage: 10
The new dimensions of the candy bar is: 11.38 x 6.64 x 3.00
Format your output with setprecision(2) to ensure the proper number of decimals for testing!