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

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.
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...
Remarks It's interesting that the final result depends only on the coefficient of static friction. Notice...
Remarks It's interesting that the final result depends only on the coefficient of static friction. Notice also how similar Equations (1) and (2) are to the equations developed in previous problems. Recognizing such patterns is key to solving problems successfully. Question A larger static friction constant would result in a: (Select all that apply.) a) smaller component of gravitational force along the ramp at the maximum angle. b) larger maximum angle. c)smaller maximum angle. d)larger component of gravitational force along...
A bowling ball of mass m and radius r has a coefficient of static friction µ...
A bowling ball of mass m and radius r has a coefficient of static friction µ when in contact with an oiled wood surface. Model the ball as a solid uniform sphere. The surface is inclined at an angle θ with respect to the horizontal. What is the maximum angle of inclination of the surface such that the ball rolls without slipping? How does the angle change if the ball is now a hollow shell with all its mass concentrated...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT