Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Lab 1. Get familiar with NetBeans IDE and definitions of classes. due today 11:5

ID: 3784143 • Letter: L

Question

Lab 1. Get familiar with NetBeans IDE and definitions of classes. due today 11:59pm. use NetBeans to create a new project named Lab_l. When you create the project, a class called Lab_1 will be created with a main method. add a new java file: a java class to your project named Calculation.java In this class. Define a constructor four functions: add. subtract, multiply, and divide, (do NOT define these methods as static methods) Optional requirement: keep two decimals for the division result. In the main method at Lab_1 class, ask users from input and calculate the addition, subtraction, multiplication, and division of these numbers, and your program should not allow division by zero. Submission: submit the source code of all your .java files in a .zip format (find your project location and right click it, select send to compressed folder) and a screenshot of the results (use snipping tool for screenshot).

Explanation / Answer

import java.awt.*; import java.awt.event.*; import java.applet.*; /* */ public class Cal extends Applet implements ActionListener { String msg=" "; int v1,v2,result; TextField t1; Button b[]=new Button[10]; Button add,sub,mul,div,clear,mod,EQ; char OP; public void init() { Color k=new Color(120,89,90); setBackground(k); t1=new TextField(10); GridLayout gl=new GridLayout(4,5); setLayout(gl); for(int i=0;i