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
Which statement best describes the difference between acceleration and deceleration?
natima [27]
Acceleration is the rate at which an object picks up speed. deceleration is the rate at which an object loses speed.
7 0
3 years ago
Which of the following statements is/are true? Check all that apply. Check all that apply. The total mechanical energy of a syst
Taya2010 [7]

Answer:

1) True, 2) True, 3) False, 4) False, 5) False

Explanation:

1) True. Dissipative energy cannot be recovered, in general it is a form of heat

2) True. The dissipation can be by radiation, heat

3) False. Mechanical energy is divided into K and U but not in equal parts

4) False. When there are dissipative interactions, part of the mechanical energy is set in the form of heat, so its value decreases

5) False. Mechanical energy is the sum of those two energies

8 0
2 years ago
(a) An object that has a small mass and an object that has a large mass have the same momentum. Which object has the largest kin
Iteru [2.4K]

Answer:

A) The smaller object; B) The larger object

Explanation:

A) Lets say the small object is 2 kg and the large one is 6 kg. Lets say they also have 30 kg*m/s of momentum each. The small object would have 15 m/s velocity and the large would have 5 m/s.

Now for kinetic energy(.5*m*v²), the small object is .5*2*15², which is 225 J

The large object is .5*6*5², which is 75 J, so the smaller object has more Kinetic energy. Since velocity is squared, it is more important than how large mass is.

B) Same masses as part A. Lets say the kinetic energy is 45 J for both of them. For the small object, 45=.5*2*v²

.5*2 is 1, so 45/1 is 45. Take the square root and we get v= 6.71 m/s

For the large object, 45=.5*6*v²

.5*6 is 3, so 45/3 is 15. Take the square root and we get v=3.87 m/s

Now we plug the velocities into p=mv

For the small object, p=2*6.71, which gives us p=13.42 kg*m/s

For the large object, p=6*3.87, which gives us p=23.22 kg*m/s

The larger object has the larger momentum.

Hope this helps

5 0
3 years ago
Robert is riding the Giant Drop at Great America. If
lora16 [44]

Explanation:

i hope this helps, its not the same person but its the same equation.

7 0
3 years ago
Is magnitude a<br> vector<br> scalars<br> both<br> neither
Doss [256]

Answer:

scalars

Explanation:

7 0
2 years ago
Other questions:
  • The result of a wave generator traveling faster than the speed of a wave is:
    8·1 answer
  • Which one of the following parenting factors is associated with improved IQ scores in children?
    5·1 answer
  • Which statement describes a characteristic of an experimental design that
    5·1 answer
  • Mrs. Smith can walk 1.4 m/s. If it takes her 8.5 seconds to get to the teacher lounge, how far is the teacher lounge from her ro
    6·1 answer
  • What best explains why a wood burning fire place represents an open system
    13·2 answers
  • As an object moves from point A to point B only two forces act onit: one force is nonconservative and does -30 J of work, the ot
    7·1 answer
  • You find yourself at a lever. A runaway trolley approaches five people who are tied to a set of tracks. Pulling the lever will d
    14·1 answer
  • What did Thomson contribute to the model of atom
    11·2 answers
  • A kΩ resistor is connected to an AC voltage source with an rms voltage of V. (a) What is the maximum potential difference across
    14·1 answer
  • Draw the symbol for the following components.
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!