Answer:
import java.util.Scanner;
public class ANot {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Please Enter the number of fuel gallons in the car's tank: ");
int numGallons = input.nextInt();
System.out.print("What is the fuel efficiency of your car in miles/gallon ");
double fuelEffi = input.nextDouble();
System.out.print("How much is the price per gallon: ");
double price = input.nextDouble();
double milesCanGo = fuelEffi*numGallons;
double numOfGallons100Miles = 100/fuelEffi;
System.out.println("The cost per 100 miles is "+numOfGallons100Miles*price);
System.out.println("Your car can go as far as "+milesCanGo+" miles with the current fuel " +
"in your tank");
}
}
Explanation:
Using Java programming language;
- Import the Scanner class to receive user input
- Prompt user to input numofGallons, fuelEfficiency and pricePerGallon
- Calculate the miles the car can go with the formula milesCanGo = numofGallons X fuelEfficiency
- Calculate the number of gallons for 100 miles distance (100/fuelEfficiency)
- The cost of driving 100 miles is (100/fuelEfficiency)*pricePerGallon
- Output cost for 100 miles and how far the car can go.
The correct answer is A: True
To capture a certain size frame of the persons face mainly to emphasize on who is talking
Answer:What are the issue and the conclusion?
What are the reasons?
What are the assumptions?
Are there any fallacies in the reasoning?
How good is the evidence?
Explanation:
Answer:
def listSum(mylist):
sum =0
for item in range(0,len(mylist)):
sum=sum+mylist[item]
print(sum)
Explanation:
Using the Python programming language, I defined a function as listSum that accepts a list as a parameter and returns the sum of the elements in the list.
The most important logic here is defining the range of elements in the list not to exceed the length of the list using the len function. Then using a for statement, we loop through each element and add them up to a sum variable initially assigned the value of 0.