Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Anonymous
Anonymous asked in Education & ReferenceHomework Help · 1 month ago

HELP ASAP - programming js?

A Local night Club is running a special on drinks. Write a program that calculates the profit of the club for the evening and if the desired profit is reached. Keeping in mind the following:

 The price of a cocktail is the length of its name. If the price of an order is an odd number, there is a 25% discount on the order price.

 Input: You will receive two parameters:

•First – the desired profit of the club-real number in the range [1.00... 15000.00]

•Second - An array of strings and numbers containing a pattern of the following: Name of the cocktail or command “Party!”

The number of cocktails for the order a whole number in the range [1... 50] 

The program will do calculations until the command "Party!" appears in the array or until the desired profit is reached. 

Output:

The expected output is a string containing:

•If the command "Party!" is read in before the desired profit is reached:

"We need {money needed} dollars more."

•If the desired profit is reached: "Target acquired." Then print:" 

Club income -{club's profit} dollars."

The money must be formatted to the second digit after the decimal point.

Function: 

function main(profitDesired, cocktailsAndAmounts){}

Attachment image

1 Answer

Relevance
  • Anonymous
    1 month ago

    MOVE TO HOMEWORK HELP DAMN CHEATER

Still have questions? Get your answers by asking now.