Need this in javascript 1 A company has determined that its

Need this in javascript

1. A company has determined that its annual profit is typically 23 percent of total sales. Write a program called sales_prediction.js, that displays the profit based on the project amount of total sales for the year. Use a literal value of $2,500,000 for the projected total sales amount. Display the profit amount formatted to two decimal places. 25 pts

2. One acre of land is equivalent to 43,560 square feet. Write a program called land_calculation.js that calculates the number of acres in the a tract of land based on the total square feet in a tract of land. Use a literal value of 348,480 for the total square feet. 25 pts

3. A customer in a store is purchasing five items. Write a program called total_purchase.js that creates five items with literal numeric values. The prices of the items should be as follows:

item 1: $9.99

item 2: $5.99

item 3: $.99

item 4: $59.50

item 5: $.25

It then calculates and displays the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 7 percent. Display the answer to two decimal places. 25 pts

Solution

sales_prediction.js

var projectedSales = 2500000;
var annualProfit = .23;

var projectedProfit = projectedSales * annualProfit;

console.log(\"The profit based on the projected total sales is: \" + projectedProfit.toFixed(2));

land_calculation.js

var oneAcre = 43560;
var totalSquareFeet = 348480;

var numberOfAcres = totalSquareFeet / oneAcre;

console.log(\"The total number of acres is: \" + numberOfAcres);

total_purchase.js

var item1 = 9.99;
var item2 = 5.99;
var item3 = 0.99;
var item4 = 59.50;
var item5 = 0.25;
var salesTax = 0.07;
var subtotal = 0;
var total = 0;

subtotal = item1 + item2 + item3 + item4 + item5;

total = subtotal + (subtotal * salesTax);

console.log(\"Your items cost this much: \");
console.log(item1.toFixed(2));
console.log(item2.toFixed(2));
console.log(item3.toFixed(2));
console.log(item4.toFixed(2));
console.log(item5.toFixed(2));
console.log(\"Your subtotal = $\" + subtotal.toFixed(2));
console.log(\"Sales tax = \" + (salesTax * 100).toFixed(0) + \"%\");
console.log(\"Your total with sales tax = $\" + total.toFixed(2));

Need this in javascript 1. A company has determined that its annual profit is typically 23 percent of total sales. Write a program called sales_prediction.js, t
Need this in javascript 1. A company has determined that its annual profit is typically 23 percent of total sales. Write a program called sales_prediction.js, t

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site