Question
Java coding 1. (0.12 point) An integer variable called myInteger and has initial value 3, output to the console the value of the variable using
Java coding
1. (0.12 point) An integer variable called myInteger and has initial value 3, output to the console the value of the variable using System.out.println ("The integer value is " + integer); 2. (0.12 point) Create a double variable myDouble that is equals to myInteger/2 show the result of the division and explain the results. 3. (0.21 point) A float variable called decimalFloat and has initial value 1. 0000009F; (note all float variable needs F by the value) print out the value of decimalFloat using System.out.println() command. Create a decimalDouble variable and has initial value same as decimalFormat and print out the value of decimalDouble using System.out.println() command. Notice the change of the displayed values from the decimalFormat value. 4. (0.16 point) A float variable oneThird1 and has initial value 1/3 and print out the value of oneThird using System.out.println(), how explain why the decimal portion been lost also explain how to use casting to show the decimal. 5. (0.18 point) Declare a char variable firstnameinitial and has initial value r(you could use your initial instead of O) and print out the value firstnameinitial using System.out.println() Declare another character character1 and assign the decimal code 114, output the result using System.out.println and explain the 2 printed characters values in the part 6. (0.08 point) Create a boolean variable greaterNumber,and has initial value true and print out the value reaterNumber using System.out.println()
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