Mr. Sharma designs interest calculator for compound interest and amount due in Java NetBeans.

Q23. Mr. Sharma of ICICI Bank frequently needs to calculate the interest and amount due for his clients. He asks his software programmer to design an interest calculator which will calculate the compound interest and amount due. The bank offer two different accounts fixed deposit and recurring deposit with different rate criteria. The programmer uses Java language with NetBeans IDE to develop this:

 

There is a JPanel containers which is used for Account Type:

  • jRadioButton1 : Fixed Deposit(optFD) with buttonGroup1.
  • jRadioButton2 : Recurring Deposit(optRD) with buttonGroup1.

and a jCheckBox1 control for Sr.Citizen(chkSR). Read More …

Java Netbeans program in which Mr. Vidyarthi has to calculate percentage and grade for medical and non-medical streams.

Q22. Mr. Vidyarthi works in Blossoms Public School as a programmer. He is required to develop a student record. The school offers two different streams: medical and non-medical, with different grading criteria. The school also offers incentive to the NCC cadets in the form of a 3% increment in percentage for all the NCC cadets. The grading criterion for the two streams is given below:

Stream Percentage Grade
 

Medical

>=80 A
60-79 B
< 60 C
 

Non-Medical

>=75 A
50-74 B
< 50 C

There is JPanel a container which is used for Medical and Non-Medical:

  • jRadioButton1 : Medical(OptMed) with buttonGroup1.
  • jRadioButton2 : Non-Medical(OptNMed) with buttonGroup1.
  • jCheckBox1 : NCC Cadet(chkNCC).

Read More …

Java Netbeans program in which ABN Shipment Corporation imposes charges on Wholesaler and Retailers.

Q21. ABN Shipment Corporation imposes charges to customers for different products. The shipment company costs for an order in two forms: Wholesalers and Retailers. The cost is calculated on unit basis as follows:

For Units Price for Wholesaler

(per unit)

Price for Retailers

(per unit)

1-15 Rs 50/- Rs 60/-
16-20 Rs 45/- Rs 55/-
21-30 Rs 40/- Rs 50/-
31-50 Rs 35/- Rs 45/-
>50 Rs 30/- Rs 40/-

 

Special customer (named as chkSpecial JCheckBox Control) are given a discount of 10 %. The Following is the screen used to calculate Net Amount for an order:

A JLabel contains customer type as Wholesalers and Retailers as opteWhole and optRetail jRadioButton. User will enter the Units Order(txtUnit). Discount named as txtDisc JTextField.

  1. Write the code to disable the text boxes txtTotal and txtDisc and Wholesaler as default option when the form is active.
  2. Write the code for Calculate Amount Button to
  3. Display the discounted price in txtDisc if Special customer is selected.
  4. Display Net Amount.(Total cost=order unit * per unit price)
  5. Write the code for clear and Exit Button to
  6. Clear all Text Field and select wholesaler as default and uncheck special customer if is it.   

Read More …

Application for Username and Password.

Q19. Design a Java NetBeans GUI application for checking Username and  Password.

Sol:

Create a GUI application as per following screenshot.

Code For Log In

Type the following code by double clicking jButton1, button, below the line that says, ‘// TODO add your handling code here’

 

String user;

user=jTextField1.getText();

String pwd;

pwd=new String(jPasswordField1.getPassword());

if(user.equals(“CHB”) && pwd.equals(“root”))

JOptionPane.showMessageDialog(null,”Log In Successfull”);

else

JOptionPane.showMessageDialog(null,”Invalid Username or Password”);

}

Output:

 

Count Lowest to Highest.

Q18. Design a Java Netbeans 6.5.1 GUI application having interface as shown below :

 The loop for the frame should print numbers from lowest to highest on the basis of given two numbers, upon clicking at “Count” button.

Sol:

Type the following code by double clicking jButton2, button, below the line that says, ‘// TODO add your handling code here’

 

 

int num1,num2;

num1=Integer.parseInt(jTextField1.getText()); Read More …

Simple Interest Programme.

Q16. Design Java Netbeans 6.5.1 an application that accepts principal amount, rate of interest and time from the user. Then it computes the simple interest and displays it.

Sol:

Create a GUI application as per following screenshot.

Type the following code by double clicking Button1, button, below the line that says, ‘// TODO add your handling code here’

jTextField1.setText(“”);

jTextField2.setText(“”);

jTextField3.setText(“”);

jTextField4.setText(“”);

jTextField5.setText(“”);

}

Type the following code by double clicking Button2, button, below the line that says, ‘// TODO add your handling code here’

double prin,rate,time,sim,total;

prin=Double.parseDouble(jTextField1.getText());

rate=Double.parseDouble(jTextField2.getText());

time=Double.parseDouble(jTextField3.getText());

sim=(prin*rate*time)/100;

jTextField4.setText(sim+””);

total=prin+sim;

jTextField5.setText(total+””);

}

Type the following code by double clicking Button3, button, below the line that says, ‘// TODO add your handling code here’

System.exit(0);

}

Output:

Students Result in JAVA NETBEANS IDE 6.5.1

Q15. Design an application in JAVA NETBEANS IDE 6.5.1 to prepare students result on the basis of marks entered.

Sol:

Create a GUI application as per following screenshot.

 

Type the following code by double clicking  jButton1 , button, below the line that says, ‘// TODO add your handling code here’

jTextField1.setText(“”);

jTextField2.setText(“”);

jTextField3.setText(“”);

jTextField4.setText(“”);

jTextField5.setText(“”);

jTextField6.setText(“”);

jTextField7.setText(“”); Read More …

Boiling Point Of Water(if…else)

Q14. Program to obtain boiling point of water from user and report whether the user has entered the correct answer or not. Make use of if…else statement.

(Hint. Boiling point of water is 100C.)

Sol:

Create a GUI application as per following screenshot.

 

Type the following code by double clicking BtnAdd, button, below the line that says, ‘// TODO add your handling code here’

String t1=txt1.getText();

double temp=Double.parseDouble(t1);

if(temp==100)

lbl1.setText(“You are right. It is 100C”);

else

lbl1.setText(“No. It is 100C”);

}

 

OUTPUT: