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
The first thing you should do is develop a ____________________ to determine what vehicle you can afford.
swat32

The first thing you should do is develop a <u>budget</u> to determine what vehicle you can afford.

<h3>What is an automobile?</h3>

An automobile is also referred to as a vehicle, car or motorcar and it can be defined as a four-wheeled vehicle that is designed and developed to be propelled by an internal-combustion (gasoline) engine, especially for the purpose of transportation from one location to another.

<h3>What is a budget?</h3>

A budget can be defined as a financial plan that is typically used for the estimation of revenue and expenditures of an individual, business organization or government for a specified period of time, often one year.

In this context, we can reasonably infer and logically deduce that the first thing anyone should do is to develop a <u>budget</u> in order to determine what vehicle they can afford.

Read more on budget here: brainly.com/question/13964173

#SPJ1

7 0
1 year ago
C++A palindrome is a string such as "madam", "radar", "Dad", and "I", that reads the same forwards and backwards. The empty stri
jeka57 [31]

Answer:

See explaination

Explanation:

#include <iostream>

#include<string.h>

using namespace std;

bool isPalindrome(string str, int lower, int upper){

if(str.length() == 0 || lower>=upper){

return true;

}

else{

if(str.at(lower) == str.at(upper)){

return isPalindrome(str,lower+1,upper-1);

}

else{

return false;

}

}

}

int main(){

string input;

cout<<"Enter string: ";

cin>>input;

if(isPalindrome(input,0,input.length()-1)){

cout<<input<<" is a palindrome"<<endl;

}

else{

cout<<input<<" is NOT a palindrome"<<endl;

}

return 0;

}

5 0
3 years ago
Stream Piracy – Kaaterskill, NY. Check and double-click the Problem 15 folder. The dark blue and orange streams highlight the pr
baherus [9]

Answer:

b. The pirating streams are eroding headwardly to intersect more of the other streams’ drainage basins, causing water to be diverted down their steeper gradients.

Explanation:

From the Kaaterskill NY 15 minute map (1906), this shows two classic examples of stream capture.

The Kaaterskill Creek flow down the east relatively steep slopes into the Hudson River Valley. While, the Gooseberry Creek is a low gradient stream flowing down the west direction which in turn drains the higher parts of the Catskills in this area.

However, there is Headward erosion of Kaaterskill Creek which resulted to the capture of part of the headwaters of Gooseberry Creek.

The evidence for this is the presence of "barbed" (enters at obtuse rather than acute angle) tributary which enters Kaaterskill Creek from South Lake which was once a part of the Gooseberry Creek drainage system.

It should be noted again, that there is drainage divide between the Gooseberry and Kaaterskill drainage systems (just to the left of the word Twilight) which is located in the center of the valley.

As it progresses, this divide will then move westward as Kaaterskill captures more and more of the Gooseberry system.

5 0
3 years ago
Investigating how slime molds reproduce is an example of applied research.<br> True<br> False
azamat

Answer:

false

Explanation:

3 0
3 years ago
Suppose a person (height of 1.8 m) walks in a room installed with a pyroelectric infrared (PIR) motion detector. The distance be
3241004551 [841]

Answer: b is your best option

Explanation:

8 0
3 years ago
Other questions:
  • 6.15. In an attempt to conserve water and to be awarded LEED (Leadership in Energy and Environmental Design) certification, a 20
    14·1 answer
  • The popularity of orange juice, especially as a breakfast drink, makes it an important factor in the economy of orange-growing r
    14·1 answer
  • Two well-known NP-complete problems are 3-SAT and TSP, the traveling salesman problem. The 2-SAT problem is a SAT variant in whi
    7·1 answer
  • A thermistor is a temperature‐sensing element composed of a semiconductor material, which exhibits a large change in resistance
    13·1 answer
  • Water is pumped from one large reservoir to another at a higher elevation. If the flow rate is 2.5 ft3 /s and the pump delivers
    12·1 answer
  • 9.21 A household oven door of 0.5-m height and 0.7-m width reaches an average surface temperature of 32℃ during operation. Estim
    8·1 answer
  • Hi. I would like to know why one side of an island can get more rain (more rain forms), while the other gets less.
    15·2 answers
  • Make a sketch of a simple mechanically expanded brake and indicate the forces ​ ​ acting on the leading shoe when the brake is a
    10·1 answer
  • What is another term for the notes that a reader can add to text in a word-processing document?
    11·2 answers
  • A company intends to market a new product and it estimates that there is a 20% chance that it will be first in the market
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!