Answer:
option c. Container
Explanation:
The container class establish links between objects, a procedure must be developed to do so, as well as to insert new member objects into appropriate spots. The procedures in a container class include assigning the correct linking pointer values to new list members. There is also the option to delete a member of the list, reorder it or retrieving and displaying the object from a list.
Container class can be split into: Sequence containers, Associative containers, Unordered associative containers and container adaptors.
Answer:
//C++ code for the cash register..
#include <iostream>
#include<vector> //including vector library
using namespace std;
int main() {
vector<float> cash; //declaring a vector of type float.
float item=2,cash_sum=0;
int counter=1;
while(item!=0)//inserting prices in the vector until user enters 0...
{
cout<<"Enter the price of item "<<counter<<" :"<<endl;
cin>>item;
counter++;
cash.push_back(item);//inserting element in the vector...
}
for(int i=0;i<cash.size();i++)//looping over the vector...
{
cash_sum+=cash[i];//summing each element..
}
cash_sum*=1.08;//adding 8% sales tax.
cout<<cash_sum;//printing the result....
return 0;
}
Explanation:
I have taken a vector of type float.
Inserting the price of each item in the vector until user enters 0.
Iterating over the vector for performing the sum operation.
Then after that adding 8% sales tax to the sum.
Printing the output at last.
Upgrade to the latest operating system that supports the software. Leave a thanks for support. Much appreciated
Answer:
There were several problems with the code:
- When pressing arrow left, the ninja was moving to the right.
- The ninja could be moved off the screen and then is lost
- When changing the direction, the ninja didn't change its appearance
Explanation:
See screenshot for changes. 10 was changed to -10, and I added checks to see if the ninja is at the edge of the screen.