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 between a mechanical wave and an electromagnetic wave
ivann1987 [24]

Answer:

1. Electromagnetic waves travel in a vacuum whereas mechanical waves do not.

2. The ripples made in a pool of water after a stone is thrown in the middle are an example of mechanical wave. Examples of electromagnetic waves include light and radio signals.

3. Mechanical waves are caused by wave amplitude and not by frequency. Electromagnetic Waves are produced by vibration of the charged particles.

4. While an electromagnetic wave is called just a disturbance, a mechanical wave is considered a periodic disturbance.

Explanation:

5 0
3 years ago
An object thrown vertically upward from the surface of a celestial body at a velocity of 36 ​m/s reaches a height of sequalsminu
Anarel [89]

Answer:

v = -1.8t+36

20 seconds

360 m

40 seconds

36 m/s

The object speed will increase when it is coming down from its highest height.

Explanation:

s=-0.9t^2+36t

Differentiating with respect to time we get

\frac{ds}{dt}=-1.8t+36\\\Rightarrow v=-1.8t+36

a) Velocity of the object after t seconds is v = -1.8t+36

At the highest point v will be 0

0=-1.8t+36\\\Rightarrow t=\frac{-36}{-1.8}\\\Rightarrow t=20\ s

b) The object will reach the highest point after 20 seconds

s=-0.9t^2+36t\\\Rightarrow s=-0.9\times 20^2+36\times 20\\\Rightarrow s=360\ m

c) Highest point the object will reach is 360 m

s=-0.9t^2+36t\\\Rightarrow 360=-0.9t^2+36t\\\Rightarrow -0.9t^2+36t-360=0\\\Rightarrow -9t^2+360t-3600=0

\frac{-360\pm \sqrt{0}}{2\left(-9\right)}\\\Rightarrow t=20\ s

d) Time taken to strike the ground would be 20+20 = 40 seconds

[tex]v=u+at\\\Rightarrow v=0+0.9\times 2\times 20\\\Rightarrow v=36\ m/s

Acceleration will be taken as positive because the object is going down. Hence, the sign changes. 2 is multiplied because the expression is given in the form of s=ut+\frac{1}{2}at^2

e) The velocity with which the object strikes the ground will be 36 m/s

f) The speed will increase when the object has gone up and for 20 seconds and falls down for 20 seconds. The object speed will increase when it is coming down from its highest height.

4 0
3 years ago
Creates an image that appears upside down behind the focal point
zheka24 [161]
An image that appears upside down behind the focal point is an image that is reflected on a concave mirror. Mirrors reflect different kinds of images based on the placement of an object that is reflected towards it. There are two kinds of mirrors, concave and a convex mirrors, the latter makes objects seem smaller and farther than where it is exactly.
8 0
3 years ago
Gggcdfubrdegubtcwftvf y day rx u e HHS’s forget h
aev [14]

Answer:

um . . . yes ?

8 0
2 years ago
Read 2 more answers
A cylinder of diameter 100 mm rolls from restdown a 5 m long ramp and its center of mass is moving with velocity 2 m/s at the bo
RoseWind [281]

Answer:

(a): a = 0.4m/s²

(b): α = 8 radians/s²

Explanation:

First we propose an equation to determine the linear acceleration and an equation to determine the space traveled in the ramp (5m):

a= (Vf-Vi)/t = (2m/s)/t

a: linear acceleration.

Vf: speed at the end of the ramp.

Vi: speed at the beginning of the ramp (zero).

d= (1/2)×a×t² = 5m

d: distance of the ramp (5m).

We replace the first equation in the second to determine the travel time on the ramp:

d = 5m = (1/2)×( (2m/s)/t)×t² = (1m/s)×t ⇒ t = 5s

And the linear acceleration will be:

a = (2m/s)/5s = 0.4m/s²

Now we determine the perimeter of the cylinder to know the linear distance traveled on the ramp in a revolution:

perimeter = π×diameter = π×0.1m = 0.3142m

To determine the angular acceleration we divide the linear acceleration by the radius of the cylinder:

α = (0.4m/s²)/(0.05m) = 8 radians/s²

α: angular aceleration.

3 0
3 years ago
Other questions:
  • A current of 0.001 A can be felt by the human body. 0.005 A can produce a pain response. 0.015 A can cause a loss of muscle cont
    9·1 answer
  • Define bond length using your own words​
    6·1 answer
  • The following three hot samples have the same temperature. The same amount of heat is removed from each sample. Which one experi
    13·1 answer
  • Why do solids have a definite shape?
    13·2 answers
  • How much work in joules must be done to stop a 920-kg car traveling at 90 km/h?
    12·1 answer
  • Explain how competition between organisms affects the availability of resources in an area.
    12·1 answer
  • The three pairs of metal same-size spheres have different charges on their surfaces, as indicated. Each pair is brought together
    10·1 answer
  • An object in free fall has a velocity of 5m/s in the upward direction. What is the instantaneous velocity of the object one seco
    15·1 answer
  • 6.
    14·1 answer
  • Three children are sitting on a merry-go-round while a fourth child is pushing on the outside edge with a constant force. Why do
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!