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
An ideal reheat Rankine cycle with water as the working fluid operates the boiler at 15,000 kPa, the reheater at 2000 kPa, and t
solniwko [45]

Answer:

See the explanation below.

Explanation:

First find the enthalpies h₁, h₂, h₃, h₄, h₅, and h₆.

Find h₁:

Using Saturated Water Table and given pressure p₁ = 100 kPa

h₁ = 417.5 kJ/kg

Find h₂:

In order to find h₂, add the w_{p} to h₁, where  w_{p}  is the work done by pump and h₁ is the enthalpy computed above h₁ = 417.5 kJ/kg.

But first we need to compute  w_{p} To computer  

Pressures:

p₁ = 100 kPa

p₂ = 15,000 kPa

and

Using saturated water pressure table, the volume of water v_{f} = 1.0432

Dividing 1.0432/1000 gives us:

Volume of water = v₁ =  0.001043 m³/kg

Compute the value of h₂:

h₂ = h₁ + v₁ (p₂ - p₁)

    = 417.5 kJ/kg + 0.001043 m³/kg ( 15,000 kPa - 100 kPa)

    =  417.5 + 0.001043 (14900)

    = 417.5 + 15.5407

    = 433.04 kJ/kg

Find h₃  

Using steam table:

At pressure p₃ = 15000 kPa

and Temperature = T₃ = 450°C

Then h₃ = 3159 kJ/kg

The entropy s₃ = 6.14 kJ/ kg K

Find h₄

Since entropy s₃ is equal to s₄ So

s₄ = 6.14 kJ/kgK

To compute h₄

s₄ = s_{f} + x_{4} s_{fg}

x_{4} = s_{4} -s_{f} /s_{fg}

x_{4} = 6.14 -  2.45 / 3.89

x_{4}   = 0.9497

The enthalpy h₄:

h₄ = h_{f} +x_{4} h_{fg}

    = 908.4 + 0.9497(1889.8)

    =  908.4 + 1794.7430

    = 2703 kJ/kg

This can simply be computed using the software for steam tables online. Just use the entropy s₃ = 6.14 kJ/ kg K and pressure p₄ = 2000 kPa

Find h₅

Using steam table:

At pressure p₅ = 2000 kPa

and Temperature = T₅ = 450°C

Then h₅  = 3358 kJ/kg

Find h₆:

Since the entropy s₅ = 7.286 kJ/kgK is equal s₆ to  So

s₆ = 7.286 kJ/kgK = 7.29 kJ/kgK

To compute h₆

s₆ = s_{f} + x_{6} s_{fg}

x_{6} = s_{6} -s_{f} /s_{fg}

x_{6} = 7.29 - 1.3028 / 6.0562

x_{6}   = 0.988

The enthalpy h₆:

h₆ = h_{f} +x_{6} h_{fg}

    = 417.51 + 0.988 (2257.5)

    = 417.51 + 2230.41

  h₆ =  2648 kJ/kg

This can simply be computed using the software for steam tables online. Just use the entropy s₅ = 7.286 kJ/kgK and pressure p₅ = 2000 kPa

Compute power used by pump:

P_{p} is found by using:

mass flow rate = m =  1.74 kg/s

Volume of water = v₁ =  0.001043 m³/kg

p₁ = 100 kPa

p₂ = 15,000 kPa

P_{p}  = ( m ) ( v₁ ) ( p₂ - p₁ )

     = (1.74 kg/s) (0.001043 m³/kg) (15,000 kPa - 100 kPa)

     = (1.74 kg/s) (0.001043 m³/kg) (14900)

     = 27.04

P_{p} = 27 kW

Compute heat added q_{a} and heat rejected q_{r}  from boiler using computed enthalpies:

q_{a} = ( h₃ - h₂ ) + ( h₅ - h₄ )

      = ( 3159 kJ/kg - 433.04 kJ/kg ) + ( 3358 kJ/kg - 2703 kJ/kg )

      = 2726 + 655

      = 3381  kJ/kg

q_{r} =  h₆ - h₁

  = 2648 kJ/kg - 417.5 kJ/kg

  = 2232 kJ/kg

Compute net work

W_{net} = q_{a} - q_{r}

       = 3381  kJ/kg - 2232 kJ/kg

       = 1150 kJ/kg

Compute power produced by the cycle

mass flow rate = m =  1.74 kg/s

W_{net} = 1150 kJ/kg

P = m * W_{net}

  = 1.74 kg/s * 1150 kJ/kg

  = 2001 kW

Compute rate of heat transfer in the reheater

Q = m * ( h₅ - h₄ )

   =  1.74 kg/s * 655

   =  1140 kW

Compute Thermal efficiency of this system

μ_{t} = 1 - q_{r} /  q_{a}

   = 1 - 2232 kJ/kg / 3381  kJ/kg

   = 1 - 0.6601

   = 0.34

   = 34%

7 0
3 years ago
Calculate the molar heat capacity of a monatomic non-metallic solid at 500K which is characterized by an Einstein temperature of
aleksandr82 [10.1K]

Answer:

Explanation:

Given

Temperature of solid T=500\ K

Einstein Temperature T_E=300\ K

Heat Capacity in the Einstein model is given by

C_v=3R\left [ \frac{T_E}{T}\right ]^2\frac{e^{\frac{T_E}{T}}}{\left ( e^{\frac{T_E}{T}}-1\right )^2}

e^{\frac{3}{5}}=1.822

Substitute the values

C_v=3R\times (\frac{300}{500})^2\times (\frac{1.822}{(1.822-1)^2})

C_v=3R\times \frac{9}{25}\times \frac{1.822}{(0.822)^2}

C_v=0.97\times (3R)            

6 0
3 years ago
A seamless pipe carries 2400m³ of steam per hour at a pressure of 1.4N/mm².The velocity of flow is 30m/s.assuming the tensile st
MatroZZZ [7]

Answer:

yessss

Explanation:

7 0
2 years ago
Given a matrix, clockwise-rotate elements in it. Please add code to problem3.cpp and the makefile. Use the code in p3 to test yo
rusak2 [61]

Answer:

/* C Program to rotate matrix by 90 degrees */

#include<stdio.h>

int main()

{

int matrix[100][100];

int m,n,i,j;

printf("Enter row and columns of matrix: ");

scanf("%d%d",&m,&n);

 

/* Enter m*n array elements */

printf("Enter matrix elements: \n");

for(i=0;i<m;i++)

{

 for(j=0;j<n;j++)

 {

  scanf("%d",&matrix[i][j]);

 }

}

 

/* matrix after the 90 degrees rotation */

printf("Matrix after 90 degrees roration \n");

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

{

 for(j=m-1;j>=0;j--)

 {

  printf("%d  ",matrix[j][i]);

 }

 printf("\n");

}

 

return 0;

 

}

5 0
3 years ago
I need ideas for what to build because I have some spare wood.
Misha Larkins [42]

Answer:

small guitar with no strings?

Explanation:

it would be fun to make i think

6 0
3 years ago
Other questions:
  • Which of the following statements do not correctly describe pull manufacturing? (1). Material flow is determined by the need of
    8·1 answer
  • I need solution for this question please<br>Select the right answer ​
    8·2 answers
  • Please read
    6·1 answer
  • Pascal's law tells us that, pressure is transmitted undiminished throughout an open container. a)- True b) False
    9·1 answer
  • The value of the critical Reynolds number for the flow over a flat plate is 5 x10^5. The significance of the value is:
    13·1 answer
  • A multilane highway (two lanes in each direction) is on level terrain. The free-flow speed has been measured at 45 mi/h. The pea
    5·1 answer
  • You are using a Geiger counter to measure the activity of a radioactive substance over the course of several minutes. If the rea
    8·1 answer
  • The guy wires AB and AC are attached to the top of the transmission tower. The tension in cable AB is 8.7 kN. Determine the requ
    8·1 answer
  • A Carnot heat engine absorbs 235 KW of heat from a heat source and rejects 164 KW to the atmosphere. Determine the thermal effic
    7·1 answer
  • 11. What are restrictions when building or completing a challenge?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!