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
At the same temperature, two wires made of pure copper have different resistances. The same voltage is applied at the ends of ea
Semmy [17]

Answer:

Explanation:

As we know that the resistance of the wire is directly proportional to the length of wire and inversely proportional to the area of crossection of the wire.

As the material is copper for both the wires so the resistivity is same and the voltage is also same. As their resistance is different it means either length is different or the area of crossection is different.

6 0
3 years ago
A very smart 3-year-old child is given a wagon for her birthday. She refuses to use it. "After all," she says, "Newton's third l
natita [175]

Answer:

Explanation:

She's correct but doesn't mean the wagon cannot put into motion. The force that she applied on the wagon, according to Newton's 2nd law, would have generated an acceleration, which translates into motion. The reaction force the wagon applies on her due to Newton's 3rd law, would not hinder its own motion.

5 0
3 years ago
If a roller coaster cart, with a mass of 100 kg, traveled this coaster, how much kinetic energy would it have at point 'E'?
zzz [600]

Answer:

Explanation:

Assuming no friction between the roller coaster car and the hill, and neglecting air resistance, the kinetic energy the roller coaster car would have at the bottom of the hill would be equal to its gravitational potential energy at the top of the hill, by conservation of energy.

8 0
3 years ago
What is the period of a wave traveling 5 m/s if its wavelength is 20 m/s
Ilia_Sergeevich [38]

Speed of wave is given as

v = 5 m/s

Wavelength of the wave is given as

\lambda = 20 m

now from the formula of wave time period we can say

speed = \frac{wavelength}{time period}

5 = \frac{20}{T}

T = \frac{20}{5}

T = 4 s

so it will have time period of T = 4 s

7 0
3 years ago
I don’t understand how to do this
anzhelika [568]

Explanation:

A) Use Hooke's law to find the spring constant.

F = kx

40 N = k (0.4 m)

k = 100 N/m

B) Period of a spring-mass system is:

T = 2π √(m / k)

T = 2π √(2.6 kg / 100 N/m)

T = 1 s

Frequency is the inverse of period.

f = 1 / T

f = 1 Hz

5 0
2 years ago
Other questions:
  • Choose whether each of the following statements is true or false. In order to move a massive crate sitting on the floor, the for
    7·1 answer
  • La frecuencia de una onda es 60Hz y su velocidad, 30 m/s. Calcula su longitud de onda
    9·1 answer
  • The engine of a locomotive exerts a constant force of 8.1*10^5 N to accelerate a train to 68 km/h. Determine the time (in min) t
    7·2 answers
  • Rays of light incident on a lens and parallel to the principal axis of the lens coverage?
    15·2 answers
  • The process of bringing a complaint and filing an answer is known as the _____. a. Trials b. Coercions c. Pleadings d. Countercl
    10·2 answers
  • A student studies how an objects mass and speed are related to its kinetic energy. The table shows the results for one part of t
    15·1 answer
  • The speed of sound in water is 1498 m/s. A sonar signal is sent straight down from a ship at a point just below the water surfac
    14·1 answer
  • A typical wind turbine extracts 40% of the kinetic energy of the wind that blows through the area swept by the blades. For a lar
    14·1 answer
  • Hi there! I'm not quite sure on how to solve this....
    10·2 answers
  • Two point charges are placed on the x-axis as follows: charge q1 = 3.95 nC is located at x= 0.198 m , and charge q2 = 4.96 nC is
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!