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
kakasveta [241]
4 years ago
12

Use C++ promming language

Computers and Technology
1 answer:
Alecsey [184]4 years ago
6 0

Answer:

C++ CODE:

Explanation:

#include <bits/stdc++.h>

using namespace std;

int countSubstringWithEqualEnds(string s)

{

int result = 0;

int n = s.length();

// Iterating through all substrings in

// way so that we can find first and last

// character easily

for (int i=0; i<n; i++)

for (int j=i+1; j<n; j++)

if (s[i] == s[j]) {

if(s[i] == 'A' || s[i] == 'T'){

result++;

for(int k=i;k<=j;k++){

cout << s[k];

}

cout << endl;

}

}

// result++;

return result;

}

// Driver function

int main()

{

string s;

cin >> s;

cout << "Total DFA matched strings::"<< countSubstringWithEqualEnds(s);

return 0;

}

***********************************************************************************************

OUTPUT:

You might be interested in
What is the letter for the trash directory on windows 10?
myrzilka [38]
It's usually in C: drive.
<span>C:\$Recycle.Bin
</span>But if you have several drives, there are Recycle Bins each drive.
3 0
3 years ago
Read 2 more answers
A multinational pharmaceutical company used a saffron trident in a promotional campaign for one of its drugs in India. The saffr
Vera_Pavlovna [14]
Answer : Encoding

Explanation : Encoding refers to correctly coding the message so that the receiver gets the clear message without feating any misunderstanding.
5 0
3 years ago
A set of programs that enable hardware to process data is
andreyandreev [35.5K]
C. the database as in the name is the base of everything.
8 0
4 years ago
A bakery sells three types of muffins whose prices are as follows: 1- blueberry muffin, $2.98 2- chocolate chip muffin, $4.50 an
andreev551 [17]

Explanation:

The menu is provided as given in the question. A while loop is used to keep getting input from the user until the user enters exit value 0. If elif commands are used to keep track of the respective muffins. Three counters are used to keep the count of each muffin and at the end the quantity of each muffin is multiplied with the price of each muffin then added together to get the total bill.

Python Code:

menu="""****************MENU*******************

Please select your muffins:      

Press 1 for blueberry muffin $2.98      

Press 2 for chocolate chip muffin $4.50

Press 3 for banana muffin $9.98        

Press 0 for exit!                

***************************************"""

print(menu)

blue=0

chock=0

banana=0

flag=0

while flag==0:

   inp=eval(input())

   if inp==1:

       blue+=1

       print("blueberry muffin added")

   elif inp==2:

       chock+=1

       print("chocolate muffin added")

   elif inp==3:

       banana+=1

       print("banana muffin added")

   elif inp==0:

       break

   else:

       print("invalid selection!")    

print("Your bill is: $",blue*2.98+chock*4.50+banana*9.98)

Output:

*******************MENU**********************

Please select your muffins:      

Press 1 for blueberry muffin $2.98      

Press 2 for chocolate chip muffin $4.50

Press 3 for banana muffin $9.98      

Press 0 for exit!

***************************************"*********

2

chocolate muffin added

3

banana muffin added

5

invalid selection!

1

blueberry muffin added

0

Your bill is: $ 17.46

7 0
4 years ago
What is the difference between a Computer Science and a Compter Engineer major?
xeze [42]

Answer:

Computer Science is the study of the existing things and programming language to acquire knowledge in that field

Computer engineering is applying the knowledge to invent new things

Explanation:

Computer Science is the study of the existing things and programming language to acquire knowledge in that field

Computer engineering is applying the knowledge to invent new things

If we want to accomplish any task , first you should know how to achieve that task and you should have some knowledge to do that task. Computer Science basically deals with acquiring knowledge in the are of computers.

Computer engineering is the engineering things based on the facts we have alreday

5 0
4 years ago
Other questions:
  • HELP!!!! I need this ASAP
    9·1 answer
  • If someone were unable to pay cash right now, which financing option would be best for the laptop and for the refrigerator?
    10·2 answers
  • What rule should be followed when determining how many bullets you will include on a slide
    8·2 answers
  • Given the following code fragment, how many times does the loop body execute? int laps = 50; int myNum = 1; do { myNum = myNum +
    9·1 answer
  • A speech why friends are important 2 min​
    11·1 answer
  • What is the advantage of video conferecing
    13·2 answers
  • How many bytes does a common processor require to represent an integer?
    7·1 answer
  • Have you ever watched Full House? Who is your favorite character and why? EXPLAIN AND ILL GIVE BRAINLIEST!
    12·1 answer
  • Which one of these is NOT an indicator that an email is spam?
    5·1 answer
  • Identify what algorithm or concept the following code relates to. void Sort(int array[], int tempArray[], int left, int right) {
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!