Answer:
- import java.util.Scanner;
- public class TryToParseDouble {
-
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- double num;
-
- try{
- System.out.print("Input a number: ");
- num = Double.parseDouble(input.nextLine());
-
- }catch(NumberFormatException e){
- num = 0;
- System.out.println("Invalid input! It should be a number in double type");
- }
- System.out.println(num);
- }
- }
Explanation:
Firstly, create a Scanner object to get user input (Line 5).
Next, create a try block and prompt user to input a number and use Double.parseDouble() method to convert the input to double type in the block (Line 8-10).
Next, create a catch block to catch a NumberFormatException. In the Catch block, set the num to zero and then print out a message to inform user about the invalid input (Line 12-14).
Lastly, display the number (Line 16).
Answer:
Technician A
Explanation:
In the case of multiple-disc clutches, composite paper materials are very common. Since these multiple-disc clutches typically use an oil bath or flow-through cooling method for keeping the disc pack lubricated and cooled, very little wear is seen when using composite paper materials.
To create a computer network, you must have at least two computers. ... A protocol is a standard set of rules and procedures for the control of communications in a network. TRUE. Two computers using TCP/IP can communicate even if they are based on different hardware and software platforms. So your right :)
Hope this helps :)