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 the angular momentum of a rigid body is changing, does that mean that there must be a net torque acting on the body?
masha68 [24]

The attribute of any rotating object determined by the product of the moment of inertia and the angular velocity is known as angular momentum.

<h3>What is Angular Momentum?</h3>
  • Without a kickstand, attempting to balance while getting on a bicycle will definitely result in you falling off. However, these wheels gain angular momentum once you begin pedaling. They're going to be resistant to change, which will make balance simpler.
  • The definition of angular momentum is:  any rotating object's characteristic determined by moment of inertia times angular velocity.
  • It is a characteristic of rotating bodies determined by the sum of their moment of inertia and angular velocity. Since it is a vector quantity, the direction must also be taken into account in addition to the magnitude.
  • Angular Momentum Examples : We encounter this property frequently, whether knowingly or unknowingly.
  • The following provides some examples : Ice-skater
  • In order to begin a spin, an ice skater starts with her hands and legs spread widely from the center of her body. She moves her hands and leg closer to her body when she needs to spin with more angular velocity, though.
  • As a result, she conserves angular momentum and spins faster.

To Learn more About angular momentum refer to :

brainly.com/question/26889176

#SPJ4

6 0
1 year ago
Troy, Xavier, and Emmitt are all football players. They decide to race each other up the bleachers one day. They take off runnin
zvonat [6]
Is this the answer for the question or is there a question for us?
4 0
3 years ago
A student is watching a video in order to understand how convection in the mantle of the Earth occurs. The video shows rock risi
PSYCHO15rus [73]

Answer:

A

Explanation:

Because of the convectional currents

8 0
3 years ago
What is the best description of the destructive interference of light?
Helga [31]

Destructive interference occurs when the maxima of two waves are 180 degrees out of phase: a positive displacement of one wave is cancelled exactly by a negative displacement of the other wave.

Answer:

The crest of one wave overlaps the trough of another.

8 0
3 years ago
Read 2 more answers
What is 60mph (miles per hour) in meters per second? ( A mile is 5280ft)<br> please someone help me
777dan777 [17]

Answer:

60mph=26.8224meters per second

Explanation:

4 0
3 years ago
Other questions:
  • Calculate the force of gravity between a 2.50 kg newborn baby and a 80.0 kg doctor standing 0.250 m away. G = 6.67 E -11 N*m2/kg
    12·1 answer
  • What part does the lens play in transmitting an image to the brain?
    14·1 answer
  • Which of the following is true of both nuclear fusion and nuclear fission?
    11·2 answers
  • In the grapes of wrath what does ma's burning of the old stationary box illustrate
    13·1 answer
  • Declination of a star is similar to Earth's:<br> latitude<br> longitude<br> rotation<br> inclination
    9·2 answers
  • Which change increases the electric force between objects?
    5·2 answers
  • Of all of the types of forest biomes, tropical rain forests contain the most biodiversity, even though they do not have the most
    6·2 answers
  • Olympic swimmer Michael Phelps swam at an average speed of 2.01m/s during the first half of the time needed to complete a race.
    10·1 answer
  • A study finds that there is a positive correlation between height and math test scores. The researcher concludes that taller peo
    7·1 answer
  • Suppose you go to Six Flags again, but now you decide to go on the Wonder Woman Coaster ride instead of the Superman. The maximu
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!