Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in netbeans IDE 8,2 Exercise 1: Modify the following program to fix syntax and logical errors. The program has to print the product and the

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedin netbeans IDE 8,2

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 number3 = 4 int product = 0; int sum= 0; sum=number1+2+3 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+y)/(xy-1) 2. (x^2+(y-4)*3)/y 3. (x+(x-y^2)-(x/y))*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 1 2 3 4 5 2 4 6 8 10 1 4 9 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

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

More Books

Students also viewed these Databases questions