Question
1-1 Using the JAVA language: Declare a variable called number 1 and initialize its value to 4. Declare a variable called number2 and initialize its
1-1 Using the JAVA language:
Declare a variable called number 1 and initialize its value to 4. Declare a variable called number2 and initialize its value to 5. Declare a variable called sum.
For each of the declared variables, select the appropriate data type.
Add the variables number1 and number2 and display the result to the console screen, using the following output: The sum of number1 and number2 is X, with X being the actual result.
1-2. Using the JAVA language:
Declare a string variable called number String and initialize this to a string value of 20. Convert this string value to an integer and store the converted value in a variable called number.
Declare a second integer variable called number2 and initialize to 10.
Divide number by number2 and print the result to the console screen, using the following output: the variable number divided by number2 is equal to X, with X being the actual result.
1-3. Using the JAVA language:
Declare two integer variables called num1 and num2 and initialize them to 25 and 5 respectively.
Perform the following mathematical operations and display the results to the screen:
A. Subtract num1 from num2. B. Subtract num2 from num1. C. Multiply num1 and num2. D. Divide num1 by num2. E. Increment the value of num1. F. Decrement the value of num2.
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