The document provides instructions for three Java programming activities:
1. Declare variables with given data types and initial values and output their names and values.
2. Get the sum of three numbers by declaring variables for the numbers and the sum.
3. Output the highest of three given numbers by declaring the variables and using conditional operators.
The document provides instructions for three Java programming activities:
1. Declare variables with given data types and initial values and output their names and values.
2. Get the sum of three numbers by declaring variables for the numbers and the sum.
3. Output the highest of three given numbers by declaring the variables and using conditional operators.
1. Create a Java Class named “IT233_JavaActivity2_1”.
Given the table below, declare the following variables
with the corresponding data types and initialization values. Output to the screen the variable names together with the values. Variable Name Data Type Initial Value number integer 10 letter character a result boolean true str String hello The following should be the expected screen output,
number = 10 letter = a result = true str = hello
2. Create a Java Class named IT233_JavaActivity2_2. Create a program
That gets the sum of three numbers. Let the values of the three numbers Be: 10, 20, 45. The expected output is,
number 1 = 10 number 2 = 20 number 3 = 45 sum is = 75
3. Create a Java class named IT233_JavaActivity2_3. Given three numbers,
Write a program that outputs the number with the greatest value among the three. Use the conditional operator ?: that we have studied so far (HINT: You will need to use two sets of ?: to solve this problem). Given the numbers 10, 23 and 5, your program should output,
Number 1= 10 Number 2 = 23 Number 3 = 5 The highest number is = 23
Solution Manual for Java How to Program, Early Objects (11th Edition) (Deitel: How to Program) 11th Edition - Latest Version Can Be Downloaded Immediately
Solution Manual for Java How to Program, Early Objects (11th Edition) (Deitel: How to Program) 11th Edition - Complete Set Of Chapters Available For Instant Download