Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q1. Answer the questions about the following java programs: (50 points) public class MultiplyTwoNumbers public static void main(String[] args) { float first = 1.56 float
Q1. Answer the questions about the following java programs: (50 points) public class MultiplyTwoNumbers public static void main(String[] args) { float first = 1.56 float second - 2.07 float product = first second System.out.println("The product is:" + product). > 1. What is the class name of the above code? 2. How many local variables are defined in the above code? What are they? 3. What does the following code do? Explain 4. Using online fava compiler (such as Covida https://www.cavida.ia or Onlinegdb https://www.onlinegdb.com), run the above code and show the output? Q2. Answer the questions about the following java programs: (50 points) import java.util.Scanner public class HelloWorld public static void main(String[] args) // Creates a reader instance which takes // input from standard input keyboard Scanner reader = new Scanner(System.in); System.out.print("Enter a number:"); /extInt() reads the next integer from the keyboard int number = reader.nextInt(): // printin prints the following line to the output screen System.out.println("You entered number); 1. What is the name of the Scanner? 2. What does the above program do? Explain? 3. Using online Java compiler (such as Cuvida luttps://www.covid.io or Onlinegde https://www.onlinegdb.com.run the above code and show the output? 1. Rewrite the above code to read a double value instead of integer, run it and show the output using online compiler? Q1. Answer the questions about the following java programs: (50 points) public class MultiplyTwoNumbers public static void main(String[] args) { float first = 1.56 float second - 2.07 float product = first second System.out.println("The product is:" + product). > 1. What is the class name of the above code? 2. How many local variables are defined in the above code? What are they? 3. What does the following code do? Explain 4. Using online fava compiler (such as Covida https://www.cavida.ia or Onlinegdb https://www.onlinegdb.com), run the above code and show the output? Q2. Answer the questions about the following java programs: (50 points) import java.util.Scanner public class HelloWorld public static void main(String[] args) // Creates a reader instance which takes // input from standard input keyboard Scanner reader = new Scanner(System.in); System.out.print("Enter a number:"); /extInt() reads the next integer from the keyboard int number = reader.nextInt(): // printin prints the following line to the output screen System.out.println("You entered number); 1. What is the name of the Scanner? 2. What does the above program do? Explain? 3. Using online Java compiler (such as Cuvida luttps://www.covid.io or Onlinegde https://www.onlinegdb.com.run the above code and show the output? 1. Rewrite the above code to read a double value instead of integer, run it and show the output using online compiler
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started