Answer:
import java.util.Scanner;
public class ANot {
public static void main(String[] args) {
Scanner in = new Scanner (System.in);
System.out.println("How many cookies did you eat today");
int numOfCookies = in.nextInt();
double numCalories = (numOfCookies*300)/4;
System.out.println("The total number of calories you consumed in "+numOfCookies+" cookies is " +
" "+numCalories);
}
}
Explanation:
This code is implemented in Java.
- We know from the question that 4 cookies contain 300 calories
- Therefore number of calories consumed = (number of cookies eaten*300)/4
- To implement this in java we used the scanner class to prompt user for the input
- save the input to a variable and write mathematical expression for the number of calories consumed
- Then output the result
We call it
functional dependencies.
A functional dependency which is also commonly known as a
database dependency occurs in a database when info stored in the same database
determines other information stored in the same table. Knowing the value of a
set of attribute is enough to tell you the value of another set of attributes.
I know of four,
Left-aligned
Center-aligned
right-aligned
justified
This is true for most modern computers