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
What is the difference in Neil Armstrong’s weight on the moon and on earth? Neils mass is 160kg including his spacesuit and back
Len [333]

Explanation:

Given parameters:

Mass of Neil Armstrong = 160kg

Gravitational pull of earth = 10N/kg

Moon's pull = 17% of the earth's pull

Unknown:

Difference between Armstrong's weight on moon and on earth.

Solution:

To find the weight,

   Weight = mass x acceleration due to gravity = mg

Moon's gravitational pull = 17% of the earth's pull = 17% x 10 = 1.7N/kg

Weight on moon = 160 x 1.7 = 272N

Weight on earth = 160 x 10 = 1600N

The difference in weight = 1600 - 272 = 1328N

The weight of Armstrong on earth is 1328N more than on the moon.

Learn more:

Weight and mass brainly.com/question/5956881

#learnwithBrainly

3 0
2 years ago
Equations to use: v= λ ∙ f v=d/t
Margarita [4]

b. 460.8 m/s

Explanation:

The relationship between the speed of the wave along the string, the length of the string and the frequency of the note is

f=\frac{v}{2L}

where v is the speed of the wave, L is the length of the string and f is the frequency. Re-arranging the equation and substituting the data of the problem (L=0.90 m and f=256 Hz), we can find v:

v=2Lf=2(0.90 m)(256 Hz)=460.8 m/s

c. 18,000 m

Explanation:

The relationship between speed of the wave, distance travelled and time taken is

v=\frac{d}{t}

where

v = 6,000 m/s is the speed of the wave

d = ? is the distance travelled

t = 3 s is the time taken

Re-arranging the formula and substituting the numbers into it, we find:

d=vt=(6,000 m/s)(3 s)=18,000 m

3 0
3 years ago
A 1000 kg satellite and a 2000 kg satellite follow exactly the same orbit around the earth. What is the ratio F1/F2 of the gravi
Tamiku [17]

Answer:

the <em>ratio F1/F2 = 1/2</em>

the <em>ratio a1/a2 = 1</em>

Explanation:

The force that both satellites experience is:

F1 = G M_e m1 / r²       and

F2 = G M_e m2 / r²

where

  • m1 is the mass of satellite 1
  • m2 is the mass of satellite 2
  • r is the orbital radius
  • M_e is the mass of Earth

Therefore,

F1/F2 = [G M_e m1 / r²] / [G M_e m2 / r²]

F1/F2 = [G M_e m1 / r²] × [r² / G M_e m2]

F1/F2 = m1/m2

F1/F2 = 1000/2000

<em>F1/F2 = 1/2</em>

The other force that the two satellites experience is the centripetal force. Therefore,

F1c = m1 v² / r    and

F2c = m2 v² / r

where

  • m1 is the mass of satellite 1
  • m2 is the mass of satellite 2
  • v is the orbital velocity
  • r is the orbital velocity

Thus,

a1 = v² / r ⇒ v² = r a1    and

a2 = v² / r ⇒ v² = r a2

Therefore,

F1c = m1 a1 r / r = m1 a1

F2c = m2 a2 r / r = m2 a2

In order for the satellites to stay in orbit, the gravitational force must equal the centripetal force. Thus,

F1 = F1c

G M_e m1 / r² = m1 a1

a1 = G M_e / r²

also

a2 = G M_e / r²

Thus,

a1/a2 = [G M_e / r²] / [G M_e / r²]

<em>a1/a2 = 1</em>

4 0
3 years ago
The instantaneous speed of a particle moving along one straight line is v(t) = ate−6t, where the speed v is measured in meters p
beks73 [17]

Answer:

v_max = (1/6)e^-1 a

Explanation:

You have the following equation for the instantaneous speed of a particle:

v(t)=ate^{-6t}   (1)

To find the expression for the maximum speed in terms of the acceleration "a", you first derivative v(t) respect to time t:

\frac{dv(t)}{dt}=\frac{d}{dt}[ate^{-6t}]=a[(1)e^{-6t}+t(e^{-6t}(-6))]  (2)

where you have use the derivative of a product.

Next, you equal the expression (2) to zero in order to calculate t:

a[(1)e^{-6t}-6te^{-6t}]=0\\\\1-6t=0\\\\t=\frac{1}{6}

For t = 1/6 you obtain the maximum speed.

Then, you replace that value of t in the expression (1):

v_{max}=a(\frac{1}{6})e^{-6(\frac{1}{6})}=\frac{e^{-1}}{6}a

hence, the maximum speed is v_max = ((1/6)e^-1)a

5 0
2 years ago
When two forces are acting a body in opposite direction their resultant become 6N and when they are acting in the same direction
Norma-Jean [14]

Answer:

9 and 3 N

Explanation:

Forces in the same direction sum up to produce the resultant force;

One force subtract the other will give the resultant force when they are in opposite directions;

Lets say one direction is forwards and the opposite backwards;

We have one force, let's say force A, in the forwards direction and another force, force B, acting in the same (forwards) or opposite (backwards) direction;

If B is acting in the same direction, then the resultant force (in this case) will be as follows:

A + B = 12

If B is acting in the opposite direction, then the resultant force will be as follows:
A - B = 6

Summing the two equations will allow us to solve for A:

A + B + (A - B) = 12 + 6

2A = 18

A = 9

Substitute this into either of the above equations and we can solve for B:
(9) - B = 6

B = 9 - 6

B = 3

5 0
2 years ago
Other questions:
  • Which planet has the largest day-night temperature difference?
    7·1 answer
  • How do I find angular speed of a rotating mass
    14·1 answer
  • Before heating a hot air balloon, the air temperature is 20C, and the density of air is 1 kg/m3. To launch the balloon, the burn
    15·2 answers
  • A beam of electrons passes through a single slit, and a beam of protons passes through a second, but identical, slit. The electr
    6·1 answer
  • Ratio of acceleration due to grabity and universal gravitational constant
    14·1 answer
  • How is the average American diet affected by our current food system?"
    6·1 answer
  • Pls help i have test
    13·2 answers
  • Pls fast as you can it is a test pls pls
    10·1 answer
  • Josh and jake are both helping to build a brick wall which is 6 meters in height. They each lay 250 bricks, but josh finishes th
    5·1 answer
  • How is the thermal efficiency of a heat engine defined?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!