1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
GrogVix [38]
3 years ago
10

Write a program which can do a String Check if its Panagram or not!

Computers and Technology
1 answer:
slega [8]3 years ago
3 0

Answer:

#include <bits/stdc++.h>

using namespace std;

bool isPangram(string &s) //boolean function to check whether the string is pangram or not...

{

 int a[26]={0};//initializing the array a with zero.

   for(int i=0;i<s.length();i++)

   {

       if(s[i]>='A' && s[i] <= 'Z') //checking for uppercase letters..

       {

           a[s[i]-'A']++;

       }

       else if(s[i]>='a' && s[i] <= 'z')//checking for lowercase letters..

       {

           a[s[i]-'a']++;

       }

   }

   for(int i=0;i<26;i++)//if any value of array a is zero then returning false.

   {

       if(a[i]==0)

       return false;

   }

   return true;

}

int main() {

   string s;

   getline(cin,s);

   bool b=isPangram(s);

   cout<<b<<endl;

return 0;

}

Input:-

abcdefghijklmnopqrstuvwxy z

Output:-

1

Explanation:

Pangram string is a string that contains all the alphabetical letters form a to z.So the above program returns 1 if the string is Pangram and 0 if the string is not pangram.

I have used a function called isPangram of type boolean.In the function I have taken an array of size 26 and initialized it with 0.Then iterating over the string and updating the count in the array a.Then checking if any value in the array a is zero if it is then the answer is false else it is true.

You might be interested in
I need help with the code practice 9.2 Edhesive.<br><br> Thank you
antiseptic1488 [7]

Answer:

you talking about anaconda navigation? i would love to help!

Explanation:

3 0
3 years ago
Read 2 more answers
____ is designed for short-distance connections and has only a few lambdas, with a greater space between lambdas. Group of answe
givi [52]

Answer:

The answer is Coarse wavelength division multiplexing (CWDM)

Explanation:

CWDM is the wavelength designed for short- distance connections  and has only a few lambdas. It is mostly used nowadays as a type of wavelength technologies deployed in cities and inner access ways. It is inexpensive and thus a cost effective wavelength  division multiplexing. Cost effective lasers can be used in CWDM due to the spacing of about 20nm between its wavelengths.

4 0
3 years ago
Read 2 more answers
Here is the API for a robot library.
marishachu [46]

Answer:

hi

Explanation:

8 0
3 years ago
Display the cost of landscaping a backyard with sod that is sold by the square foot and fencing that is sold by the foot. The in
Ipatiy [6.2K]

Answer:

length = float(input("Enter length of the backyard in foot: "))

width = float(input("Enter width of the backyard in foot: "))

sod_price = float(input("Enter the price of sod per square foot: "))

fencing_price = float(input("Enter the price of fencing per foot: "))

area = length * width

perimeter = 2 * (length + width)

cost = sod_price * area + fencing_price * perimeter

print("The cost of landscaping is $" + str(cost))

Explanation:

*The code is in Python.

Ask the user to enter the length, width, sod_price, and fencing_price

Calculate the area and perimeter of the backyard

Calculate the cost, sod_price * area + fencing_price * perimeter

Print the cost

7 0
3 years ago
A(n) _____ program, used to participate in a newsgroup, is often provided with some e-mail software.
pogonyaev
Newsreader.

I hope it helps you.
8 0
3 years ago
Other questions:
  • Write a loop to print 10 to 90 inclusive (this means it should include both the 10 and 90), 10 per line.​
    6·1 answer
  • Which activity does not allow a person to perform any work while at the shop
    10·1 answer
  • What are the three fundamental principals of mnemonics? <br><br>HELP FASTTT!
    15·1 answer
  • Which of the following should get a Page Quality (PQ) rating of Low or Lowest?
    5·1 answer
  • Modify the code below to do the following:
    12·1 answer
  • What two statements about IPv6 addresses are true? This task contains the radio buttons and checkboxes for options. The shortcut
    7·1 answer
  • You are going to buy a computer, but first you want to do some research to help you select the best model for your need. Where s
    12·2 answers
  • The objective of this task is to use Scapy to estimate the distance, in terms of number of routers, between your VM and a select
    7·2 answers
  • Help please match them if you just put a link or say “I don’t know but thanks for the points” I’ll report your answer and you wo
    10·1 answer
  • A social service agency hires accenture to improve training and experiences for caseworkers. What is one way accenture can use v
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!