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
In a right triangle, the square of the length of one side is equal to the sum of the squares of the lengths of the other two sid
Dovator [93]

Answer:

C++ code is explained below

Explanation:

/Remove the following line

//if not using visual studio.

#include "stdafx.h"

//Import the required header files.

#include <iostream>

using namespace std;

//Define the main function.

int main(void)

{

    //Define the variables.

    double side1, side2, side3;

    //Prompt the user to enter the sides of the triangle.

    cout << "Enter the side of the triangle:" << endl;

    cout << "Enter first side of triangle:" << endl;

    cin >> side1;

    cout << "Enter second side of triangle:" << endl;

    cin >> side2;

    cout << "Enter third side of triangle:" << endl;

    cin >> side3;

    cout << endl;

    //Check if the triangle sides are valid

    if ((side1 + side2 > side3) &&

         (side1 + side3 > side2) &&

         (side2 + side3 > side1))

    {

         //Check the condition for right angle triangle

         if ((side3*side3 == (side1*side1 + side2*side2)) ||

             (side2*side2 == (side3*side3 + side1*side1)) ||

             (side1*side1 == (side3*side3 + side2*side2)))

//Display that the triangle is right-angled triangle.

             cout << "It is a right-angled triangle." << endl;

         else

//Display that the triangle is not the right-//angled triangle.

             cout << "It is not a right-angled triangle."

<< endl;

    }

    else

         //Display not the valid side.

         cout << "Not a valid side." << endl;

    //Remove the following line if

    //not using visual studio.

    system("pause");

    return 0;

}

8 0
3 years ago
It describes the physical and social elements common to this work. Note that common contexts are listed toward the top, and less
QveST [7]

Answer:

BCDE

Explanation:

just look at the link, it tells you.

7 0
3 years ago
Read 2 more answers
Water flows with a velocity of 3 m/s in a rectangular channel 3 m wide at a depth of 3 m. What is the change in depth and in wat
strojnjashka [21]

Answer: new depth will be 3.462m and the water elevation will be 0.462m.

The maximum contraction will be achieved in width 0<w<3

Explanation:detailed calculation and explanation is shown in the image below

8 0
3 years ago
Modify any of the previous labs which would have crashed when non-numeric data was entered by adding exception handling so that
Mashutka [201]

Answer:

see explaination

Explanation:

import java.util.InputMismatchException;

import java.util.Scanner;

public class calculate {

static float a=0,b=0;

double cal()

{

if(a==0||b==0)

{

System.out.println("no values found in a or b");

start();

}

double x=(a*a)+(b*b);

double h=Math.sqrt(x);

a=0;

b=0;

return h;

}

float enter()

{

float val=0;

try

{

System.out.println("Enter side");

Scanner sc1 = new Scanner(System.in);

val = sc1.nextFloat();

return val;

}

catch(InputMismatchException e)

{

System.out.println("Enter correct value");

}

return val;

}

void start()

{

calculate c=new calculate();

while(true)

{

System.out.println("Enter Command");

Scanner sc = new Scanner(System.in);

String input = sc.nextLine();

switch(input)

{

case "A":

a=c.enter();

break;

case "B":

b=c.enter();

break;

case "C":

double res=c.cal();

System.out.println("Hypotenuse is : "+res);

break;

case "Q":

System.exit(0);

default:System.out.println("wrong command");

}

}

}

public static void main(String[] args) {

calculate c=new calculate();

c.start();

}

}

7 0
3 years ago
Mohr's circle represents: A Orientation dependence of normal and shear stresses at a point in mechanical members B The stress di
blsea [12.9K]

Answer:

The correct answer is A : Orientation dependence of normal and shear stresses at a point in mechanical members

Explanation:

Since we know that in a general element of any loaded object the normal and shearing stresses vary in the whole body which can be mathematically represented as

\sigma _{x'x'}=\frac{\sigma _{xx}+\sigma _{yy}}{2}+\frac{\sigma _{xx}-\sigma _{yy}}{2}cos(2\theta )+\tau _{xy}sin(2\theta )

And \tau _{x'x'}=-\frac{\sigma _{xx}-\sigma _{yy}}{2}sin(2\theta )+\tau _{xy}cos(2\theta )

Mohr's circle is the graphical representation of the variation represented by the above 2 formulae in the general oriented element of a body that is under stresses.

The Mohr circle is graphically displayed in the attached figure.

4 0
3 years ago
Other questions:
  • In this milestone we will create a Course class to represent a course and display its information on the screen. We will create
    9·1 answer
  • Explain how a CO2 cartridge powers the dragster you will be building. A good website to use is How Stuff Works. (howstuffworks.c
    5·2 answers
  • An aluminium alloy bar of diameter 12.5 mm and length 27 m loaded in uniaxial tension to a force of 3 kN. Determine the length o
    15·1 answer
  • In the 5 Code of Federal Regulations (C.F.R.), it is recommended that an individual has security awareness training before s/he
    8·2 answers
  • when a metal, such as lead, is oxidied (loses electrons) to form a positive ion (cation), how does he solubility change?
    14·1 answer
  • Explain the use of remote sensing in surveying.​
    8·1 answer
  • An aircraft component is fabricated from an aluminum alloy that has a plane strain fracture toughness of 40 MPa . It has been de
    7·1 answer
  • Summarize three attributes that are important for an engineer to possess.
    13·1 answer
  • Which of these is an example of a service job?
    7·1 answer
  • Which of the following activities can help expand engineers' creative thinking capabilities?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!