Question: in java se you need to code it in the app Exercise 1: Modify the following program to fix syntax and logical errors. The program



in java se you need to code it in the app
Exercise 1: Modify the following program to fix syntax and logical errors. The program has to print the product and the sum of 3 integers. public class ThreeNumberPs. public static void main(String args) { int number1= 2 number2 = 3 int number 3 - 4 int product-0; int sum = 0; sum=number1+243 product = (number1 + Number2) number3; System.out.print("The product is" + "product"); System.out.print("The sum is" Sum); The output has to be as the following: The product is 24 The sum is 9 Exercise 2: Write a Java program to display the following shape. * * *** *** *** Exercise 3: if x=2 and y=4, write a program to calculate and print output: 1. (x+yl/xy-1) 2. (X^2+(v-4)*3)/ 3. (x+(x-y^2)-(x/\*x Exercise 4: Write a java program that calculates the doubles and squares of the numbers from 1 to 5 and prints the resulting values in a table format, as shown below. Num Double Square 2 4 1 4 1 2 3 4 & 10 16 25 Exercise 5: Write a program which calculates and prints the monthly paycheck for an employee. The net salary is calculated after taking the following deductions: Federal Income Tax: 15% State Tax: 3.5% Retirement Plan: 5% Health Insurance: 7.5% if gross amount is 10000, your program output should be like this: Gross Amount: Federal Income Tax: State Tax: Retirement Plan: Health Insurance: Net Salary: 10000.00 AED 1500.00 AED 350.00 AED 500.00 AED 750.00 AED 6900.00 AED
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
