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]
4 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]4 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
If a force of 50 Newton’s was applied to an object with a mass of 500 grams, what will the objects acceleration be?
lapo4ka [179]

Answer:  100 m/s^2

F=ma

Explanation:

50N = 50 kg*m/s^2

500g = 0.5 kg

F=ma

a = F/m

a = (50 kg*m/s^2)/(0.5 kg)

a = 100 m/s^2

5 0
3 years ago
Help? Please? Thanks!
Katena32 [7]
1,3 and 5 are the answers 
5 0
3 years ago
A kangaroo jumps straight up to a vertical height of 1.45 m. How long was it in the air before returning to Earth?
dexar [7]

Answer:

1.08 s

Explanation:

From the question given above, the following data were obtained:

Height (h) reached = 1.45 m

Time of flight (T) =?

Next, we shall determine the time taken for the kangaroo to return from the height of 1.45 m. This can be obtained as follow:

Height (h) = 1.45 m

Acceleration due to gravity (g) = 9.8 m/s²

Time (t) =?

h = ½gt²

1.45 = ½ × 9.8 × t²

1.45 = 4.9 × t²

Divide both side by 4.9

t² = 1.45/4.9

Take the square root of both side

t = √(1.45/4.9)

t = 0.54 s

Note: the time taken to fall from the height(1.45m) is the same as the time taken for the kangaroo to get to the height(1.45 m).

Finally, we shall determine the total time spent by the kangaroo before returning to the earth. This can be obtained as follow:

Time (t) taken to reach the height = 0.54 s

Time of flight (T) =?

T = 2t

T = 2 × 0.54

T = 1.08 s

Therefore, it will take the kangaroo 1.08 s to return to the earth.

3 0
3 years ago
A physical change is a change to the physical properties of a substance. This type of change does
LiRa [457]

Answer:

False

Explanation:

5 0
3 years ago
The cylinder with piston locked in place is immersed in a mixture of ice and water and allowed to come to thermal equilibrium wi
lukranit [14]

Answer:

a. volume of gas:  (decreases)

b. temperature of gas:  (same)

c. internal energy of gas: (same)

d. pressure of gas: (increases)

Explanation:

We have a gas (let's suppose that is ideal) in a piston with a fixed volume V.

Then we put in a reservoir at 0°C (the mixture of water and ice)

remember that the state equation for an ideal gas is:

P*V = n*R*T

and:

U = c*n*R*T

where:

P = pressure

V = volume

n = number of mols

R = constant

c = constant

T = temperature.

Now, we have equilibrium at T = 0°C, then we can assume that T is also a constant.

Then in the equation:

P*V = n*R*T

all the terms in the left side are constants.

P*V = constant

And knowing that:

U = c*n*R*T

then:

n*R*T = U/c

We can replace it in the other equation to get:

P*V = U/c = constant.

Now, the piston is (slowly) moving inwards, then:

a) Volume of the gas: as the piston moves inwards, the volume where the gas can be is smaller, then the volume of the gas decreases.

b) temperature of the gas: we know that the gas is a thermal equilibrium with the mixture (this happens because we are in a slow process) then the temperature of the gas does not change.

c) Internal energy of the gas:

we have:

P*V = n*R*T = constant

and:

P*V = U/c = constant.

Then:

U = c*Constant

This means that the internal energy does not change.

d) Pressure of the gas:

Here we can use the relation:

P*V = constant

then:

P = (constant)/V

Now, if V decreases, the denominator in that equation will be smaller. We know that if we decrease the value of the denominator, the value of the quotient increases.

And the quotient is equal to P.

Then if the volume decreases, we will see that the pressure increases.

4 0
2 years ago
Other questions:
  • How many coulombs of charge do 50 * 10^31 electrons possess
    7·1 answer
  • A 2.0-kilogram mass is located 3.0 meters above
    14·2 answers
  • How many mean free paths thick must a shield be designed in order to attenuate an incident neutron beam by a factor of 1000?
    6·1 answer
  • The matter that makes up a planet is distributed uniformly so that the planet has a fixed, uniform density. How does the magnitu
    5·1 answer
  • Why are force fields necessary to describe gravity?
    9·2 answers
  • The chemical equation for the decomposition of potassium chlorate into potassium chloride and oxygen gas is
    13·1 answer
  • A car traveling at a speed of 13 meters per second accelerates uniformly to a speed of 25 meters per second in 5.0 seconds. 11-
    10·1 answer
  • Part D- Isolating a Variable with a Coefficient In some cases, neither of the two equations in the system will contain a variabl
    5·1 answer
  • Draw the well labelled diagram of thermo flask.​
    10·1 answer
  • What is the relationship between resistance and current.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!