NAME: MADEEHA TALIB
ROLL NO: 02-235221-010
ASSIGNEMNT NO: LAB (9)
PROGRAM: BS (IT) (FALL 2022)
LAB SIR NAME: SIR MAJID RIAZ
EXERCISES OF LAB 9
EXERCISE 1:
Create a GUI based application system that calculates the newton’s second law of motion i.e., F=ma
where,
F=Force in Newton
m= mass in grams
a= acceleration (a=9.8m/s2 for free falling bodies )
use proper alignment and design suitable to the application being created.
SOURCE CODE:
CALCULATE FORCE:
private void CALCULATEActionPerformed([Link] evt) {
// TODO add your handling code here:
int mass = [Link]([Link]());
int accel = [Link]([Link]());
Integer f;
if(mass > 0 && accel > 0)
f= mass * accel;
[Link]((f).toString() + " Newtons");
else
f = 0;
}
OUTPUT:
EXERCISE 2:
Create a login system interface based on your own choice of environment for example, cafeteria, cyber
security site or etc. Make sure you have your own unique scenario and apply proper designing chose
appropriate color palette and images. System must have proper labels, text boxes, buttons, and other
necessary controls.
SOURCE CODE:
ADMISSION FORM:
private void saveActionPerformed([Link] evt) {
// TODO add your handling code here:
[Link]("NAME: "+[Link]()+ "\n");
[Link]("LAST NAME: "+[Link]()+ "\n");
[Link]("AGE: "+[Link]()+ "\n");
[Link]("SEMESTER: "+[Link]().toString());
if ([Link]())
[Link]("\nGENDER : MALE " + "\n");
else if ([Link]())
{
[Link]("\nGENDER : FEMALE " + "\n");
if([Link]())
[Link]("COURSE 1: DIGITAL DESIGN "+"\n");
if([Link]())
[Link]("COURSE 2: DISCRETE MATHS "+"\n");
if([Link]())
[Link]("COURSE 3: OBJECT ORIENTED PROGRAMMING "+"\n");
OUTPUT: