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
Hatshy [7]
3 years ago
8

Read a 4 character number. Output the result in in the following format, Input 9873, Output 3 *** 7 ******* 8 ******** 9 *******

** If one of the numbers is not a digit, then put a ? mark Input = 98a3, Output 3 *** a ? 8 ******** 9 ********* Prompt the user before the input with, cout<<"Create a histogram chart."<
Engineering
1 answer:
Rus_ich [418]3 years ago
4 0

Answer:

#include <iostream>

using namespace std;

int main()

{

 char numbers[4];

 

 cout<<"Create a histogram chart."<<endl;

 cout<<"Enter your number as 4 characters: ";

 

 cin >> numbers;

 

 for (int i=3; i>=0; i--) {

   int ascii_value = numbers[i];

   int number = numbers[i] - '0';

   

   if (ascii_value >=48 && ascii_value <=57) {

       cout << number;

       

       for (int j=number-1; j>=0; j--) {

           cout << "*";    

       }

   }

   else {

       cout << "a ?";    

   }

   

   cout << endl;

 }

}



Explanation:

Declare a character array with length 4,

Ask user to enter values,

Create a nested for loop; first loop <u>holds the values and their ASCII values for each character</u>,

<u>Check the ASCII values</u> for each character, if they are <u>between 48 and 57</u>, that means they are numbers. In this case, print the number and go to the inner loop and print the stars accordingly,

If ASCII values are not in the range, print a ?,

Go to the new line after each character

You might be interested in
A heated plate is built into the wall of a large room. The room is maintained at 300 K. The exposed surface of the plate is main
myrzilka [38]

Answer:

B

Explanation:

7 0
3 years ago
Air enters a turbine operating at steady state at 440 K, 20 bar, with a mass flow rate of 6 kg/s, and exits at 290 K, 5 bar. The
marysya [2.9K]

Answer:

The rate of heat transfer is - 935.392 kW

Explanation:

Given;

inlet pressure, P₁ = 20 bar

inlet temperature, T₁ = 440 k

outlet pressure, P₂ = 5 bar

outlet temperature, T₂ = 290 k

inlet velocity, v₁ = 18 m/s

outlet velocity, v₂ = 30 m/s

mass flow rate, Q = 6kg/s

developed power, W = 815 kW

From steam table;

at P₁ and T₁, interpolating between T = 400 and T = 450, h₁ = 3335.52 kJ/kg

at P₂ and T₂, interpolating between T= 250 and T= 300, h₂ = 3043.5 kJ/kg

Applying steady state energy balance equation;

\frac{Q}{m} -\frac{W}{m} = h_2-h_1 +\frac{1}{2} (v_2{^2} -v_1{^2})\\\\\frac{Q}{m} = h_2-h_1 +\frac{1}{2} (v_2{^2} -v_1{^2}) +\frac{W}{m}

substitute values above into this equation and evaluate the rate of heat transfer

\frac{Q}{m} = h_2-h_1 +\frac{1}{2} (v_2{^2} -v_1{^2}) +\frac{W}{m}\\\\\frac{Q}{m}  = 3043.5 - 3335.52 +\frac{1}{2000} (30{^2} -18{^2}) + \frac{815}{m} \\\\\frac{Q}{m}  = -291.732 + \frac{815}{m}\\\\\frac{Q}{m}  = \frac{815}{m}  -291.732\\\\Q = 815 - m(291.732)\\Q = 815 - 6*291.732\\\\Q = 815-1750.392 = -935.392 \ kW

Therefore, the rate of heat transfer, in kW, for a control volume enclosing the turbine is - 935.392 kW

4 0
3 years ago
Wyatt is handling the urban design of an area. He ensures that there are speed bumps and traffic lights on roads. Which activity
Whitepunk [10]

The activity in urban design is Wyatt ensuring is  C.traffic calming.

<h3>What is the motive of site traffic calming measures?</h3>

The motive of site visitor's calming measures is to gradual down fast-transferring site visitors to a velocity greater appropriate for the place they may be entering. These measures are generally located in rural regions at the access factors to cities or villages.

Traffic calming is an aggregate of in particular bodily measures that lessen the poor consequences of motor car use, modify motive force conduct and enhance situations for non-motorized road users. It can lessen the velocity of motors however its impact is minimum for 2 wheeler.

Read more about the traffic calming:

brainly.com/question/389792

#SPJ1

8 0
1 year ago
Which step in the reverse-engineering process involves the identification of subsystems and their relationship to one another?
creativ13 [48]

The answer is analyze

7 0
3 years ago
A spherical balloon is filled with a gas. The outer diameter of the balloon is 20 in. and the thick-ness is 0.012 in. Calculate
coldgirl [10]

Answer:

1.4 psi

Explanation:

Before diving into the solution to the question above, let's pick out the parameters needed in solving this problem from the question.

=> The measurement for the outer diameter of the balloon = 20 inches, the measurement for the thickness =  0.012 in,  the allowable tensile stress = 1ksi and the allowable shear stress in the balloon =  0.3 ksi.

The first thing to determine is the inner diameter = 20 - 2 ×  0.012 in = 19.976 in.

Therefore, the tensile stress:

1000 = k × [19.976/2]÷ 2 × 0.012 = 2.4 psi.

Also, the sheer stress which is also the maximum permissible pressure in the balloon can be calculated below as:

0.3 × 1000 = k × [19.976/2]/ 4 × 0.012 = 1.4 psi.

4 0
3 years ago
Other questions:
  • I want a problems and there solutions of The inception of cavitation?​
    7·1 answer
  • A gasoline engine takes in air at 290 K, 90 kPa and then compresses it. The combustion adds 1000 kJ/kg to the air after which th
    15·1 answer
  • I = 48 mA, R = 1125 2. What is Vs ?
    14·1 answer
  • An experimental arrangement for measuring the thermal conductivity of solid materials involves the use of two long rods that are
    8·1 answer
  • Air at a pressure of 6000 N/m^2 and a temperature of 300C flows with a velocity of 10 m/sec over a flat plate of length 0.5 m. E
    7·1 answer
  • I will mark as brainliest !
    10·1 answer
  • Describe the engineering design process in your own words.
    6·2 answers
  • A metal alloy has been tested in a tensile test with the following results for the flow curve
    6·1 answer
  • A 50-mm cube of the graphite fiber reinforced polymer matrix composite material is subjected to 125-kN uniformly distributed com
    14·1 answer
  • A single-phase load is located 2800 ft from its source. The load draws a current of 86 A and operates on 480 V. The maximum volt
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!