Answer:
mystring = "My name is David Acheme"
count = 0
for i in mystring:
if(i.islower()):
count=count+1
print("The number of lowercase characters in: "+mystring)
print(count)
Explanation:
1. We declare a String Variable and assign a value.
2. Intialize a count variable to zero.
3. Using a for loop is to loop through each characters in the string.
4. The if condition checks when a lower case character is encountered using the islower method and increases count by 1
5. Prints the value of count.
Answer:
C. Practiced in front of a trusted adult..
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.
Google yourself once a year.
Answer:
The correct answer is 16 bit.
Explanation:
The main role of the transport layer provided the communication channel of the process which are running in a different host. When the information flows there is always traffic that is arisen but the transport layer aimed is that process will go at the correct node and received at the proper destination. The 16-bit number specifies that the process or node is running in the networked traffic.