Ask Question

1. Assume a double variable named number has been defined. Write a statement that calculates 100 divided by 5 and assigns the result to the number variable.

2. Assume that three double variables named result, number1, and number2 have been defined, and have been assigned values. Write a statement that assigns the value of number1 multiplied by number2 to result.

3. Write a statement that defines a named constant named SPEED. The constant's data type should be int, and its value should be 75.

+2
Answers (1)
  1. 3 April, 22:58
    0
    public class num4 {

    public static void main (String[] args) {

    / / Question One

    double number = 100/5;

    / / Question Two

    double result = 0.0;

    double number1 = 0.0;

    double number2 = 0.0;

    result = number1*number2;

    / / Question Three

    final int SPEED = 75;

    }

    }

    Explanation:

    As required, the different variables are created in Java programming language.

    In question three the keyword final is used to indicate a constant in java since java does not have an implementation for constant values, final and static keywords are used for this purpose
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “1. Assume a double variable named number has been defined. Write a statement that calculates 100 divided by 5 and assigns the result to the ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers