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
All MOS devices are subject to damage from:________
Alchen [17]

Answer:

  d. all of these

Explanation:

Electrostatic discharge will generally produce excess voltage in a local area that results in excessive current and excessive heat. It will blast a crater in an MOS device, or melt bond wires, or cause damage of other sorts. In short, MOS devices are subject to damage from "all of these."

6 0
3 years ago
I am trying to make a vacuum cannon but all I can use to get out the air is a speed pump to give air to bicycles. I need to make
Mrrafil [7]

We can actually deduce here that making a airtight seal will take different format. You can:

  • Use an epoxy-resin to create an airtight seal
  • Create a glass-metal airtight seal
  • Make a ceramic-metal airtight seal.

<h3>What is an airtight seal?</h3>

An airtight seal is actually known to be a seal or sealing that doesn't permit air or gas to pass through. Airtight seal are usually known as hermetic seal. They are usually applied to airtight glass containers but the advancement in technology has helped to broaden the materials.

We can see that epoxy-resin can used to create an airtight seal. They create airtight seals to copper, plastics, stainless steels, etc.

When making glass-metal airtight seal, the metal should compress round the solidified glass when it cools.

Learn more about airtight seal on brainly.com/question/14977167

#SPJ1

6 0
1 year ago
Using OOP, write a C++ program that will read in a file of names. The file is called Names.txt and should be located in the curr
Tanzania [10]
Not really sure sorry for not being able to help
5 0
2 years ago
Read 2 more answers
All of the dimensions on an aircraft drawing are_________<br> to the bottom of the drawing.
Jet001 [13]
All of the dimensions on an aircraft drawing are _________ to the bottom of the drawing


Answer: parallel
7 0
2 years ago
Liquefied Natural Gas (LNG) is a natural gas in its liquid form that is clear, colorless, odorless, non-corrosive, and non-toxic
ZanzabumX [31]

Liquefied Natural Gas (LNG) can be defined as a natural gas which in liquid form appear clear and colorless. It is odorless, non-toxic, and non-corrosive. Therefore, the given statement is A) True.

  • LNG or Liquified Natural Gas is a fossil fuel that is produced after the compression of organic matter in the form of algae and phytoplankton.
  • LNG consists of 95% methane gas.
  • The combustion of LNG produces carbon dioxide and water vapors.
  • It burns with a least pollution thus called as cleanest fossil fuel.
  • The liquefaction of the natural gas takes place at -160 degree Celsius. The liquefaction of the gas causes it to transport easily in gas tanks.
  • LNG is colorless, and clear.
  • LNG does not possess any smell and it is non-corrosive to metallic tanks.
  • LNG is also non-toxic.

Learn more about natural gas:

brainly.com/question/12200462

6 0
2 years ago
Other questions:
  • The temperature of a flowing gas is to be measured with a thermocouple junction and wire stretched between two legs of a sting,
    8·1 answer
  • A turbine produces shaft power from a gas that enters the turbine with a (static) temperature of 628 K, a velocity of 143 m/s an
    7·1 answer
  • Thermosetting polymers are polymers that becomes soft and pliable when heated. ( True , False )
    8·2 answers
  • Thermal energy storage systems commonly involve a packed bed of solid spheres, through which a hot gas flows if the system is be
    13·1 answer
  • For a copper-silver alloy of composition 25 wt% Ag-75 wt% Cu and at 775°C (1425°F) do the following:
    15·1 answer
  • What is meant by the thickness to chord ratio of an aerofoil?
    12·1 answer
  • One employee was climbing a metal ladder to hand an electric drill to the journeyman installer on a scaffold about five feet abo
    9·1 answer
  • (100 POINTS) {BRIANLIEST} PLEASE HELP ME
    5·1 answer
  • Con que otro nombre se le conoce a los delitos informaticos
    5·1 answer
  • Wells drilled by a nonprofit called Water for South Sudan use a pump that can provide up to 5,500 gallons of water per day. Use
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!