Answer:
// program in java.
import java.util.*;
// class definition
class Main
{
// main method of the class
public static void main (String[] args) throws java.lang.Exception
{
try{
// object to read input
Scanner scr=new Scanner(System.in);
System.out.print("Enter the String:");
// read string from user
String str=scr.nextLine();
System.out.print("Enter the character:");
// read character
char ch=scr.next().charAt(0);
// variable to count the occurrence of character
int char_count=0;
for(int i=0;i<str.length();i++)
{
// find the character i string
if(ch==str.charAt(i))
// increase the count
char_count++;
}
// print the count
System.out.println("count of "+ch+" in the String is:"+char_count);
}catch(Exception ex){
return;}
}
}
Explanation:
Read a string from user and assign it to variable "str".Then read a character to and assign it to variable "ch".Then Declare a variable "char_count" to count the occurrence of character in the string.Find the count of character in the string. Here upper case character is different than lower case.
Output:
Enter the String:Monday
Enter the character:n
count of n in the String is:1
Enter the String:Nobody
Enter the character:n
count of n in the String is:0
Answer:
False
Explanation:
The Carrier-sense multiple access with collision detection (CSMA/CD) technology was used in pioneer Ethernet to allow for local area networking. Carrier-sensing aids transmission while the collision detection feature recognizes interfering transmissions from other stations and signals a jam. This means that transmission of the frame must temporarily stop until the interfering signal is abated.
The advent of Ethernet Switches resulted in a displacement of the CSMA/CD functionality.
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:
Active Directory
Explanation:
The 2012 R2 Windows Server is the 6th version of Windows Server server operating system which is made by Microsoft. It is a part of the Windows NT family of the operating systems.
Active Directory helps to store the default user profiles as well as the user login scripts.
It helps to assign the system policies, assign permission to the users overt he network resources and also to deploy software in a centralized manner.
Answer:
Yes, The overall cost of wiring in addressable fire alarm system is significantly cheaper than the conventional one.But the addressale fire alram system is more reliable than a conventional system.
Explanation:
Conventional systems are hardware-based and use analog technology. where addressable fire alarm use digital technology. addressable system is generally more reliable than a conventional system mainly due to how the different systems are wired. With a conventional system, if a device’s wire is damaged or severed, its signal and the signal of other devices down the line cannot be transmitted to the control panel.
With an addressable system, both ends of the wire connect to the control panel. Therefore, if one end becomes damaged or severed, signals can still reach the control panel through the other end of the loop. In addressable systems, a device can be removed or disabled and it will not affect the other devices in the loop.