Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions

Question

2. Compare the sales and service departments at Auto World.

Answered: 1 week ago