Write a java program that initialize tge diplays values based on the table below. Print all the numbers as whole numbers. Name the class DisplayWholeNumbers.java
"Variable Name"
examScore
averageGrade
seconds_per_minute
length
referenceNumber
"Value"
87
84.67
60
29.7
998883723193101
public class DisplayWholeNumbers {
public static void main(String[] args) {
double examScore = 87;
double averageGrade = 84.67;
int seconds_per_minute = 60;
double length = 29.7;
long referenceNumber = 998883723193101L;
System.out.printf("examScore %.0f\n" , examScore);
System.out.printf("averageGrade %.0f\n" , averageGrade);
System.out.printf("seconds_per_minute %d\n" , seconds_per_minute);
System.out.printf("length %.0f\n" , length);
System.out.printf("referenceNumber %d\n" , referenceNumber);
}
}
Comments
Leave a comment