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
Primary mental skills needed for riding a motorcycle
Irina-Kira [14]

Answer:

You have to know the basic mechanics to help you correctly use the motorcycle, and you also have to have the right mindset - knowing you can ride it, and having determination. All of these factors are the primary mental skills you need for riding a motorcycle.

5 0
2 years ago
A sum of $500,000 will be invested by a firm two years from now. If money is worth 12%, what will be the worth of this investmen
notka56 [123]

Answer:

investment 10 years from now is $1,238,000 .

Explanation:

given data

sum = $500,000

rate = 12% =0.12

total time = 10 year

solution

as present value After 2 years from now is $500,000

so time period is now = 8 year  ( 10 - 2 )

so we apply future value formula that is

Future value  = present value × (1+r)^{t}   ............1

put here value we get

Future value  = $500,000 × (1+0.12)^{8}  

Future value  = $500,000 × 2.476

Future value  = $1,238,000  

so investment 10 years from now is $1,238,000 .

8 0
3 years ago
Why might construction crews want to install pipes before the foundation is poured
Crazy boy [7]

The answer is choice C

Explanation:

As during construction ,the site is cleared for all debris before laying out the foundation. Even the sewer lines are dug out .

So it will be useful for the construction crews to  connect the pipes to the sewer lines before the foundation is poured.

But usually the steps take in construction activity is:- first the site is cleared for the foundation to be poured  and once the foundation wall is set , then all utilities , including plumbing and electrical activities are done.,

After this process is over, the city inspector comes to check whether the foundation has been laid down as per the code of construction.

Only after that the rest of the construction activity follows through.

3 0
3 years ago
Roads in rural areas are _______.
Roman55 [17]

Answer:

Explanation:

Mountain roads often zigzag across a mountain with a series of sharp turns called. switchbacks.

6 0
3 years ago
Read 2 more answers
Should aircraft wings have infinite stiffness?
Colt1911 [192]

Answer:

No, they need to be somewhat flexible so that forces such as turbulance don't shear the wing off.

3 0
3 years ago
Read 2 more answers
Other questions:
  • Why should engineers avoid obvious patterns?
    13·2 answers
  • Which of the following describes fibers? a)- Single crystals with extremely large length-to-diameter ratios. b)- Polycrystalline
    10·1 answer
  • A piston/cylinder contains 1.5 kg of water at 200 kPa, 150°C. It is now heated by a process in which pressure is linearly relate
    14·1 answer
  • Write a program that asks the user to input a vector of integers of arbitrary length. Then, using a for-end loop the program exa
    13·1 answer
  • 1 kg of oxygen is heated from 20 to 120°C. Determine the amount of heat transfer required when this is done during a (a) constan
    7·1 answer
  • g Asbestos is a fibrous silicate mineral with remarkably high tensile strength. But is no longer used because airborne asbestos
    5·1 answer
  • Why does my delivery date keep changing on my tesla model 3
    13·1 answer
  • Tech A says that it is best to use a knife or other type of sharp tool to cut away the insulation when
    7·1 answer
  • Given the inherent costs of regulation it is safe to say that there is always a negative economic impact associated with regulat
    7·1 answer
  • 2. The unthreaded part of a bolt or screw is called the
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!