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
Entrence is one of the animation category​
krek1111 [17]

Answer:Videos

Video result for entrance is one of the animation category​

PREVIEW

3:31

Choosing a style of entrance animation effects | Microsoft ...

Jun 7, 2015

Video result for entrance is one of the animation category​

PREVIEW

4:23

Video: Animate text - PowerPoint

Microsoft Support

View all

Explanation:

3 0
3 years ago
Why efficiency of gas turbines are lower than combustion engine​
xxTIMURxx [149]
The performance of power plants at partial load has become a significant operational consideration for electric power grids worldwide. This technical comparison examines the range of output and the part load efficiency of combustion engines and gas turbines, and how Wärtsilä power plants deliver enhanced flexibility.
7 0
3 years ago
Read 2 more answers
An engine indicator is used to determine the following: (a) speed (d) m.e.p, and IHP (e) BHP (b) temperature (c) volume of cylin
Greeley [361]

Answer:

Option (d) MEP and IHP

Explanation:

MEP stands for Mean Effective Pressure and IHP stands for Indicated Horse Power

In engines (Internal Combustion), engine indicator is generally to indicate the indicate the changes in pressure inside the cylinder of an Internal Combustion Engine or IC engines. Once, Mean Effective Pressure of the engine is calculated it further helps to calculate the Horse power and both these quantities, i.e., MEP and IHP are displayed on the engine indicator.

8 0
3 years ago
What friction rate should be used to size a duct for a static pressure drop of 0.1 in wc if the duct has a total equivalent leng
skad [1K]

Answer:

0.067wc

Explanation:

The formula is actual static pressure loss = (total equivalent divided by 100) multiplied by rate of friction

We substitute values

actual static pressure = 0.1

Total equivalent length = 150 ft

0.1 = (150ft/100) multiplied by Rate of friction

Friction rate at 100ft = 0.067

So we have that the required friction needed is 0.067wc

6 0
3 years ago
Why is it important to review your plan when you write an algorithm?
user100 [1]
An algorithm is itself a general step-by-step solution of your problem. ... The most important point here is that you must use algorithms to solve problem, one way or the other. Most of the time it's better to think about your problem before you jump to coding - this phase is often called design.
7 0
3 years ago
Other questions:
  • Which of the following materials is created by a natural, eco-friendly process, is a renewable resource, and is a primary buildi
    11·2 answers
  • A quantity of water within a piston-cylinder assembly executes a Carnot power cycle. During isothermal expansion, the water is h
    10·1 answer
  • 1. Describe the basic principle of operation of a bipolar junction transistor including
    13·1 answer
  • I can’t find the code
    12·1 answer
  • 5. Identify the pros and cons of<br> manufactured siding.
    12·1 answer
  • Q.17) A 50-acre catchment containing cropland is converted ot a Qatar mail
    13·1 answer
  • three people in the round field, the first person is walking slowly, the second is walking meduim and the last is fast
    10·1 answer
  • Please help and thank u so much
    6·1 answer
  • Would anyone be able to tell me what this is? it's for a water pump​
    13·1 answer
  • A service station has 10 employees who are responsible for checking in customers who bring their cars in to be serviced. The emp
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!