function name (price, qty, taxRate) a. Three numbers (decimal values) are passed to this function. First...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
function name (price, qty, taxRate) a. Three numbers (decimal values) are passed to this function. First parameter holds the unit price of an item. Second parameter holds the quantity ordered and last parameter holds the tax rate to be applied. Your task is to calculate the subtotal, tax, total cost and display your output in console as in sample below (values should be rounded to two decimal place for display purposes): Sample output when values (2.65, 3, 0.1) are passed to this function: Sub total: $7.95, Tax: $0.79, Total: $8.74 function name (num, multiplyBy) a. Use the digits of first number passed to this function to multiply by the second number passed to the function and display the results separated by comma (as shown in sample below) as one string. Sample output when (123, 3) were passed to this function: 3, 6, 9 function name (date) b. If date passed to the function is in the passed, display how many day is passed and if it is in the future, display how many days left to that date. Pay attention to the singular & plurar day vs days when is more than one day Sample output when a future date is passed to this function: There is 3 days left to that date Sample output when a date in the past is passed to this function: That day was 1 day ago function name (str) a. This function receives an string. Your task is to find all even numbers (digits) and sum them up then display the total value in console. For example if following string is passed to this function "112, sf34, 4)-k)" Result should be: The sum of all even numbers: 10 function name (str) a. This function receives an string. Your task is loop through the each character of the string and separate all digists/letters/special characters. Display all digits at the beginning, followed by letters then the special chars and display result in console. For example if following string is passed to this function "ha1m2i3:n)" Result should be: 123hamin:) function name (num, str). a. The digits of the first number will be Added or Multiplied based on the string passed (add/multiply) and display the results in the console. For example if the string (1234, "add") is passed to this function. Result should be: The sum of 1234 is 10. if followings are passed to this function (1234, "Multiply") Result should be: The product of 1234 is 24. function name (list) a. Create an unordered list where items are the elements of array passed to this function. For example if array ["A", "B", "C", "D"] is passed to this function, your output would be <ul><li>A</li><li>B</li><li>C</li><li>D</li></ul> function name (price, qty, taxRate) a. Three numbers (decimal values) are passed to this function. First parameter holds the unit price of an item. Second parameter holds the quantity ordered and last parameter holds the tax rate to be applied. Your task is to calculate the subtotal, tax, total cost and display your output in console as in sample below (values should be rounded to two decimal place for display purposes): Sample output when values (2.65, 3, 0.1) are passed to this function: Sub total: $7.95, Tax: $0.79, Total: $8.74 function name (num, multiplyBy) a. Use the digits of first number passed to this function to multiply by the second number passed to the function and display the results separated by comma (as shown in sample below) as one string. Sample output when (123, 3) were passed to this function: 3, 6, 9 function name (date) b. If date passed to the function is in the passed, display how many day is passed and if it is in the future, display how many days left to that date. Pay attention to the singular & plurar day vs days when is more than one day Sample output when a future date is passed to this function: There is 3 days left to that date Sample output when a date in the past is passed to this function: That day was 1 day ago function name (str) a. This function receives an string. Your task is to find all even numbers (digits) and sum them up then display the total value in console. For example if following string is passed to this function "112, sf34, 4)-k)" Result should be: The sum of all even numbers: 10 function name (str) a. This function receives an string. Your task is loop through the each character of the string and separate all digists/letters/special characters. Display all digits at the beginning, followed by letters then the special chars and display result in console. For example if following string is passed to this function "ha1m2i3:n)" Result should be: 123hamin:) function name (num, str). a. The digits of the first number will be Added or Multiplied based on the string passed (add/multiply) and display the results in the console. For example if the string (1234, "add") is passed to this function. Result should be: The sum of 1234 is 10. if followings are passed to this function (1234, "Multiply") Result should be: The product of 1234 is 24. function name (list) a. Create an unordered list where items are the elements of array passed to this function. For example if array ["A", "B", "C", "D"] is passed to this function, your output would be <ul><li>A</li><li>B</li><li>C</li><li>D</li></ul>
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Complete Inventory Table A for total cost of purchases, goods available for sale, cost of goods available for sale, and ending inventory using the specific inventory method. Total retail value is...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Another liability that employers have is that of unemployment insurance. Class, let's talk about this a little more. At what levels are unemployment liabilities incurred? What are some additional...
-
Repeat Exercise 33 "Pulse Rates" using modified boxplots. Identify any outliers as defined in Part 2 of this section. Exercise 33 Use the same scale to construct boxplots for the pulse rates of males...
-
Contrast the following four returns on durable assets: (a) rent on land, (b) rental of a capital good, (c) rate of return on a capital good, and (d) real interest rate. Give an example of each.
-
An investigator collects a sample of a radioactive isotope with an activity of \(370,000 \mathrm{~Bq}\). 48 hours later, the activity is 120,000 Bq. What is the half-life of the sample?
-
F.J. Brewerton Retailers, Inc., must decide whether to build a small or a large facility at a new location in south Texas. Demand at the location will either be low or high, with probabilities 0.4...
-
can somebody help me draw this E/R model into this type ? need this type of chart , can kindly send a photo, no explanation Product Transaction Product ID INT Transaction ID INT Item Purchased...
-
2. (a) Using the polar coordinates evalute // Va + y? dA, where S is the upper half circle of radius 1.
-
Purpose : Moral and ethical implications must always be considered in professional practice. Post: You move into a new position as a Speech Language Pathologist (SLP) in an elementary school. The...
-
A stationery company plans to launch a new type of indelible ink pen. The machinery used for producing the new pen will cost the company $3.5 million to build. The estimated revenue of the new pen is...
-
Suppose that you have inherited a perpetuity that will pay $ 822 each year. Assuming the first payment will occur one year from now and that the annual opportunity cost of capital is 3%, what is the...
-
Write full and complete paragraphs and no less than 3 full and complete sentences in each paragraph: 1. Compare and contrast, How attending wayne county community college is With schools in africa,...
-
Describe how to encourage collaboration resulting in the empowerment of your team. o Include specific examples of approaches you will take to encourage collaboration.
-
Following is an excerpt from a footnote from the Soft-Drink Company 2016 annual report: NOTE10: DEBT AND BORROWING ARRANGEMENTS Short-Term Borrowings Loans and notes payable consist primarily of...
-
Open Text Corporation provides a suite of business information software products. Exhibit 10-9 contains Note 10 from the companys 2013 annual report detailing long-term debt. Required: a. Open Text...
-
A company can introduce only one new product from three available. If it estimates the following data, which product would you recommend?
-
Devise a scheme for doctors to assess how bad a stomach pain is.
-
You believe that the average weight of a piece of equipment is more than 3,500 pounds. To test this, you sample the weights of 15 of them, and find an average of 3,531 pounds. Assuming a Normal...
-
Sheds Ahead Ltd produces outdoor sheds for domestic use. The manager in charge of production has been asked to prepare a production budget, a direct materials budget and a direct labour budget for...
-
Sami Stitches Ltd produces two types of sewing machines, a standard model and a deluxe model. The budgeted factory overhead costs for the production operation during 2020 are as follows. Production...
-
Gasmania Pty Ltd produces patio heaters for household use. The following information has been gathered so that a production budget, a direct materials budget and a direct labour budget for part of...
Study smarter with the SolutionInn App