Question: Double displacement, character ticketChar, and integer amountCalculated are read from input. Output the following: displacement as a floating - point value in scientific notation, followed

Double displacement, character ticketChar, and integer amountCalculated are read from input. Output the following:
displacement as a floating-point value in scientific notation, followed by "%".
ticketChar as a hexadecimal integer value, followed by "%".
amountCalculated as a decimal integer value, followed by "%".
End each output with a newline.
Ex: If the input is 40.75 t 73, then the output is:
4.075000e+01%
74%
73%
import java.util.Scanner;
public class OutputNotation {
public static void main(String[] args){
Scanner scnr = new Scanner(System.in);
double displacement;
char ticketChar;
int amountCalculated;
displacement = scnr.nextDouble();
ticketChar = scnr.next().charAt(0);
amountCalculated = scnr.nextInt();
/* Your code goes here */
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!