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
Remy noticed that after oiling his skateboard wheels, it was easier to reach the speeds he needed to perform tricks. How did the
Sidana [21]

Answer:

The oil reduced friction between the moving parts of the skateboard. ( A )

Explanation:

The oil reduced Friction between the moving parts of the skateboard and this is because the reduction in friction between moving parts causes an increase in speed.

Remy will oil the moving parts that connects the wheels of the skateboard to the Board, because this is where the most friction is found. the friction between the wheels and the ground cannot be affected by oiling the wheels

4 0
3 years ago
1. You are asked to write a report about one of the structures that Transportation Engineers
aksik [14]

Answer:

ddition, please state if transportation engineers are involved with any other ... Please specify their specific roles and contributions in the execution of the ...

8 0
3 years ago
A composite shaft with length L = 46 in is made by fitting an aluminum sleeve (Ga = 5 x 10^3 ksi) over a
Xelga [282]

Answer:

Explanation:

Given the data in the question;

L = 46 in

Ga = 5 × 10³ ksi

Gs = 11 × 10³ ksi

Outside diameter da = 5 in

ds = 4 in

Tb = 3 kip.in

Now,

Ja = polar moment of Inertia of Aluminum;

Ja ⇒ π/32( 5⁴ - 4⁴ ) = π/32( 625 - 256 ) = π/32( 369 ) in^u

Js = polar moment of inertia of steel

Js ⇒ π/32 ds⁴ = π/32( 4⁴ ) = π/32( 256 )

Ta is torque transmitted by Aluminum  

Ts is torque transmitted by steel  

{composite member }

T = Ta + Ts ------ let this be equation m1

Now, we use the relation;

T/J = G∅/L

JG∅ = TL

∅ = TL/GJ

so, for aluminum rod ∅_{alu = TaLa/GaJa

for steel rod ∅_{steel = TsLs/GsJs

but we know that, ∅a = ∅s = ∅_B

so

[TaLa/GaJa]  =  [TsLs/GsJs]

also, we know that, La = Ls = L

∴ [Ta/GaJa]  =  [Ts/GsJs]

we solve for Ta

TaGsJs = TsGaJa  

Ta = TsGaJa / GsJs

we substitute

Ta = [Ts(5 × 10³)( π/32( 369) )] / [ (11 × 10³)( π/32( 256 ) ) ]

Ta = 0.66Ts

now, we substitute 0.66Ts for Ta and 3 for T in equation 1

T = Ta + Ts

3 = 0.66Ts + Ts

3 = 1.66Ts

Ts = 3 / 1.66

Ts = 1.8072 ≈ 1.81 kip-in

so

∅_{steel = TsLs / GsJs

we substitute

∅_{steel = (1.81 × 46 ) / ( 11 × 10³ × π/32( 256 ) )

∅_{steel = 83.26 / 276460.1535

∅_{steel  = 0.000301

∅_{steel = 3.01 × 10⁻⁴ rad

so

∅_{steel = ∅_B = 3.01 × 10⁻⁴ rad

Therefore, the magnitude of the angle of twist at end B is 3.01 × 10⁻⁴  rad

5 0
3 years ago
Calculate the density of the FCC nickel lattice with an interstitial hydrogen in the centered position of the unit cell. You may
Anastaziya [24]

Answer:

\rho=8907.94\ Kg/m^3

Explanation:

Given that

a=3.524 A

At.Wt. ,M= 58.7 g/mole,

 For FCC

 Z = 4

4r=\sqrt2\ a

The density given as

\rho=\dfrac{ZM}{N_Aa^3}

\rho=\dfrac{4\times 58.7\times 10^{-3} }{ 6.023\times 10^{23}\times (3.524\times 10^{-10})^3}

\rho=8907.94\ Kg/m^3

So the density is \rho=8907.94\ Kg/m^3

4 0
3 years ago
The following median grain size data were obtained during isothermal liquid phase sintering of an 82W-8Mo-8Ni-2Fe alloy. What is
Morgarella [4.7K]

Answer:

The probable grain-coarsening mechanism is : Ideal grain growth mechanism

( d^{2}- d_{0} ^{2} = kt )

Explanation:

The plot attached below shows the time dependence of the growth of grain.

The probable grain-coarsening mechanism is : Ideal grain growth mechanism

the ideal growth follows this principle = d^{2} - d^{2} _{0}  = kt

d = final grain size

d_{0} = initial grain size

k = constant ( temperature dependent )

t = 0

8 0
3 years ago
Other questions:
  • a 120 volt,13 watts fluorescent light bulb is operated from 6pm until 10pm every day the cost per kilo watt hour is $0.07. what
    11·1 answer
  • What is the first step in the problem-solving process, as well as in the engineering design process?
    7·1 answer
  • Is it more difficult to pump oil from a well on dry land or a well under water?Why?
    11·1 answer
  • A contractor needs to excavate 50,000 yd3 of silty clay and haul it with Caterpillar 69C dump trucks. Each truck can carry 30.9
    13·1 answer
  • You are given a C program "q2.c" as below. This program is used to calculate the average word length for a sentence (a string in
    5·1 answer
  • Parallel circuits???
    9·1 answer
  • For laminar flow of air over a flat plate that has a uniform surface temperature, the curve that most closely describes the vari
    15·1 answer
  • How does science and technology address the problems of the society?
    6·2 answers
  • Technician A says the compressor is the dividing line of the refrigeration system, low- to high-side. Technician B says the expa
    6·1 answer
  • How many and what type of<br> receptacles are connected to<br> this circuit?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!