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
mojhsa [17]
3 years ago
6

Create a file "parts_inv.dat" that stores on each line a part number, cost, and quantity in inventory, in the following format:1

23 5.99 52Use fscanfto read this informationand print the total dollar amount of inventory (the sum of the cost multiplied by the quantity for each part).
Physics
1 answer:
andriy [413]3 years ago
7 0

Answer:

%Open the file.

fID = fopen('parts_inv.dat');

%Read from the file.

data = fscanf(fID,'%d\t%f\t%d',[3,inf]);

%Close

fclose(fID);

%Restore the data.

data = data';

%Get the size

[rs, cs] = size(data);

%Set value.

invCost = 0;

%Loop

for rw = 1 : rs

%Find cost

invCost = invCost + (data(rw, 2) * data(rw, 3));

%Loop end

end

%Display the cost.

fprintf('Total cost: %4.2f\n\n', invCost);

Explanation:

You might be interested in
Explain what distinguishes acute and chronic sports injuries.
vfiekz [6]

Answer:

An acute injury is sudden and severe such as a broken bone. A chronic injury develops and worsens over an extended period of time like shin splints

Explanation:

3 0
3 years ago
Read 2 more answers
Please Help! 30 points! ASAP PLZ :)
Savatey [412]
The best logical answer is A
5 0
2 years ago
Read 2 more answers
A bullet is shot horizontally from shoulder height (1.5 m) with an initial speed 200 m/s. (a) How much time elapses before the b
daser333 [38]

Answer:

<h2>a) Time elapsed before the bullet hits the ground is 0.553 seconds.</h2><h2>b) The bullet travels horizontally 110.6 m</h2>

Explanation:

a)  Consider the vertical motion of bullet

We have equation of motion s = ut + 0.5 at²

        Initial velocity, u = 0 m/s

        Acceleration, a = 9.81 m/s²  

        Displacement, s = 1.5 m      

     Substituting

                      s = ut + 0.5 at²

                      1.5 = 0 x t + 0.5 x 9.81 xt²

                      t = 0.553 s

      Time elapsed before the bullet hits the ground is 0.553 seconds.

b) Consider the horizontal motion of bullet

We have equation of motion s = ut + 0.5 at²

        Initial velocity, u = 200 m/s

        Acceleration, a = 0 m/s²  

        Time, t = 0.553 s      

     Substituting

                      s = ut + 0.5 at²

                      s = 200 x 0.553 + 0.5 x 0 x 0.553²

                      s = 110.6 m

      The bullet travels horizontally 110.6 m

6 0
2 years ago
A resistor of 5 Ω is placed in a circuit. The voltage drop across the resistor is 12 V. What is the current through the resistor
Kaylis [27]
<span>Data:

</span>R = 5 Ω
U = 12 V
i = ?
<span>
Formula:

</span>U = R*i → i =  \frac{U}{R}<span>

Solving:

</span>i = \frac{U}{R}
i = \frac{12}{5}
\boxed{i = 2.4A}

Answer:

<span>The current through the resistor is 2.4 Amperes</span><span>

</span>
5 0
3 years ago
wo lacrosse players collide in midair. Jeremy has a mass of 120 kg and is moving at a speed of 3 m/s. Hans has a mass of 140 kg
Julli [10]

2.71 m/s fast Hans is moving after the collision.

<u>Explanation</u>:

Given that,

Mass of Jeremy is 120 kg (M_J)

Speed of Jeremy is 3 m/s (V_J)

Speed of Jeremy after collision is (V_{JA}) -2.5 m/s

Mass of Hans is 140 kg (M_H)

Speed of Hans is -2 m/s (V_H)

Speed of Hans after collision is (V_{HA})

Linear momentum is defined as “mass time’s speed of the vehicle”. Linear momentum before the collision of Jeremy and Hans is  

= =\mathrm{M}_{1} \times \mathrm{V}_{\mathrm{J}}+\mathrm{M}_{\mathrm{H}} \times \mathrm{V}_{\mathrm{H}}

Substitute the given values,

= 120 × 3 + 140 × (-2)

= 360 + (-280)

= 80 kg m/s

Linear momentum after the collision of Jeremy and Hans is  

= =\mathrm{M}_{\mathrm{J}} \times \mathrm{V}_{\mathrm{JA}}+\mathrm{M}_{\mathrm{H}} \times \mathrm{V}_{\mathrm{HA}}

= 120 × (-2.5) + 140 × V_{HA}

= -300 + 140 × V_{HA}

We know that conservation of liner momentum,

Linear momentum before the collision = Linear momentum after the collision

80 = -300 + 140 × V_{HA}

80 + 300 = 140 × V_{HA}

380 = 140 × V_{HA}

380/140= V_{HA}

V_{HA} = 2.71 m/s

2.71 m/s fast Hans is moving after the collision.

4 0
3 years ago
Other questions:
  • How can you increase the gravitational potential energy between yourself and earth?
    15·1 answer
  • Kinetic energy....
    5·1 answer
  • A sample of the inert gas krypton has its pressure tripled. if the original volume is 12 l, what is the final volume in l
    10·1 answer
  • A fixed mass of an ideal gas is heated from 50 to 80℃ at a constant pressure of (a) 1 atm and (b) 3 atm. for which case do you t
    6·1 answer
  • (a) Find the acceleration of B.<br>(b) Find the tensions, T1 and T2, in the strings.
    10·1 answer
  • A space station shaped like a giant wheel has a radius of a radius of 153 m and a moment of inertia of 4.16 × 10⁸ kg·m² (when it
    15·1 answer
  • According to the kenitic theory, what happens when ice melts
    12·2 answers
  • 3. What is the velocity of a wave that has a frequency of 750 Hz and a wavelength of 45.7 cm?
    8·1 answer
  • What is the difference between melting point and boiling point?
    6·1 answer
  • Give an example of how a bicycle rider would accelerate? Explain the three different ways a bicyclist could
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!