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
Neporo4naja [7]
3 years ago
8

. In the U.S. fuel efficiency of cars is specified in miles per gallon (mpg). In Europe it is often expressed in liters per 100

km. Write a MATLAB userdefined function that converts fuel efficiency from mpg to liters per 100 km. For the function name and arguments, use Lkm
Engineering
1 answer:
ki77a [65]3 years ago
6 0

Answer:

MATLAB Code is written below with comments in bold, starting with % sign.

MATLAB Code:

function L = Lkm(mpg)

 L = mpg*1.60934/3.78541;  %Conversion from miles per gallon to km per   liter

 L = L^(-1);  %Conversion to liter per km

 L = L*100;   %Conversion to liter per 100 km

end

Explanation:

A function named Lkm is defined with an output variable "L" and input argument "mpg". So, in argument section, we give function the value in miles per gallon, which is stored in mpg. Then it converts it into km per liter by following formula:

L = (mpg)(1.60934 km/1 mi)(1 gallon/3.78541 liter)

Then this value is inverted to convert it into liter per km, in the next line. Then to find out liter per 100 km, the value is multiplied by 100 and stored in variable "L"

Test Run:

>> Lkm(100)

ans =

   2.3522

You might be interested in
Write a program to calculate overtime pay of 10 employees. Overtime is paid at the rate of Rs. 12.00
fgiga [73]

Answer:

Here is the code.

Explanation:

#include<stdio.h>

int main()

{

int i, time_worked, over_time, overtime_pay = 0;

for (i = 1; i <= 10; i++)

{

 printf("\nEnter the time employee worked in hr ");

 scanf("%d", &time_worked);

 if (time_worked>40)

 {

  over_time = time_worked - 40;

  overtime_pay = overtime_pay + (12 * over_time);

 }

}

printf("\nTotal Overtime Pay Of 10 Employees Is %d", overtime_pay);

return 0;

}

Output :

Enter the time employee worked in hr 42

Enter the time employee worked in hr 45

Enter the time employee worked in hr 42

Enter the time employee worked in hr 41

Enter the time employee worked in hr 50

Enter the time employee worked in hr 51

Enter the time employee worked in hr 52

Enter the time employee worked in hr 53

Enter the time employee worked in hr 54

Enter the time employee worked in hr 55

Total Overtime Pay Of 10 Employees Is 1020.

6 0
3 years ago
If you log into the admin account on windows 10, will the admin be notified ? ​
professor190 [17]

Answer:

Just message the Admin,

Ok.

6 0
3 years ago
Read 2 more answers
Which system provides an easier way for people to communicate with a computer than a graphical user interface (GUI)?
Fed [463]

Answer:

C.

Explanation:

Natural language processing or NLP can be defined as an artificial intelligence that aids computers to understand, interpret, and manipulate human language. NLP is subfiled of many disciplines, for instance, artifical intelligence, linguistics, computer science, etc. NLP helps computers to interact with humans in their own language.

So, the easier way through which people can communicate with computers apart from GUI is NLP. Thus option C is correct.

7 0
3 years ago
Vital role of maritime english among seaferers
seropon [69]

Answer:

uehgeg7djw7heidiisosowiuisiejei2k

8 0
3 years ago
The metal control joints used to relieve stresses caused by expansion and contraction in large ceiling or wall expenses in inter
timurjin [86]

Answer:

It’s called Expansion Joints

6 0
3 years ago
Other questions:
  • Main technologies used in atms vending machines game consoles and microwave ovens
    6·1 answer
  • A cylindrical specimen of brass that has a diameter of 20 mm, a tensile modulus of 110 GPa, and a Poisson’s ratio of 0.35 is pul
    13·1 answer
  • A six-lane freeway (three lanes in each direction) currently operates at maximum LOS C conditions. The lanes are 11 ft wide, the
    5·1 answer
  • Which of the code pieces below should replace the underline?public class Test{public static void main(String[] args){Test test =
    8·1 answer
  • "The office personnel at Garden Glory use a database application to record services and related data changes in this database. F
    9·1 answer
  • An inverting amplifier with +11 V supply voltages normally has a sinusoidal output of 10 Vpp. When checking the circuit with an
    11·1 answer
  • NASA’s Ames research center in Mountain View, California has a centrifuge built to simulate high-g environments. It spins horizo
    15·1 answer
  • potential difference is the work done in moving a unit positive charge from one point to another in an electric field. State Tru
    12·1 answer
  • Is an ideal way for a high school student to see what an engineer does on a typical day but does not provide a hands-on experien
    9·2 answers
  • Why do need engineer and architect​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!