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
mixas84 [53]
4 years ago
7

Given two input integers for an arrowhead and arrow body, print a right-facing arrow. Ex: If the input is: 0 1 the output is: 1

11 00000111 000001111 00000111 11 1
Engineering
1 answer:
Ivahew [28]4 years ago
5 0

Answer:

The code for development of this kind of arrowhead and arrow body as given in example is as below.

Explanation:

Assumptions

  • Assuming the language required is C++. As the basic outlook is similar, the syntax of specific language can be varied.
  • Here 1 is used as the second digit in example. It can be replaced with any other digit depending on the input from the user.
  • The concept of function is used which will be called back whenever required.

The basic definition of the code is such that the essential number of spaces, zeros and ones are estimated accurately

Code

<em>#include<iostream></em>

<em>using namespace std;</em>

//Defining the function as arrow with inputs as x and y integer with no output.

void arrow(int x, int y);

int main() //main function where the main code is present.

{  

  //So variables are initialized

  int x,y;

  //get input from the user via keyboard.

  cout<<"Enter Two Integers: \n";

  cin>>x>>y; //storing integers as x and y.

  //Displaying extra line at command window to get clear figure of arrow

  cout<<"\n\n\n\n";

  //Calling function to draw arrow

  arrow(x,y);

  return 0;

}

void arrow(int x, int y)

{  

  //1st line has  2 spaces and 1 second input number

  cout<<" "<<" "<<y<<endl;

  //2nd line -- 2 spaces and 2 second input number

  cout<<" "<<" "<<y<<y<<endl;

  //3rd line -- 5 first input and 3 second input number

  cout<<x<<x<<x<<x<<x<<y<<y<<y<<endl;

  //4th line -- 5 first input and 4 second input number

  cout<<x<<x<<x<<x<<x<<y<<y<<y<<y<<endl;

  //5th line -- 5 first input and 3 second input number

  cout<<x<<x<<x<<x<<x<<y<<y<<y<<endl;

  //6th line -- 2 spaces and 2 second input number

  cout<<" "<<" "<<y<<y<<endl;

  //7th line -- 2 spaces 1 second input number

  cout<<" "<<" "<<x<<endl;

}

You might be interested in
Steep safety ramps are built beside mountain highway to enable vehichles with fedective brakes to stop safely. a truck enters a
Veronika [31]

Answer:

a. 6 seconds

b. 180 feet

Explanation:

Images attached to show working.

a. You have the position of the truck so you integrate twice. Use the formula and plug in the time t = 7 sec. Check out uniform acceleration. The time at which the truck's velocity is zero  is when it stops.

b. Determine the initial speed. Plug in the time calculated in the previous step. From this we can observe that the truck comes to a stop before the end of the ramp.

7 0
3 years ago
An air-standard Diesel cycle engine operates as follows: The temperatures at the beginning and end of the compression stroke are
Vika [28.1K]

This question is incomplete, the complete question is;

An air-standard Diesel cycle engine operates as follows: The temperatures at the beginning and end of the compression stroke are 30 °C and 700 °C, respectively. The net work per cycle is 590.1 kJ/kg, and the heat transfer input per cycle is 925 kJ/kg. Determine the a) compression ratio, b) maximum temperature of the cycle, and c) the cutoff ratio, v3/v2.

Use the cold air standard assumptions.

Answer:

a) The compression ratio is 18.48

b) The maximum temperature of the cycle is 1893.4 K

c) The cutoff ratio, v₃/v₂ is 1.946

Explanation:

Given the data in the question;

Temperature at the start of a compression T₁ = 30°C = (30 + 273) = 303 K

Temperature at the end of a compression T₂ = 700°C = (700 + 273) = 973 K

Net work per cycle W_{net = 590.1 kJ/kg

Heat transfer input per cycle Qs = 925 kJ/kg

a) compression ratio;

As illustrated in the diagram below, 1 - 2 is adiabatic compression;

so,

Tγ^{Y-1 = constant { For Air, γ = 1.4 }

hence;

⇒ V₁ / V₂ = ( T₂ / T₁ )^{\frac{1}{Y-1}

so we substitute

⇒ V₁ / V₂ = (  973 K / 303 K  )^{\frac{1}{1.4-1}

= (  3.21122  )^{\frac{1}{0.4}

= 18.4788 ≈ 18.48

Therefore, The compression ratio is 18.48

b) maximum temperature of the cycle

We know that for Air, Cp = 1.005 kJ/kgK

Now,

Heat transfer input per cycle Qs = Cp( T₃ - T₂ )

we substitute

925 = 1.005( T₃ - 700 )

( T₃ - 700 ) = 925 / 1.005

( T₃ - 700 ) = 920.398

T₃ = 920.398 + 700

T₃ = 1620.398 °C

T₃ = ( 1620.398 + 273 ) K

T₃ = 1893.396 K ≈ 1893.4 K

Therefore, The maximum temperature of the cycle is 1893.4 K

c)  the cutoff ratio, v₃/v₂;

Since pressure is constant, V ∝ T

So,

cutoff ratio S = v₃ / v₂  = T₃ / T₂

we substitute

cutoff ratio S = 1893.396 K / 973 K

cutoff ratio S = 1.9459 ≈ 1.946

Therefore, the cutoff ratio, v₃/v₂ is 1.946

8 0
3 years ago
What could be used as another word for electrical potential?
Marat540 [252]

Answer: C. Voltage

Explanation:

Here are some other words as well.

potential, voltage, potential drop, potential difference.

Answered by the ONE & ONLY #QUEEN aka #DRIPPQUEENMO!!!

HOPE THIS HELPED!!!

6 0
3 years ago
BTSAUDY5 NAME STARTS FROM THIS
otez555 [7]

Answer:

What's your question?

Explanation:

I'm not able to understand it....

Sorry.

7 0
3 years ago
Read 2 more answers
The efficiency of a transformer is mainly dependent on: a)- Core losses b)- Copper losses c)- Stray losses d)- Dielectric losses
natima [27]

The efficiency of a transformer is mainly dependent on a)- Core losses

Hope this helps! :)

6 0
3 years ago
Other questions:
  • A vehicle experiences hard shifting. Technician A says that the bell housing may be misaligned. Technician B says that incorrect
    5·1 answer
  • What is the Principle of Entropy Increase?
    9·1 answer
  • A heat pump and a refrigerator are operating between the same two thermal reservoirs. Which one has a higher COP?
    10·1 answer
  • A cylinder fitted with a movable piston contains water at 3 MPa with 50% quality, at which point the volume is 20 L. The water n
    8·2 answers
  • An aggregate blend is composed of 65% coarse aggregate by weight (Sp. Cr. 2.635), 36% fine aggregate (Sp. Gr. 2.710), and 5% fil
    5·1 answer
  • The one end of a hollow square bar whose side is (10+N/100) in with (1+N/100) in thickness is under a tensile stress 102,500 psi
    8·1 answer
  • Convert 103.69 kN to TN.
    14·1 answer
  • 1 A power transmission includes a belt drive, a chain drive and a gear drive. Which of the following is the best arrangement bet
    5·1 answer
  • From the top of a vertical cliff 80m high, the angles of depression of 2 buoys lying due west of the cliff are 23° and 15° respe
    13·1 answer
  • What’s the answer to this I don’t understand
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!