Answer:
- #include <iostream>
- using namespace std;
- class myinteger {
-
- private:
- int value;
-
- public:
- myinteger(int x){
- value = x;
- }
-
- int getValue(){
- return value;
- }
-
- };
- int main()
- {
- myinteger obj(4);
- cout<< obj.getValue();
- return 0;
- }
Explanation:
Firstly, we use class keyword to create a class named myinteger (Line 5). Define a private scope data field named value in integer type (Line 7 - 8).
Next, we proceed to define a constructor (Line 11 - 13) and a getter method for value (Line 15 -17) in public scope. The constructor will accept one input x and set it to data field, x. The getter method will return the data field x whenever it is called.
We test our class by creating an object from the class (Line 23) by passing a number of 4 as argument. And when we use the object to call the getValue method, 4 will be printed as output.
The answer is Cybercrime. <span>The theft and/or destruction of information, resources, or funds via computers, computer networks, or the internet is called Cybercrime. </span><span>Common types of </span>cybercrime<span> involve hacking, online scams and fraud, identity theft, etc.</span>
Answer:
- #include <iostream>
- using namespace std;
- int main()
- {
- // declare and initialize popcorn name array
- string popcorn_name[7] = {"plain", "butter", "caramel", "cheese", "chocolate", "turtle", "zebra"};
- // declare and initialize sales array with 7 elements
- int sales[7];
-
- // A loop to prompt user to enter sales for each popcorn
- for(int i=0; i < 7; i++){
- cout<<"Enter number of sales for " + popcorn_name[i] + " :";
- cin>>sales[i];
- }
-
- // Find maximum sales
- int max = sales[0];
- int maxIndex = 0;
- for(int j=1; j < 7; j++){
- if(max < sales[j]){
- max = sales[j];
- maxIndex = j;
- }
- }
-
- // Find minimum sales
- int min = sales[0];
- int minIndex = 0;
- for(int k=1; k < 7; k++){
- if(min > sales[k]){
- min = sales[k];
- minIndex = k;
- }
- }
-
- // Print popcorn name and sales
- for(int l=0; l < 7 ; l++){
- cout<<popcorn_name[l]<<"\n";
- cout<<"Sales: "<< sales[l]<<"\n\n";
- }
-
- // Print popcorn name with maximum and minimum sales
- cout<<"Highest selling: "<< popcorn_name[maxIndex]<<"\n";
- cout<<"Lowest selling: "<<popcorn_name[minIndex]<<"\n";
- return 0;
- }
Explanation:
Create two arrays to hold the list of popcorn name and their sales (Line 5-8). Next prompt user to input the sales for each popcorn (Line 10-14). Get the maximum sales of the popcorn (Line 17-24) and minimum sales (Line 27-34). Print the popcorn name and sales (Line 37-40) and the popcorn name with highest and lowest selling (Line 43-44).
Answer:
A) Ethernet
To Connect the Printer to a Wired (Ethernet) Network
<h3>
what is the process of connecting a network printer to the SOHO router?</h3>
- Connect one end of an Ethernet cable to the Ethernet port on the back of the printer, then connect the other end of the cable to a correctly configured network port, switch or router port.
- Connect the Printer to a Router.
To learn more about ethernet, refer
to brainly.com/question/24621985
#SPJ4