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
Naya [18.7K]
3 years ago
11

In part A you are asked to write the pseudocode for the program. In part B you are asked to write the syntax of the code for the

program you outlined in the pseudocode.
Program requirements:
(a) Accepts the user response to the prompt "What is your favorite quote from a book?"
(b) Accepts the user repsonse to the prompt "What book was that quote from?"
(c) Accepts the user reponse to the prompt "What page was that quote from?"
(d) Count the number of upper case letters
(e) Count the total number of characters
(f) Dispaly "This includes 'dog' in the quote" if the quote includes the three characters to form the series of characters 'dog' any place in the quote.
(g) Use a loop
(h) Print the total number of characters
Engineering
1 answer:
Naya [18.7K]3 years ago
3 0

Answer:

C++.

Explanation:

#include <iostream>

#include <string>

using namespace std;

///////////////////////////////////////////////////////////////

int main() {

   string quote, book;

   int page;

   

   cout<<"What is your favorite quote from a book?"<<endl;

   getline(cin, quote);

   cout<<endl;

   /////////////////////////////////////////////

   cout<<"What book was that quote from?"<<endl;

   getline(cin, book);

   cout<<endl;

   /////////////////////////////////////////////

   cout<<"What page was that quote from?"<<endl;

   cin>>page;

   cout<<endl;

   /////////////////////////////////////////////

   int no_of_upper_characters = 0;

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

       if (isupper(quote[i]))

          no_of_upper_characters++;

   }

   

   cout<<"No. of upper case characters: "<<no_of_upper_characters<<endl;

   /////////////////////////////////////////////

   int no_of_characters = quote.length();

   cout<<"No. of characters: "<<no_of_characters<<endl;

   /////////////////////////////////////////////

   bool isDog = false;

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

       if (isDog == true)

           break;

       else if (quote[i] == 'd') {

           for (int j=i+1; j<quote.length(); j++) {

               if (isDog == true)

                   break;

               else if (quote[j] == 'o') {

                   for (int z=j+1; z<quote.length(); z++) {

                       if (quote[z] == 'g') {

                           isDog = true;

                           break;

                       }

                   }

               }

           }

       }

   }

   

   if (isDog == true)

       cout<<"This includes 'd' 'o' 'g' in the quote";

   //////////////////////////////////////////////

   return 0;

}

You might be interested in
2 Air enters the compressor of a cold air-standard Brayton cycle at 100 kPa, 300 K, with a mass flow rate of 6 kg/s. The compres
lutik1710 [3]
You can see and download from the link

https://tlgur.com/d/GYYVL5lG

Please don't forget to put heart ♥️
5 0
2 years ago
1. True/False The Pressure Relief valve maintains the minimum pressure in the hydraulic circuit​
elena55 [62]
Yeah it’s true. Good luck!!
3 0
3 years ago
A steam power plant is represented as a heat engine operating between two thermal reservoirs at 800 K and 300 K. The temperature
Sergeeva-Olga [200]
Yeet is the answer .....
4 0
2 years ago
A body weighs 50 N and hangs from a spring with spring constant of 50 N/m. A dashpot is attached to the body. If the body is rai
lbvjy [14]

Answer:

a) 3.607 m

b) 1.5963 m

Explanation:

See that attached pictures for explanation.

3 0
3 years ago
What was the role of the rotors in the enigma machine?.
Lisa [10]

Answer:

Implements a reordering of the letters of the alphabet.

Explanation: GIVE ME 5 STARS AND a HEART!!!                                      Those contacts are wired across the rotor so that each contact on the left connects to the contact on the right in some scrambled arrangement. Each rotor, therefore, implements a reordering of the letters of the alphabet, which mathematicians call a permutation.

3 0
2 years ago
Other questions:
  • This problem demonstrates aliasing. Generate a 512-point waveform consisting of 2 sinusoids at 200 and 400-Hz. Assume a sampling
    8·1 answer
  • 1. What is an op-amp? List the characteristics of an ideal op-amp
    11·1 answer
  • Bulk wind shear is calculated by finding the vector difference between the winds at two different heights. Using the supercell w
    12·1 answer
  • A three-phase transformer bank consists of 3 single-phase transformers to handle 400 kVA witha 34.5kV/13.8kV voltage ratio. Find
    7·1 answer
  • Suppose that we have a 1000 pF parallel-plate capacitor with air dielectric charged to 1000 V. The capacitors terminals are open
    13·1 answer
  • A hollow pipe is submerged in a stream of water so that the length of the pipe is parallel to the velocity of the water. If the
    9·1 answer
  • Use superpositions find​
    8·1 answer
  • Are there engineering students here?​
    5·2 answers
  • Choose the correct word or phrase to complete the sentence to explain human intervention in a machine system.
    13·1 answer
  • Pls answer and I will give a like!
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!