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 have a bag of trail mix . one half of the bag is peanuts. 1/4 of the bag is chocolate candies , and 1/4 of the bag is died fru
Lelu [443]
In our bag, 1/2 is peanuts, 1/4 is chocolate and 1/4 is dried fruit.

The likelihood of drawing a chocolate therefore is 1/4. 

The likelihood of drawing a peanut is 1/2 and the likelihood of drawing a dried fruit is 1/4.

Thus, D is the correct answer because the 1/4 likelihood of drawing a chocolate is less than the 1/2 chance of drawing a peanut.
8 0
3 years ago
What would a world where we have 2^128 (340 undecillion) Internet connected devices look like? How could that much Internet usag
cluponka [151]

A world  have 2^128 (340 undecillion) of IPv addresses that helps to connect to the internet. IPv6 addresses can make it easier for working organizational teams connecting to the Internet, IP addresses that are created by IPv6 are 128 bits.

<h3>What is internet?</h3>

Internet is the system  uses the Internet protocol suite (TCP/IP)  and interconnected computer networks that communicate between two or more individuals.

Today, almost 20 IP addresses are taken by7 each home for each electronic device. The internet usage is so wide, that even a simple task  is not possible without it. Even a simple task can be done using internet.

Learn more about internet.

brainly.com/question/13308791

#SPJ1

5 0
2 years ago
Bytes are typically represented with a lowercase b and bits with an uppercase B.<br> true or false
34kurt

Answer:

False

Explanation:

Byte(B) is uppercase

bit(b) is lowercase

Good way to remember is that its takes 8 bits makes a byte. In other word, a byte is bigger than a bit so it makes sense that byte is uppercase.

7 0
3 years ago
In Java an abstract class cannot be sub-classed<br><br> ?? True<br><br> ?? False
mojhsa [17]

Answer:

False

Explanation:

An abstract class is a class declared abstract — it may or may not include abstract techniques. It is not possible to instantiate abstract classes, but they can be sub-classed.

<u></u>

<u>Abstract method declaration</u>

             

         abstract void moveTo(double X, double Y);

Usually the subclass offers solutions for all of the abstract techniques in its parent class when an abstract class is sub-classed. If not, however, the subclass must be declared abstract as well.

<u>Example</u>

public abstract class GraphicObject {

  // declaring fields

  // declaring non-abstract methods

  abstract void draw();

}

8 0
3 years ago
Advantages of monolithic operating system? ​
Lyrx [107]

Advntage:

provides CPU scheduling, memory management, file management, and other operating system functions through system calls. The other one is that it is a single large process running entirely in a single address space.

Disadvantage: if anyone service fails it leads to an entire system failure

8 0
2 years ago
Other questions:
  • Jannette has been experiencing slow performance on her computer. Today she received an error message saying that an update to he
    12·2 answers
  • Please help
    5·1 answer
  • If you want to prioritize downloads of your mobile app instead of visits to your mobile site, you should: a) add a sitelink exte
    10·1 answer
  • The command to delete all the files that have filenames that starts with letter c or c and ends with a letter z or z is
    15·1 answer
  • The statement ____ declares intList to be a vector and the component type to be int
    8·1 answer
  • Consider an application that transmits data at a steady rate (for example, the sender generates N-bit unit of data every k time
    7·1 answer
  • Assume the availability of a function named oneMore. This function receives an integer and returns one more than its parameter.
    14·1 answer
  • Please help!!! I am very confused about this question!
    10·1 answer
  • Zoe wants to use an image file that will allow her to preserve all of the original
    10·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!