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
Identify renewable energy sources you will propose. Explain the key elements to your solution and the basic technical principles
MArishka [77]

Answer:

A renewable electricity generation technology harnesses a naturally existing energy. But they have other features that a few fringe customers value.

Explanation:

3 0
3 years ago
A ____ is either in the pressure reducer or in the downstream side of the system to ensure that the control air pressure does no
Alika [10]

Answer:

A relief valve is either in the pressure reducer or in the downstream side of the system to ensure that the control air pressure does not exceed about 30 psig.

3 0
1 year ago
Problem 3: Soil Classification using the AASHTO and USCS Systems
nataly862011 [7]

<u>Solution:</u>

Given\\                   \(\quad W=3000 Ib , \quad m=\frac{W}{g}=\frac{3000}{322} \ slug =93.1677 slug\)\\K_{e q}=2160 lbs / wp =2100 \frac{ lbs }{10} \frac{ x 12}{1 ft }=(2160 \times 12) lb / ft$$

a) The natural frequency

\begin{aligned}&\left(\omega_{n}\right)=\sqrt{\frac{K_{e q}}{m}}\\&=\sqrt{\frac{2160 \times 12}{93.1677}}\\&\omega_{n}=16.68 \text { rad } | s\\&\omega_{n}=\frac{2 \pi}{T}\\&16.68=\frac{2 \pi}{T}\\&T=0.3767 s\end{aligned}

b)

Given, \(t=10 s , \quad y(t)=6 in = A\)\\\(y(t)=A \cos \left(\omega_{n} t+\phi\right) \rightarrow 0\)\\\(6=6 \cos (16.68 \times 10+\phi)\)\\\(1=\cos (166.8+\phi)\)\\\(166.8+\phi=0\)\\\phi=-166.8\)\\At \(t=0, \quad y(0)=6 \cos (16.68 \times 0-166.8)\) {y(0)}=-5.74 in

5 0
2 years ago
What type of intersection is this?
mote1985 [20]
Diverging Diamond Interchange
6 0
3 years ago
In your Reader/Writer Notebook, write a short first-person narrative from the perspective of the bank clerk, describing her phys
guajiro [1.7K]
BAHHHHAHHH HOFHOFYOCIGC
5 0
3 years ago
Other questions:
  • What is the main role of matrix in composites! a)-to transfer stress to the other phases b)- to protect phases from environment
    7·1 answer
  • A decorative fountain was built so that water will rise to a hieght of 8 feet above the exit of the pipe. the pipe is 3/4 diamet
    5·1 answer
  • A 220-V electric heater has two heating coils that can be switched such that either coil can be used independently or the two ca
    15·1 answer
  • How will the proposed study contribute to your career?*<br>(quantity Surveying​
    11·1 answer
  • How many astronauts work<br> in the International Space Station
    7·1 answer
  • Technician A that shielding gas nozzles may have different shapes. Technician B says that gelding gas nozzles is attached to the
    8·1 answer
  • Work to be performed can come from the work package level of the work breakdown structure as well as other sources. Which of the
    11·1 answer
  • What is the difference between the elements of design and the principles of design? Define at
    7·1 answer
  • What were some of the challenges to safety resulting from such radical airframe designs as highly swept wings, high wing loading
    15·1 answer
  • Select the correct answer. Which of the following devices is a simple machine? A.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!