Question

In: Computer Science

The following table gives the approximate values of the coefficient of static friction μ, for various...

The following table gives the approximate values of the coefficient of static friction μ, for various materials

Option/ Materials/ μ
1 /Metal on metal/ 0.2
2 /Wood on wood /0.35
3/ Metal on wood /0.4
4/ Rubber on concrete/ 0.7

To start moving a weight W, on a horizontal surface, you must push with a force F, where F=μW.
Write an m-file that achieves the following:
1. Uses fprintf to print out the option and material information to the command window
2. Prompt the user to input a value of W and the type of materials/option
 Check if the input values are valid (e.g. negative weights or non-integer/incorrect option numbers). Your
program should continue prompting the user to enter values until they are valid.

3. Use a switch statement to compute the force required. Use fprintf to print a statement including the materials
used and the force required.
Hint: You may want to use a while loop to ensure that the user enters valid inputs.

Solutions

Expert Solution

clc,clear

s=0;

f=0;

fprintf("The data table is\n");

fprintf('Option \t Materials \t Coeff.\n');

fprintf(' 1 \t Metal_on_metal \t 0.2\n');

fprintf(' 2 \t Wood_on_wood \t 0.35\n');

fprintf(' 3 \t Metal_on_wood \t 0.4\n');

fprintf(' 4 \t Rubber_on_concrete \t 0.7\n');

prompt = 'Enter the weight of material ';

z = 0;

while z<=0 || ~(isinteger(z))

            z= input(prompt);

end

s=input('Enter your option');

while s ~= '1,2,3,4';

            s = input('Chooose your option from (1,2,3,4) ', 's');

end

switch s

    case 1

           f=0.2*z;

           fprintf('%f',f);

    case 2

           f=0.35*z;

           fprintf('%f',f);

    case 3

           f=0.4*z;

           fprintf('%f',f);

   case 4

           f=0.7*z;

           fprintf('%f',f);

   otherwise

           printf("Sorry");

end


Related Solutions

#4. A vase was placed on the coffee table. The coefficient of static friction between the...
#4. A vase was placed on the coffee table. The coefficient of static friction between the vase and the table is 0.3689, whereas the coefficient of kinetic friction is 0.1339. The vase weighs 1.0707kg. A cat decided to redecorate the room by pushing the vase off the table. As the cat pushes the vase with its paw, the vase moves. Then, the cat maintains a constant applied force of 7.37N on the vase in the positive x-direction. What is the...
A mass of 8 kg rests on a floor with a coefficient of static friction of...
A mass of 8 kg rests on a floor with a coefficient of static friction of 0.88 and coefficient kinetic friction of 0.33. One force is applied vertically downward of 28 Newtons and another force is applied at an angle of 26 degrees below the horizontal. Calculate what the magnitude this force needs to be in order to begin to move the mass. If that force is removed and another force is applied at an angle of 26 degrees above...
A mass of 9 kg rests on a floor with a coefficient of static friction of...
A mass of 9 kg rests on a floor with a coefficient of static friction of 0.92 and coefficient kinetic friction of 0.37. One force is applied vertically downward of 22 Newtons and another force is applied at an angle of 26 degrees below the horizontal. Calculate what the magnitude this force needs to be in order to begin to move the mass. If that force is removed and another force is applied at an angle of 26 degrees above...
A mass of 6 kg is placed on an incline with a coefficient of static friction...
A mass of 6 kg is placed on an incline with a coefficient of static friction of 1.80 and coefficient of kinetic friction of 1.28. No additional forces are acting on it and it is raised slowly from a small angle and it begins to slide at some angle. If 10 degrees is added to this angle, and the mass started from rest from a vertical height of 28 meters, how much longer would it take to travel down the...
In the first part of this lab, you will find the coefficient of static friction between...
In the first part of this lab, you will find the coefficient of static friction between paper and a book so we want the surface of the ramp to be paper. This can be done either by making your ramp out of paper (by using a notebook) or by taping a piece of paper to the surface of a ramp. Conduct your experiment. You should perform at least three trials. Create a data table that includes all of the data...
If the coefficient of static friction is 0.60, and the same ladder makes a 46° angle...
If the coefficient of static friction is 0.60, and the same ladder makes a 46° angle with respect to the horizontal, how far along the length of the ladder can a 55.0-kg person climb before the ladder begins to slip? The ladder is 7.5 m in length and has a mass of 21 kg.
The coefficient of friction (static and kinetic) between an object and a surface can be measured...
The coefficient of friction (static and kinetic) between an object and a surface can be measured by putting the object on an adjustable inclined plane. (a) Draw a free-body diagram for the object, assuming static friction holds it in place on the incline. (b) Find an equation that can be used to solve for µs, in terms of the angle θmax which is the largest angle that the object can sit without sliding. (Hint: You can reduce the problem to...
Values in the table below are approximate. Use these to answer the following questions and to...
Values in the table below are approximate. Use these to answer the following questions and to compare health impact of the two diseases. R-naught Incubation period Contagious Period COVID-19 2.5 10 days 2-3 days before symptoms to 10 days after Rabies 1.5 Several months From symptoms to 10 days after symptoms Recall that R-naught is the average number of additional cases that directly result from a single person bringing it into a fully susceptible community. Below, compare in the impact...
Block A weighs 445N and block B weighs 130N. The coefficient of static friction between the...
Block A weighs 445N and block B weighs 130N. The coefficient of static friction between the inclined plane and block A is 0.565, and the coefficient of kinetic friction is 0.258. The plane is inclined at the angle θ = 42.0. (a) Find the acceleration of the system if A is initially at rest. (b) Find the acceleration of the system if A is initially moving up the incline. (c) What is the acceleration of the system if A is...
Block A weighs 445N and block B weighs 130N. The coefficient of static friction between the...
Block A weighs 445N and block B weighs 130N. The coefficient of static friction between the inclined plane and block A is 0.565, and the coefficient of kinetic friction is 0.258. The plane is inclined at the angle θ = 42.0. (a) Find the acceleration of the system if A is initially at rest. (b) Find the acceleration of the system if A is initially moving up the incline. (c) What is the acceleration of the system if A is...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT