Highlight text. idk im guessing i tried google
Answer:
dog
Explanation:
Given the code :
>>> A = [21, 'dog', 'red']
>>> B = [35, 'cat', 'blue')
>>> C = [12, 'fish', 'green']
>>> E = [A, B, C]
the value of E[0][1]
Here, square boxes is used to select the value at E[0] ; the output is then used to select the value at index 1 of E[0] output.
Note that, indexing starts at 0; hence first list element is 0, then, 1, 2, and so on.
At
E[0] ; list E, index 0 (first element in the list) , gives an output A
Then, A[1] ; list A, index 1 (second element in the list) gives 'dog'
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.
Answer:
The program to this question as follows:
Program:
#include <stdio.h> //including header file
int main() //defining main method
{
printf("\t ^ ^\n"); //print design
printf("\t ( o o )\n"); //print design
printf("\t v"); //print design
return 0;
}
Output:
^ ^
( o o )
v
Explanation:
In the C language program above, the header file is included first, then the main method is defined, inside this method print function is used to print the given design.
In the print function, we print values as a message, in which "\t and \n" are used. The "\t" is used for giving a tab space, and "\n" is used for print value in the new line.
What? I’m confused what to help with