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:
![Write a program in a script file that converts a quantity of force given in units of either lbf](https://dsd5zvtm8ll6.cloudfront.net/questions/2023/12/657abac6658a5_1702631991561.jpg)
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
-
Common Stockholders' Profitability Analysis A company reports the following: Net income Preferred dividends Average stockholders' equity $210,000 8,400 1,981,132 983,415 Average common stockholders'...
-
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...
-
The U.S. Department of Transportation reported that during November, 83.4% of Southwest Airlines' flights, 75.1% of US Airways' flights, and 70.1% of JetBlue's flights arrived on time (USA Today,...
-
A researcher fails to reject the null hypothesis with a regular two-tailed test using a 5 .05. If the researcher used a directional (one-tailed) test with the same data and the same alpha level, then...
-
The following mistakes were located in the books of Samrat Restaurant after its books were closed and a suspense A/c was created in order to get the trial balance agreed: (a) Sales day book was...
-
The account balances of Wilford Towing Service at June 30, 2016, follow Equipment...........$ 17,500 Office Supplies ........... 1,300 Notes Payable........... 6,900 Rent Expense........... 800...
-
If a company purchased inventory then how many of the following are correct? total assets would increase revenues would increase inventory would increase cost of goods sold would increase O2 04 1 3
-
Using, Exhibit 13-12, the balance sheet of Angelinas Jewelry Company at the end of July shown below, calculate all four financial ratios (quick, current, debt, and debt-to-equity) for the business....
-
4. Employment Insurance (Unemployment Insurance in the United States) provides a temporary income support to people who have lost their job through no fault of their own (they did not quit their job,...
-
Vaporization of mixtures of hexane and octane. Using the T-x-y diagram (Figure 1) on the next page, determine the temperature, amounts, and compositions of the vapor and liquid phases at 1 atm for...
-
what should p&g do to replace lafley when he retires a second time? what actions should they take to prepare for the succession?
-
What do these terms mean? What would be the currencies (one at a time) from two total UN Member States (other than the EURO, USD, JPY, GBP, or CHF). What would be the foreign currencies and how they...
-
How do social identity processes, such as categorization, identification, and comparison, influence team cohesion and performance within complex organizational environments ?
-
How do calculate sales forecast and expense forecast for several years
-
***rate of return is 5% Question 15 12.5 pts Consider two mutually exclusive projects with the following expected cash flows and a required rate of return of [depends on the last digit of student...
-
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...
-
If the interest rate is 5%, the 2-year discount factor is close to . a. 0.7 b. 0.9 c. 1.4 d. 1.8
-
If your investment pays the same amount at the beginning of each year for a period of 10 years, the cash flow stream is called a. An annuity. b. A perpetuity. c. A preference dividend. d. None of the...
-
A perpetuity is defined as: a. Equal cash flows at equal intervals of time forever. b. Equal cash flows at equal intervals of time for a specific period. c. Unequal cash flows at equal intervals of...
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App