#include <iostream>
using namespace std;
class CarCounter {
public:
CarCounter();
CarCounter(const CarCounter& origCarCounter);
void SetCarCount(const int count) {
carCount = count;
}
int GetCarCount() const {
return carCount;
}
private:
int carCount;
};
CarCounter::CarCounter() {
carCount = 0;
return;
}
CarCounter::CarCounter(const CarCounter &p){
carCount = p.carCount;
}
void CountPrinter(CarCounter carCntr) {
cout << "Cars counted: " << carCntr.GetCarCount();
return;
}
int main() {
CarCounter parkingLot;
parkingLot.SetCarCount(5);
CountPrinter(parkingLot);
return 0;
}
Sample output:
Cars Counted: 5
Answer:
The most basic and useful technique in NLP is extracting the entities in the text. It highlights the fundamental concepts and references in the text. Named entity recognition (NER) identifies entities such as people, locations, organizations, dates, etc. from the text.
Answer:
1-rollover, 2-straight-through, 3-crossover are the correct answer of this question .
Explanation:
Rollover , Straight-through and Crossover are the types of UTP cables that can be used in connected to the device.
- Rollover refers to a slider on a Website page which allowing the user to engage with the Website page.
- In Straight-through a network patch panels which connects a machine to a node on the web.
- A Crossover Ethernet used during direct communication of portable devices. It combines two similar-type computers.
Answer:
// here is code in java.
public class NAMES
{
// main method
public static void main(String[] args)
{
int n=4;
// print the upper half
for(int a=1;a<=n;a++)
{
for(int b=1;b<=n-a;b++)
{
// print the spaces
System.out.print(" ");
}
// print the * of upper half
for(int x=1;x<=a*2-1;x++)
{
// print the *
System.out.print("*");
}
// print newline
System.out.println();
}
// print the lower half
for(int y=n-1;y>0;y--)
{
for(int z=1;z<=n-y;z++)
{
// print the spaces
System.out.print(" ");
}
for(int m=1;m<=y*2-1;m++)
{
// print the *
System.out.print("*");
}
// print newline
System.out.println();
}
}
}
Explanation:
Declare a variable "n" and initialize it with 4. First print the spaces (" ") of the upper half with the help of nested for loop.Then print the "*" of the upper half with for loop. Similarly print the lower half in revers order. This will print the required shape.
Output:
*
***
*****
*******
*****
***
*
Explanation:
Execution step:
1. Starting the program
2. It will get the animal name
3. Check whether the animal eats only plants. Then it prints "Herbivore". If the condition is false, it prints "carnivore".
4. Stop the program
To identify input, output and decision:
Start and Stop (oval): These are neither input nor output
Does it eat only plants?: Decision making statement ("d")
Read the names of the animals(Parallelogram): Input ("i")
Print Herbivore, Print Carnivore: Output "o"
Scenario 1: Input is lion
1. Start
2. Reads the input as "lion"
3. Check if lion eats only plants. So here it is false
4. Print "Carnivore"
5. Stop
Scenario 1: Input is Elephant
1. Start
2. Reads the input as "Elephant"
3. Check if lion eats only plants. So here it is true
4. Print "Herbivore"
5. Stop