for num in range(4):
print(num)
The output will be:
0
1
2
3
The for loop iterates through the numbers in the range function and prints those same numbers to the console.
They mostly revolve of production of gas and oil.When a new reservoir is located,the engineers analyze it to determine if it can be exploited with profit.If so they create a drilling and extraction plan to pump out gas or oil as little as possible.
Answer:
import java.util.Scanner;
public class num8 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter the mass");
double mass = in.nextDouble();
double weight = calWeight(mass);
System.out.println("The weigth is "+weight);
}
static double calWeight(double mass){
double weight = mass*9.80665; // assume a = accelation due to gravity = 9.80665N
if(weight>500){
System.out.println("Too Heavy");
}
else if(weight<100){
System.out.println("Too Light");
}
return weight;
}
}
Explanation:
- Using Java programming language
- The main method is created to request and store a variable, mass in kilogram. The main method call calWeight() and passes the value for mass
- A method calWeight() is created that calculates the weight in newtons (mass * 9.8).
- The method checks if the weight is greater than 500 (prints too heavy) if less than 100(prints to light)
- Returns the weight
They act like a filter for info a person receives
A! Embroidery is the ornamentation of textiles using needle work