Answer:
The second option is correct.
Explanation:
Be aware that the answer you have chosen is center align, the other wrong choices are right-aligned and justified which gives the second option the correct one.
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
Answer:
The answer to this question is the option "a".
The statement for opening file can be given as:
inFile.open("progdata.dat");
Explanation:
In the above statement, this statement is part of the c++ programming language. To open any file we use the following syntax that can be given as:
Syntax:
inFile.open(filename, mode);
In the above syntax inFile.open() is a function that opens the file. In this function, we pass two parameters that are filename, mode. Where filename is the name of the file which we want to open. In the filename, we write file names with the path of the file like(C:\Users\Public\Music\Sample Music\abc.dat) where (C:\Users\Public\Music\Sample Music) is the path of the file and (abc.dat) is a file name. In the mode parameter, it provides the mode in which we want to open a file. There are two types of read mode and write mode. The default mode is read mode.
Almost always fake news or fake information.