Answer:
The algorithm is as follows:
1. Input sentence
2. Input character
3. Length = len(sentence)
4. count = 0
5. For i = 0 to Length-1
5.1 If sentence[i] == character
5.1.1 count++
6. Print count
7. Stop
The program in C++ is as follows:
#include <iostream>
#include <string.h>
using namespace std;
int main(){
char str[100]; char chr;
cin.getline(str, 100);
cin>>chr;
int count = 0;
for (int i=0;i<strlen(str);i++){
if (str[i] == chr){
count++;} }
cout << count;
return 0;}
Explanation:
I will provide explanation for the c++ program. The explanation can also be extended to the algorithm
This declares the string and the character
char str[100]; char chr;
This gets input for the string variable
cin.getline(str, 100);
This gets input for the character variable
cin>>chr;
This initializes count to 0
int count = 0;
This iterates through the characters of the string
for (int i=0;i<strlen(str);i++){
If the current character equals the search character, count is incremented by 1
if (str[i] == chr){ count++;} }
This prints the count
cout << count;
If i had to guess it would be 1. page design but i could be wrong i dont use publisher to much.
Relational operators allow an end user to <u>compare</u> numbers.
<h3>What are
relational operators?</h3>
Relational operators can be defined as a programming language construct which allows an end user to compare both numbers and char values.
Also, it can be used to determine whether one number is less than (<), greater than (>), equal to (=), or not equal to another.
This ultimately implies that, relational operators allow an end user to <u>compare</u> numbers.
Read more on relational operators here: brainly.com/question/14995818
#SPJ1
Answer:B) Wide-Area Network (WAN)
Explanation: WAN(Wide area network)is the network which constitutes a large geographical region.This network consist of the small network unit as well as large network connections.This network does not have the geographic dispersion of the components of networks.
WAN works in geographic region for the dispersion between any two locations. Other options are incorrect because they connect the network components geographically. Thus the correct option is option(B).
Since the ARP broadcast is utilized to request the MAC address of the Host with the IP address contained in the ARP, the PC needs to know the destination of MAC address before it can produce the frame header for the particular PING requested, before it can send a PING to a host.