Professional Documents
Culture Documents
Date: 12-NOV-2020
Roll Number: 2019-CE-123
Section: C
Name: SHAHEER ZAEEM
Course Name: ADVANCED OBJECT ORIENTED PROGRAMMING
Degree Program: COMPUTER ENGINEERING BS
Total number of pages
being submitted:
QUESTION 1:
PART_1
REASON OF ASSUMPTION:
Reason for Justification to choose the above classes is to full fill the activity of student course
registration for a university using the attributes of each class and HOD assigns to Teachers,
Page 1 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
Teacher prepares Course Modules, Coordinator verifies courses for academic year, Academic
officer validate student options and students confirm registration process by resolve any
issues.
Scope of the Project is University offers course Registration for students at Department level
and Controlled by Academic officer and Course coordinator at university level
Purpose is to model data base and communication among the various objects(roles) to
perform course Registration for a university
PART_2
1. XYZ University: Attributes are: Reg.ID, Name, Type, No of students, No of Teachers, No
of courses etc
2. Department: Attribute are: ID, Name, address, No of students, Labs ,No of Teachers,
Course modules, etc
4.Staff: Emp ID, Name, Address, Phone no, age, Qualification, Designation, salary
5.Teacher: employee ID, Teacher ID, Name, Address, Phone no, email, Experience, DOB,
Publications, courses taught
6.Course Module: Course ID, Module no, semester, dept, duration, type ,teacher Id
7.Course Cordinator: Employee ID, cordinator ID, Role, Address, Phone, email, course
outline id, course module id
Page 2 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
8.Academic Officer: Emp ID, Ao ID, Name, Role, Student master list, course master list,
student Id, cordinator ID ,Course Id.
Methods are: prepare masterlist1 ,prepare masterlist2 ,verify student module selection(),send
registered student info (coordinator)
9.Registration: Course Reg ID, Student Id, Course ID, Academic Year, Sem, teacher ID, Dept
ID.
10 Student: Student ID, Name, dept Id, dob, course Id, address, email, phone, sem fee.
PART_3
QUESTION 2:
PART_1
Page 3 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
SOURCE CODE:
/*
*/
package Question2_a;
/**
*/
import java.util.ArrayList;
import java.io.*;
import java.util.*;
if(size==queue.size())
Page 4 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
else
queue.add(s);
if(queue.isEmpty())
else
{ Queue q;
q=q1;
synchronized(q)
System.out.println(q.remove());
int i;
Queue q;
i=x;
q=q1;
Page 6 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
synchronized(q)
//i++;
String ss=Integer.toString(i);
ss="string "+ss;
q.add(ss);
/*
*/
package Question2_a;
/**
*/
Page 7 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
for(int i=1;i<=10;i++)
p.start();
c.start();
}}}
PART_2
SOURCE CODE:
/*
*/
package Question2b;
import java.io.PrintStream;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
Page 8 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
import java.net.InetAddress;
import java.net.Socket;
import java.util.Scanner;
/**
*/
try{
System.out.println("Enter a name:");
String name=sc.nextLine();
byte[] b = name.getBytes();
InetAddress ip = InetAddress.getLocalHost();
ds.send(dp);
System.out.println(address1.getHostAddress());
Page 9 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
catch(Exception e)
{System.out.println(e);}
QUESTION 3:
PART_1
SOURCE CODE:
/*
*/
package Question3;
import java.awt.Font;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.sql.*;
import javax.swing.JOptionPane;
/**
Page 10 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
*/
/**
*/
ResultSet rs;
public SecurityKeypad() {
initComponents();
pass_display.setFont(f1);
/**
* This method is called from within the constructor to initialize the form.
*/
@SuppressWarnings("unchecked")
Page 11 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
pass_display.addActionListener(new java.awt.event.ActionListener() {
pass_displayActionPerformed(evt);
});
Page 12 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
btn_1.setText("1");
btn_1.addActionListener(new java.awt.event.ActionListener() {
btn_1ActionPerformed(evt);
});
btn_2.setText("2");
btn_2.addActionListener(new java.awt.event.ActionListener() {
btn_2ActionPerformed(evt);
});
btn_3.setText("3");
btn_3.addActionListener(new java.awt.event.ActionListener() {
btn_3ActionPerformed(evt);
});
Page 13 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
btn_5.setText("5");
btn_5.addActionListener(new java.awt.event.ActionListener() {
btn_5ActionPerformed(evt);
});
btn_6.setText("6");
btn_6.addActionListener(new java.awt.event.ActionListener() {
btn_6ActionPerformed(evt);
});
btn_4.setText("4");
btn_4.addActionListener(new java.awt.event.ActionListener() {
btn_4ActionPerformed(evt);
});
Page 14 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
btn_7.setText("7");
btn_7.addActionListener(new java.awt.event.ActionListener() {
btn_7ActionPerformed(evt);
});
btn_9.setText("9");
btn_9.addActionListener(new java.awt.event.ActionListener() {
btn_9ActionPerformed(evt);
});
btn_8.setText("8");
btn_8.addActionListener(new java.awt.event.ActionListener() {
btn_8ActionPerformed(evt);
});
Page 15 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
btn_enter.setText("Enter");
btn_enter.addActionListener(new java.awt.event.ActionListener() {
btn_enterActionPerformed(evt);
});
btn_0.setText("0");
btn_0.addActionListener(new java.awt.event.ActionListener() {
btn_0ActionPerformed(evt);
});
btn_clr.setText("Clear");
btn_clr.addActionListener(new java.awt.event.ActionListener() {
btn_clrActionPerformed(evt);
});
Page 16 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
txt_lstLog.setColumns(20);
txt_lstLog.setRows(5);
jScrollPane1.setViewportView(txt_lstLog);
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout
.Alignment.LEADING)
.addComponent(pass_display)
.addComponent(jScrollPane1)))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout
.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_S
IZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupL
ayout.Alignment.TRAILING)
Page 17 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
.addGroup(layout.createSequentialGroup()
.addComponent(btn_clr,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btn_0,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.Componen
tPlacement.UNRELATED)
.addComponent(btn_enter,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADI
NG, layout.createSequentialGroup()
.addComponent(btn_7,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btn_8,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.Componen
tPlacement.UNRELATED)
.addComponent(btn_9,
javax.swing.GroupLayout.PREFERRED_SIZE,
Page 18 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupL
ayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(btn_1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.Componen
tPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(btn_2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.Componen
tPlacement.UNRELATED)
.addComponent(btn_3,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(0, 5, Short.MAX_VALUE)
.addComponent(btn_4,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
Page 19 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
.addComponent(btn_5,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.Componen
tPlacement.UNRELATED)
.addComponent(btn_6,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(pass_display,
javax.swing.GroupLayout.PREFERRED_SIZE, 46,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.BASELINE)
.addComponent(btn_1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
Page 20 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
.addComponent(btn_2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btn_3,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.BASELINE)
.addComponent(btn_6,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btn_5,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btn_4,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.BASELINE)
.addComponent(btn_7,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btn_9,
javax.swing.GroupLayout.PREFERRED_SIZE,
Page 21 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btn_8,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.BASELINE)
.addComponent(btn_enter,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btn_0,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btn_clr,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE, 114,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(25, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
Page 22 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
pass_display.setEchoChar('*');
pass_display.setText(pass_display.getText()+"1");
pass_display.setText(pass_display.getText()+"2");
pass_display.setText(pass_display.getText()+"3");
pass_display.setText(pass_display.getText()+"4");
pass_display.setText(pass_display.getText()+"5");
pass_display.setText(pass_display.getText()+"6");
pass_display.setText(pass_display.getText()+"7");
Page 24 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
pass_display.setText(pass_display.getText()+"8");
pass_display.setText(pass_display.getText()+"9");
pass_display.setText(pass_display.getText()+"0");
pass_display.setText("");
txt_lstLog.setText("");
Page 25 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
System.out.println(dtf.format(now));
try{
Class.forName("org.apache.derby.jdbc.ClientDriver");
System.out.println("Driver Loaded");
Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/Keypad","Sha
heer", "123");
System.out.println("Connected");
Statement
st=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.C
ONCUR_UPDATABLE);
int pass=Integer.parseInt(pass_display.getText());
rs=st.executeQuery(Query);
if(!rs.first()){
txt_lstLog.append(dtf.format(now));
txt_lstLog.append("\tAcces denied");
rs.close();
else{
int password=rs.getInt(2);
System.out.println(""+password);
System.out.println(""+pass);
Page 26 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
if(pass==password){
txt_lstLog.append(dtf.format(now));
txt_lstLog.append("\tAcces granted");
JOptionPane.showMessageDialog(rootPane, "Welcome
"+rs.getString(1));
rs.close();
catch(Exception e){
e.printStackTrace();
/**
*/
Page 27 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
*/
try {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
java.util.logging.Logger.getLogger(SecurityKeypad.class.getName()).log(java.u
til.logging.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(SecurityKeypad.class.getName()).log(java.u
til.logging.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(SecurityKeypad.class.getName()).log(java.u
til.logging.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(SecurityKeypad.class.getName()).log(java.u
til.logging.Level.SEVERE, null, ex);
Page 28 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
//</editor-fold>
java.awt.EventQueue.invokeLater(new Runnable() {
new SecurityKeypad().setVisible(true);
});
Page 29 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
PART_2
QUESTION 4:
PART_1
SOURCE CODE:
/*
Page 30 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
*/
package Question4a;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/**
*/
this.BankIDName = BankIDName;
this.Name = Name;
this.accounts = accounts;
public Ban() { }
Page 31 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
return accounts;
String bankname=sc.nextLine();
int bankid=sc.nextInt();
int accid=sc.nextInt();
int cusid=sc.nextInt();
// double amount=sc.nextDouble();
//a1.setAmount(amount);
Acc.add(a1);
for(Account b : bank){
System.out.println("1.Savings Account");
System.out.println("2.Mortage Account");
System.out.println("3.Checking Account");
int choice=sc.nextInt();
switch(choice){
case 1:
sa.Withdraw();
break;
case 2:
Page 33 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
ma.Withdraw();
break;
case 3:
ca.Withdraw();
}/*
*/
package Question4a;
/**
*/
import java.util.Scanner;
int AccountID;
int CustomerID;
Page 34 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
double Amount;
double balance=10000;
return customer;
this.customer = customer;
public Account(){}
this.AccountID = AccountID;
this.CustomerID = CustomerID;
// this.Amount = Amount;
// this.setAmount(Amount);
Page 35 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
return AccountID;
this.AccountID = AccountID;
return CustomerID;
this.CustomerID = CustomerID;
return Amount;
this.Amount = Amount;
Page 36 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
void Deposit(){
Amount=Amount+Amount;
void Withdraw(){
double amnt=sc.nextInt();
this.setAmount(amnt);
Amount=balance-this.getAmount();
System.out.println("Balance:"+Amount);
};
double GetBalance(){
return Amount;};
/*
Page 37 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
*/
package Question4a;
/**
*/
@Override
void Withdraw() {
}/*
*/
package Question4a;
/**
Page 38 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
*/
return account;
this.account = account;
return Name;
this.Name = Name;
return CustomerID;
this.CustomerID = CustomerID;
this.Name = Name;
this.CustomerID = CustomerID;
/*
*/
package Question4a;
/**
*/
Page 40 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
@Override
void Withdraw() {
/*
*/
package Question4a;
/**
*/
@Override
void Withdraw() {
Page 41 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
PART_2
SOURCE CODE:
/*
*/
package Question4_b;
/**
*/
import java.util.Scanner;
String name;
String address;
return name;
Page 42 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
this.name = name;
return address;
this.address = address;
void Name(){
String name=sc.nextLine();
this.setName(name);
void address(){
String address=sc.nextLine();
this.setAddress(address);
Page 43 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
}/*
*/
package Question4_b;
import java.util.Date;
/**
*/
Date date;
String Status;
return date;
this.date = date;
Page 44 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
return Status;
this.Status = Status;
System.out.println("Total Bill:"+amount);
System.out.println(""+amount);
float Tax=(amount)*(10/100);
System.out.println("Tax="+Tax);
float taxs=Tax+amount;
void calcTotal(){
Page 45 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
void calcTotalWeight(){
}/*
*/
package Question4_b;
import java.util.Scanner;
/**
*/
int quantity;
String TaxStatus;
return quantity;
}
Page 46 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
this.quantity = quantity;
return TaxStatus;
this.TaxStatus = TaxStatus;
void Quantity(){
int quan=sc.nextInt();
this.setQuantity(quan);
void TaxStatus(){
String status=sc.next();
this.setTaxStatus(status);
}/*
Page 47 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
*/
package Question4_b;
/**
*/
import java.util.Scanner;
Payment(float amount) {
o.SubTotal(amount);
o.calcTax(amount);
}/*
*/
package Question4_b;
/**
*/
import java.util.Scanner;
void authorize(){
String name=sc.nextLine();
String type=sc.nextLine();
String date=sc.nextLine();
System.out.println("Authorized!");
float amount=sc.nextFloat();
}/*
Page 49 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
*/
package Question4_b;
import java.util.Scanner;
/**
*/
void Authorize(){
String name=sc.nextLine();
int id=sc.nextInt();
System.out.println("Authorized!");
float amount=sc.nextFloat();
Page 50 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
/*
*/
package Question4_b;
/**
*/
import java.util.Scanner;
void Cash(){
float amount=sc.nextFloat();
System.out.println(amount);
}/*
Page 51 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
*/
package Question4_b;
/**
*/
import java.util.Scanner;
String item;
String description;
return item;
this.item = item;
return description;
Page 52 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
this.description = description;
void ItemName(){
String itemname=sc.nextLine();
this.setItem(itemname);
void Itemdescription(){
String itemdes=sc.nextLine();
this.setItem(itemdes);
}/*
*/
package Question4_b;
/**
Page 53 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
*/
import java.util.Scanner;
c.Name();
c.address();
i.ItemName();
i.Itemdescription();
System.out.println("1.Cash");
System.out.println("2.Cheque");
System.out.println("3.Credit");
int choice=sc.nextInt();
switch(choice){
case 1:
od.Quantity();
cs.Cash();
break;
Page 54 of 55
SHAHEER ZAEEM CE-206 ROLL NUM:2019-CE-144
case 2:
odd.Quantity();
ck.Authorize();
break;
case 3:
oddd.Quantity();
cd.authorize();
Page 55 of 55