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
Modify the list according to the following: append the smallest value at the end of the list when all numbers in the list are ne
ddd [48]

Answer:

The solution code is written in Python 3:

  1. def modifyList(listNumber):
  2.    posCount = 0
  3.    negCount = 0
  4.    for x in listNumber:
  5.        if x > 0:
  6.            posCount += 1
  7.        else:
  8.            negCount += 1
  9.    
  10.    if(posCount == len(listNumber)):
  11.        listNumber.append(max(listNumber))
  12.    
  13.    if(negCount == len(listNumber)):
  14.        listNumber.append(min(listNumber))
  15.    
  16.    print(listNumber)
  17. modifyList([-1,-99,-81])
  18. modifyList([1,99,8])
  19. modifyList([-1,99,-81])

Explanation:

The key step to solve this problem is to define two variables, posCount and negCount, to track the number of positive value and negative value from the input list (Line 2 - 3).

To track the posCount and negCount, we can traverse through the for-loop and create if else statement to check if the current number x is bigger than 0 then increment posCount by 1 otherwise increment negCount (Line 5- 9).

If all number in the list are positive, the posCount should be equal to the length of the input list and the same rule is applied to negCount. If one of them happens, the listNumber will append either the maximum number (Line 11 -12) or append the minimum number (Line 14-15).

If both posCount and negCount are not equal to the list length, the block of code Line 11 -15 will be skipped.

At last we can print the listNumber (Line 17).

If we test our function using the three sets of input list, we shall get the following results:

[-1, -99, -81, -99]

[1, 99, 8, 99]

[-1, 99, -81]

3 0
3 years ago
You plug a new scanner into a USB port on your Windows system. When you first turn on the scanner, what should you expect to see
Paul [167]

Answer:

A window notifying that: Found New Hardware Wizard

Explanation:

As soon as any device is plugged into the USB port, the default settings will display a window onto the screen which will notify about the addition of a new hardware to the system. This window can further be used to know the properties of the hardware or for configuration settings.

This process is same like the software part, that whenever a new application is installed onto the system a pop up notification alerts about its presence.

So when the scanner will be attached through USB port a window will be appeared notifying about the discovery of new hardware.

3 0
3 years ago
Fungsi radio adalah..?
malfutka [58]

Answer:

lebih lanjut bahwa radio mempunyai fungsi sebagaimana media- media lain yaitu memberikan informasi/to inform, memberikan pendidikan/to educate, memberikan hiburan/to intertain, fungsi memengaruhi/to influence, dan fungsi pengawasan to control.

<h2>translate;</h2>

Furthermore, radio has a function like other media, namely to provide information/to inform, provide education/to educate, provide entertainment/to intertain, function to influence/to influence, and control function to contact.

Explanation:

8 0
2 years ago
Which of the following is an example of batch processing?
9966 [12]

Answer:

several personnel accessing the registration system

Explanation:

batch processing is all about multiprogramming so I think the first answer is the best as it is not based on one person .I know the last answer might be almost close but on a closer look it is not the answer as it is single based as written a file

7 0
3 years ago
To copy the formatting of selected text to another place in the document use _____.
ANEK [815]
To copy the formatting of selected text to another place in the document use the paintbrush AKA. Format painter
7 0
3 years ago
Other questions:
  • Create a class called Clock to represent a Clock. It should have three private instance variables: An int for the hours, an int
    15·1 answer
  • A user of the wireless network is unable to gain access to the network. The symptoms are:1.) Unable to connect to both internal
    6·1 answer
  • 5. The hazardous component in most antifreeze is _____, which is extremely toxic to humans and animals. A) Calcium Carbonate B)
    13·2 answers
  • Write a function called activity which takes an integer parameter X that does the following:
    6·1 answer
  • As a computer science student, which career you will select and what do you predict about the future of that specific IT-Career.
    8·1 answer
  • How do I start conversations with ppl??? If u answer right I will try send u more points... So please help me
    7·1 answer
  • Functionality testing is primarily used with ____________. firewall protection software development hardening servers server tes
    8·1 answer
  • Phân tích 5 phương hướng nhiệm vụ phát triển nông -lâm -ngư nghiệp ở nước ta hiện nay
    11·1 answer
  • Coffee shops worldwide throw away billions of paper cups each year. Discuss
    9·1 answer
  • What Is The First Computer Brought In Nepal ? <br>​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!