Write a program in a script file that converts a quantity of force given in units...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program in a script file that converts a quantity of force given in units of either lbf (pound-force), kgf (kg-force) or dyne to the equivalent quantity in N (Newton) using a switch-case structure. The program should ask the user to enter the quantity of force and its current units. The output should be the quantity of force in N. Your program should also include an if-else structure to return an error message in case the user enters the input units incorrectly. Otherwise, it should return the result of unit conversion. First, draw a flowchart of your program! 2. (20 points) Use a for loop to sum the elements in the following vector: x = [1 67 45 34 89 99 45 87] Check your answer with the sum function. 3. (35 points) A vector is given by V= [5, 17, -3, 8, 0, -7, 12, 15, 20, -6, 6, 4, -7, 16]. Write a program as a script file that doubles the elements that are larger than 3 and smaller than 15, and, raises to the power of 3 the elements that are negative but greater than -5. Also draw the flowchart of your program. Write a program in a script file that converts a quantity of force given in units of either lbf (pound-force), kgf (kg-force) or dyne to the equivalent quantity in N (Newton) using a switch-case structure. The program should ask the user to enter the quantity of force and its current units. The output should be the quantity of force in N. Your program should also include an if-else structure to return an error message in case the user enters the input units incorrectly. Otherwise, it should return the result of unit conversion. First, draw a flowchart of your program! 2. (20 points) Use a for loop to sum the elements in the following vector: x = [1 67 45 34 89 99 45 87] Check your answer with the sum function. 3. (35 points) A vector is given by V= [5, 17, -3, 8, 0, -7, 12, 15, 20, -6, 6, 4, -7, 16]. Write a program as a script file that doubles the elements that are larger than 3 and smaller than 15, and, raises to the power of 3 the elements that are negative but greater than -5. Also draw the flowchart of your program.
Expert Answer:
Answer rating: 100% (QA)
Force Conversion Program forceconverterm Force Conversion Program Prompt user for input force inputE... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Write a program in a script file that converts a measure of pressure given in units of either Pa, psi, atm. or torr to the equivalent quantity in different units specified by the user. The program...
-
What are the SDGs ? What is their history? How do they support global sustainability agenda?
-
A 1.000 m by 1.500 m by 2.000 m cube of a continuous solid is deformed (dashed line in the figure) into a shape by the movement of point E to E'. Considering small deformations, the displacement...
-
Of the methods for accounting for uncollectible accounts, which one do you think is the most straightforward to implement? Why?
-
Write a short paragraph explaining why a continuous function on an open interval may not have a maximum or minimum. Illustrate your explanation with a sketch of the graph of such a function.
-
Define boiler according to IBR. Classify mountings into safety fittings and control fittings.
-
1. How does Tesla Motors marketing strategy connect with the changes going on in the consumer decision journey today? Do you believe that they can be successful over the long-term with this kind of...
-
What is the profit under the "best case scenario? According to the scenario manager (output), what is the profit under the "most likely" scenario? According to the one variable DATA TABLE, what is...
-
Costello Company has several divisions. The controller, Sarah James, prepares monthly segment reports for each division. Each division manager is evaluated annually, based largely on the segment...
-
Laurie has a 25% marginal tax rate and an average tax rate of 20%. David has a marginal tax rate of 15% and an average tax rate of 10%. If Laurie is the contributor of a spousal RRSP and her husband,...
-
A block holding a ringing tuning fork is attached to a wall by a spring. The block oscillates back and forth on a horizontal, frictionless surface, with amplitude 17 cm. The mass of the tuning fork...
-
QUESTION 7 What is the centripetal accleration of a person standing 4 meters from the center of a merry-go-round if the merry-go-round has a linear velocity of 5 m/s? 6.25 m/s 1.25 m/s2 O 3.2 m/s O...
-
Consider an airplane flying at a steady and level flight with a speed of 144 knots and an altitude of 13,000 ft. At time t = 0 hour, the position of the airplane is directly above an island. (a)...
-
A roller of a motorised mortar mixer rotates for 5 seconds with a uniform angular acceleration and describes 120 radians during this time. It then rotates with constant angular velocity and covers...
-
The speed of a flywheel changes from 10 rad/s to 30 rad/s in 5 seconds time. Determine the angular acceleration of the wheel. How many revolutions the wheel would turn to attain a speed of 600...
-
Kirtland Corporation uses a periodic inventory system. At the end of the annual accounting period, December 31, the accounting records for the most popular item in inventory showed the following:...
-
Subprime loans have higher loss rates than many other types of loans. Explain why lenders offer subprime loans. Describe the characteristics of the typical borrower in a subprime consumer loan.
-
The balance of a loan, B, after n monthly payments is given by where A is the loan amount, P is the amount of a monthly payment, and r is the yearly interest rate entered in % (e.g., 7.5% entered as...
-
315 people have to be transported using buses that have 37 seats. By typing one line (command) in the Command Window, calculate how many seats will remain empty if enough buses will be ordered to...
-
The fuel tank shown in the figure in shaped as a frustum of cone with r = 20 in., and H = 2r. Write a user-defined function (for the function name and arguments, use V = Volfuel (y)) that gives the...
-
The scientific name of a species (a) consists of two parts, the family name and the species name. (b) is always underlined. (c) is always in Latin. (d) includes only the species name.
-
Life would be impossible without bacteria because (a) they photosynthesize. (b) they function in decomposition. (c) they reproduce quickly. (d) they occupy habitats where no other organisms can...
-
Why are birds considered reptiles in an evolutionary classification system? (a) Feathers evolved from scales. (b) Birds are more similar to reptiles than was previously thought. (c) Birds are...
Study smarter with the SolutionInn App