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
Bas_tet [7]
3 years ago
5

Write multiple if statements

Engineering
1 answer:
Tatiana [17]3 years ago
3 0

Code:

#include <iostream>

using namespace std;

int main()

{

  int Car_Year;

  cout<<"Please Enter the Car Model."<<endl;

  cin>>Car_Year;    

 if (Car_Year<1967)

 {

cout<<"Few safety features."<<endl;

 }

else if (Car_Year>1971 && Car_Year<=1991)

{

cout<<"Probably has head rests."<<endl;

}

else if (Car_Year>1991 && Car_Year<=2000)

{

cout<<"Probably has antilock brakes."<<endl;

}

else if (Car_Year>2000)

{

cout<<"Probably has airbags."<<endl;

  }

else

{

cout<<"Invalid Selection."<<endl;

}

  return 0;

}

Output:

Please Enter the Car Model.

1975

Probably has head rests.

Please Enter the Car Model.

1999

Probably has antilock brakes.

Please Enter the Car Model.

2005

Probably has airbags.

Please Enter the Car Model.

1955

Few safety features.

Explanation:

We were required to implement multiple If else conditions to assign car model year with the corresponding features of the car.

The code is tested with a wide range of inputs and it returned the same results as it was asked in the question.

You might be interested in
Describe the steps, tools, and technology needed in detail and
Mumz [18]

Answer:

Mass production methods are based on two general principles: (1) the division and specialization of human labour and (2) the use of tools, machinery, and other equipment, usually automated, in the production of standard, interchangeable parts and products.

Explanation:

Step 1: Product Concept. This is where you begin to flesh out your basic idea. ...

Step 2: Research. ...

Step 3: Product Design Development. ...

Step 4: Research and development of the final design. ...

Step 5: CAD. ...

Step 6: CAM. ...

Step 7: Prototype Testing. ...

Step 8: Manufacturing.

8 0
3 years ago
The variation of the pressure of a fluid with density at constant temperature is known as the _____.
qaws [65]

The variation of the pressure of a fluid with density at constant temperature is known as the coefficient of compressibility.

<h3>What is a compressor?</h3>

A compressor can be defined as a mechanical device that is designed and developed to provide power to refrigerators, air conditioners, and other heating or cooling mechanical devices (engines), especially by increasing the pressure on air or other applicable gases.

In an isothermal process, the coefficient of compressibility is also known as isothermal compressibility or compressibility and it refers to a measure of the variation of the pressure and relative volume of a fluid with density at constant temperature.

Read more on coefficient of compressibility here: brainly.com/question/25237713

#SPJ1

7 0
2 years ago
!!!!!!!!!!!!!!PLEASE ANSWER THIS!!!!!!!!!!!!!!!!
dmitriy555 [2]

Answer:

age = int(input())

ticket = 100

total = 0

passengers = 1

while passengers <= 5:

if age < 3:

 continue

else:

 total += ticket

passengers += 1

print(total)

Explanation:

UuU

6 0
2 years ago
Coulomb's Law Two point charges experience an attractive force of 10.8 N when they are separated by 2.4 m. VWhat force in newton
SashulF [63]

Answer:

The force between the charges when the separation decreases to 0.7 meters equals 126.955 Newtons

Explanation:

We know that for two point charges of magnitude q_{1},q_{2} the magnitude of force between them is given by

F=\frac{k_{e}q_{1}\cdot q_{2}}{r^{2}}

where

k_{e} is constant

r is the separation between the charges

Initially when the charges are separated by 2.4 meters the force can be calculated as

F_{1}=\frac{k_{e}\cdot q_{1}q_{2}}{2.4^{2}}\\\\10.8=\frac{k_{e}\cdot q_{1}q_{2}}{2.4^{2}}\\\\\therefore k_{e}\cdot q_{1}q_{2}=10.8\times 2.4^{2}=62.208

Now when the separation is reduced to 0.7 meters the force is similarly calculated as

F_{2}=\frac{k_{e}\cdot q_{1}q_{2}}{0.7^{2}}

Applying value of the constant we get

F_{1}=\frac{62.208}{0.7^{2}}

Thus F_{2}=126.955Newtons

5 0
3 years ago
Implement the function lastChars() that takes a list of strings as a parameter and prints to the screen the last character of ea
Liono4ka [1.6K]

Answer:

The following program is in C++.

#include <bits/stdc++.h>

using namespace std;

void lastChars(string s)

{

   int l=s.length();

   if(l!=0)

   {

       cout<<"The last character of the string is: "<<s[l-1];

   }

}

int main() {

   string s;//declaring a string..

   getline(cin,s);//taking input of the string..

   lastChars(s);//calling the function..

return 0;

}

Input:-

Alex is going home

Output:-

The last character of the string is: e

Explanation:

In the function lastChars() there is one argument that is a string.I have declared a integer variable l that stores the length of the string.If the length of the string is not 0.Then printing the last character of the string.In the main function I have called the function lastChars() with the string s that is prompted from the user.

8 0
3 years ago
Other questions:
  • Pineapple contains about 20 wt% solid and the balance water. To make pineapple jam, crush
    11·1 answer
  • (Metric) Given the front and right views, create an AutoCAD isometric of the object. Save the drawing as lab5c.dwg. Grid size is
    8·1 answer
  • Consider a normal shock wave in air. The upstream conditions are given by M1=3, p1 = 1 atm, and r1 = 1.23 kg/m3. Calculate the d
    15·1 answer
  • Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90)
    6·1 answer
  • Who want to 1v1 lol unblocked games 76 with me
    5·2 answers
  • In Lab 7, we worked through a program that displayed the homeless shelter occupancy over time. The same approach can be used for
    14·1 answer
  • A plot of land is an irregular trangle with a base of 122 feet and a height of 47 feet what is the area of the plot?
    13·1 answer
  • The ______ cycle begins with the new moon.
    10·1 answer
  • A piece of corroded steel plate was found in a submerged ocean vessel. It was estimated that the original area of the plate was
    14·1 answer
  • You are using a Jupyter Notebook to explore data in a DataFrame named productDF. You want to write some inline SQL by using the
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!