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
Write a program to control the operation of the RED/GREEN/BLUE LED (LED2) as follows: 1. If no button is pressed, the LED should
aalyn [17]

Answer:

See explaination

Explanation:

int RED=10; int BLUE=11; int GREEN=12; int BUTTON1=8; int BUTTON2=9; void setup() { pinMode(RED, OUTPUT); pinMode(BLUE, OUTPUT); pinMode(GREEN, OUTPUT); pinMode(BUTTON1, INPUT); pinMode(BUTTON2, OUTPUT); } void loop() { int BTN1_STATE=digitalRead(BUTTON1); int BTN2_STATE=digitalRead(BUTTON2); if(BTN1_STATE==HIGH) { digitalWrite(BLUE, HIGH); delay(1000); // Wait for 1 second digitalWrite(BLUE, LOW); } if(BTN2_STATE==HIGH) { digitalWrite(RED, HIGH); delay(4000); // Wait for 4 seconds digitalWrite(RED, LOW); } if(BTN1_STATE==HIGH && BTN2_STATE==HIGH) { digitalWrite(GREEN, HIGH); delay(2000); // Wait for 2 second digitalWrite(GREEN, LOW); } }

4 0
2 years ago
If a motorist moves with a speed of 30 km/hr, and covers the distance from place A to place B
Sergio039 [100]

Answer:

105 km

Explanation:

The motorist was going 30 km/hr, and it took 3 hours 30 minutes. That's 3.5 hours. 3.5×30=105

5 0
3 years ago
How to code the round maze in CoderZ?
dlinn [17]

Answer:

hola

Explanation:

5 0
2 years ago
Using the results of the Arrhenius analysis (Ea=93.1kJ/molEa=93.1kJ/mol and A=4.36×1011M⋅s−1A=4.36×1011M⋅s−1), predict the rate
uysha [10]

Answer:

k = 4.21 * 10⁻³(L/(mol.s))

Explanation:

We know that

k = Ae^{-E/RT} ------------------- euqation (1)

K= rate constant;

A = frequency factor = 4.36 10^11 M⁻¹s⁻¹;

E = activation energy = 93.1kJ/mol;

R= ideal gas constant = 8.314 J/mol.K;

T= temperature = 332 K;

Put values in equation 1.

k = 4.36*10¹¹(M⁻¹s⁻¹)e^{[(-93.1*10^3)(J/mol)]/[(8.314)(J/mol.K)(332K)}

k = 4.2154 * 10⁻³(M⁻¹s⁻¹)

here M =mol/L

k = 4.21 * 10⁻³((mol/L)⁻¹s⁻¹)

 or

k = 4.21 * 10⁻³((L/mol)s⁻¹)

or

k = 4.21 * 10⁻³(L/(mol.s))

3 0
2 years ago
Do plastic materials have high or low ductility? Explain why.​
Flura [38]
The impact behavior of plastic materials is strongly dependent upon the temperature. At high temperatures, materials are more ductile and have high impact toughness. At low temperatures, some plastics that would be ductile at room temperature become brittle.
3 0
2 years ago
Other questions:
  • 9 b. A sign (including the post and base) weighs 40 pounds and is
    8·1 answer
  • A hanging wire made of an alloy of nickel with diameter 0.19 cm is initially 2.8 m long. When a 59 kg mass is hung from it, the
    15·1 answer
  • One type of illumination system consists of rows of strip fluorescents and a ceiling that will transmit light. For this system t
    15·1 answer
  • If you add 10 J of heat to a system so that the final temperature of the system is 200K, what is the change in entropy of the sy
    9·1 answer
  • Sam constructs a circuit, connects a lead acid battery of 2 V to a lamp of resistance 3 Ω and places an ammeter across it. What
    8·2 answers
  • Please help! timed test. This about electrical control. Please be serious.
    15·1 answer
  • How do you build a house.
    15·1 answer
  • your friend's parents are worried about going over their budget for th month. Which expense would you suggest is NOT a need?
    9·1 answer
  • Respond with TRUE if the symbol of the valve shown belows
    5·1 answer
  • Do better then me......................................
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!