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
Svet_ta [14]
4 years ago
12

Create an application named NumbersDemo whose main() method holds two integer variables. Assign values to the variables. In turn

, pass each value to methods named displayTwiceTheNumber(), displayNumberPlusFive(), and displayNumberSquared().
Engineering
1 answer:
Mashcka [7]4 years ago
4 0

Answer:

The solution code is written in C++.

  1. int main() {
  2.    int a = 5;
  3.    int b = 4;
  4.    displayTwiceTheNumber(a);
  5.    displayTwiceTheNumber(b);
  6.    displayNumberPlusFive(a);
  7.    displayNumberPlusFive(b);
  8.    displayNumberSquared(a);
  9.    displayNumberSquared(b);
  10.    return 0;
  11. }
  12. void displayTwiceTheNumber(int num){
  13.    cout << num * 2;
  14. }
  15. void displayNumberPlusFive(int num){
  16.    cout << num + 5;
  17. }
  18. void displayNumberSquared(int num){
  19.    cout << num * num;
  20. }

Explanation:

Firstly, create two integer variables, <em>a</em> and <em>b and </em>two sample values are assigned to the two variables, respectively (Line 3-4). Next, we pass the value of each variable <em>a</em> and <em>b</em> to the methods named <em>displayTwiceTheNumber(), displayNumberPlusFive(),</em> and <em>displayNumberSquared() </em>(Line 6- 13).

You might be interested in
If the contact surface between the 20-kg block and the ground is smooth, determine the power of force F when t = 4 s. Initially,
grigory [225]

Answer:

The power of force F is 115.2 W

Explanation:

Use following formula

Power  = F x V

F_{H} = F cos0

F_{H} = (30) x 4/5

F_{H} = 24N

Now Calculate V using following formula

V = V_{0} + at

V_{0} = 0

a = F_{H} / m

a = 24N / 20 kg

a = 1.2m / S^{2}

no place value in the formula of V

V = 0 + (1.2)(4)

V = 4.8 m/s

So,

Power = F_{H} x V

Power = 24 x 4.8

Power = 115.2 W

3 0
3 years ago
5. Assume that you and your best friend ench have $1000 to invest. You invest your money
Bezzdna [24]

Correct question reads;

Assume that you and your best friend each have $1000 to invest. You invest your money in a fund that pays 10% per year compound interest. Your friend invests her money at a bank that pays 10% per year simple interest. At the end of 1 year, the difference in the total amount for each of you is:

(a) You have $10 more than she does

(b) You have $100 more than she does

(c) You both have the same amount of money

(d) She has $10 more than you do

<u>Answer:</u>

<u>(d) She has $10 more than you do</u>

<u>Explanation</u>:

Using the compound interest formula

A= P [ (1-i)^n-1

Where P = Principal/invested amount, i = annual interest rate in percentage, and n = number of compounding periods.

<u>My compound interest is:</u>

= 1000 [ (1-0.1)^1-1

= $1000

$1,000 + $1,000 invested= $2,000 total amount received.

<u>My friend's simple interest is;</u>

To determine the total amount accrued we use the formula:

P(1 + rt) Where:

P = Invested Amount (1000)

I = Interest Amount (10,000)

r = Rate of Interest per year (10% or 0.2)

t = Time Period (1 )

= 1000 (1 + rt)

= 1000 (1 + 0.1x1)

= $1100 + $1000 invested = $2100 total amount received.

Therefore, we observe that she (my friend) has $100 more than I do.

5 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
2 years ago
A 0.19-m3 rigid tank equipped with a pressure regulator contains steam at 2 MPa and 300°C. The steam in the tank is now heated.
AVprozaik [17]

Answer:

576.21kJ

Explanation:

#We know that:

The balance mass m_{in}+m_{out}=\bigtriangleup m_{system}

so, m_e=m_1-m_2

Energy \ Balance\\E_{in}-E_{out}=\bigtriangleup E_{system}\\\\\therefore Q_i_n+m_eh_e=m_2u_2-m_1u_1

#Also, given the properties of water as;

(P_1=2Mpa,T_1=300\textdegree C)->v_1=0.12551m^3/kg,u_1=2773.2kJ/kg->h_1=3024.2kJ/kg\\\\(P_2=2Mpa,T_1=500\textdegree C)->v_2=0.17568m^3/kg,u_1=3116.9kJ/kg->h_1=3468.3kJ/kg

#We assume constant properties for the steam at average temperatures:h_e=\approx(h_1+h_2)/2

#Replace known values in the equation above;h_e=(3024.2+3468.3)/2=3246.25kJ/kg\\\\m_1=V_1/v_1=0.19m^3/(0.12551m^3/kg)=1.5138kg\\\\m_2=V_2/v_2=0.19m^3/(0.17568m^3/kg)=1.0815kg

#Using the mass and energy balance relations;

m_e=m_1-m_2\\\\m_e=1.5138-1.0815\\\\m_e=0.4323kg

#We have Q_i_n+m_eh_e=m_2u_2-m_1u_1: we replace the known values in the equation as;

Q_i_n+m_eh_e=m_2u_2-m_1u_1\\\\Q_i_n=0.4323kg\times3246.2kJ/kg+1.0815kg\times3116.9-1.5138kg\times2773.2kJ/kg\\\\Q_i_n=573.21kJ

#Hence,the amount of heat transferred when the steam temperature reaches 500°C is 576.21kJ

5 0
3 years ago
What type of car engine is best for cold weather.
Komok [63]

Answer:Antifreeze/coolant

Explanation: keeps your engine cool in warm weather and keeps it from freezing up in the winter. A 50-50 mix of full strength coolant and water generally protects to around -30 degrees Fahrenheit. Make sure you check with the supplier or your owner's manual for the correct formulation

5 0
3 years ago
Other questions:
  • All MOS devices are subject to damage from:________
    7·1 answer
  • Briefly explain why small-angle grain boundaries are not as effective in interfering with the slip process as are high-angle gra
    5·1 answer
  • IN JAVA,
    6·1 answer
  • Design a digital integrator using the impulse invariance method. Find and give a rough sketch of the amplitude response, and com
    15·1 answer
  • 10. True or False: You should select your mechanic before you experience vehicle failure.
    6·2 answers
  • How may a Professional Engineer provide notice of licensure to clients?
    9·1 answer
  • What is the thermal efficiency of this reheat cycle in terms of enthalpies?
    11·1 answer
  • A long rod of 60-mm diameter and thermophysical properties rho=8000 kg/m^3, c=500J/kgK, and k=50 W/mK is initally at a uniform t
    8·1 answer
  • A parallel circuit has a resistance of 280 and an inductive reactance of 360 02. What's this circuit's impedance?
    6·1 answer
  • Reason fo I.EE regulations in electrical installations​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!