1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
andrew11 [14]
3 years ago
5

If the price of the car is less than or equal to your available cash, display "no". If the price of the car is more than your av

ailable, cash, display "yes".
Engineering
1 answer:
Ede4ka [16]3 years ago
7 0

Answer:

function decision(car_price, available_cash) {

   if(car_price <= available_cash) {

   console.log("no");

   }

   else  {

   console.log("yes");

   }

   }

decision(car_price, available_cash); or decision(available_cash, car_price);

Explanation:

using functions in Javascript:

functions; this refers to dividing codes into reusable parts.

e.g function function_name() {

console.log("How are you?");

}

you can call or invoke this function by using its name followed by parenthesis, like this: function_name(). each time the function is called it will   print out "How are you?".

Parameters: these are variables that act as placeholders for the values that are to be input into a function when it is called

Arguments: The actual values that input or passed into a function when it is called.

e.g

function function_name(parameter1, parameter2) {

console.log(parameter1, parameter2);

}

then we call function_name: function_name("please", "leave"):we have passed two arguments, "please"  and "leave". Inside the function parameter1 equals "please" while parameter2 equals "leave".

Hence, from the question given the two parameters "car_price" and "available_cash" respectively, we write the function with name function_name:

function decision(car_price, available_cash) {

   if(car_price <= available_cash) {

   console.log("no");

   }

   else  {

   console.log("yes");

   }

   }

decision(car_price, available_cash); or decision(available_cash, car_price);

You might be interested in
Economics is the study of how individuals and societies make choices under the condition of
k0ka [10]

Answer:

ig scarcity

Explanation:

Hope it Helps!!!

3 0
2 years ago
Which of the following is a common use for commas?
andreyandreev [35.5K]

Answer:

connecting two independent clauses

4 0
3 years ago
Read 2 more answers
True power can only be measured across what?
loris [4]

Answer: mets

Explanation: meets are good

6 0
3 years ago
Read 2 more answers
Technician A says automotive gasoline engines run on the 2 stroke principal. Technician B says Diesel engine hace less compressi
d1i1m1o1n [39]

Answer:

both are incorect

Explanation:

2 stroke principal is a mix of gasoline and engine oil a normal gasoline engine does not run on 2 stroke fuel

technician B is also wrong Diesel engines generally generate much higher compersion than gasoline engines

3 0
2 years ago
When you first start a car after it has been sitting for more than an hour, it pollutes up to ......times more than when the eng
lesya [120]
20 time more then when it’s warm
6 0
3 years ago
Read 2 more answers
Other questions:
  • A mass of 8000 kg of slightly enriched uranium (2% U-235, 98% U-238) is exposed for 30 days in a reactor operating at (6.18) hea
    5·1 answer
  • A pump is used to transport water from a reservoir at one elevation to another reservoir at a higher elevation. If the elevation
    5·1 answer
  • Annealing is a process by which steel is reheated and then cooled to make it less brittle. Consider the reheat stage for a 100-m
    14·1 answer
  • Buying shop supplies from the shop owner to work on your own car at home is an ethical practice.
    14·1 answer
  • Question 3. Assign boston_under_10 and manila_under_10 to the percentage of rides that are less than 10 minutes in their respect
    14·1 answer
  • A crystalline grain of aluminum in a metal plate is situated so that a tensile load is oriented along the [1 1 1] direction. Wha
    9·1 answer
  • Which of the following is an example of a social need?
    5·1 answer
  • Multilane roads use what to divide lanes of traffic moving in the same direction.
    14·2 answers
  • What is 39483048^349374*3948048/3i4u4
    15·1 answer
  • A 75-hp motor that has an efficiency of 91.0% is worn-out and is replaced by a motor that has a high efficiency 75-hp motor that
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!