Docsity

Object-Oriented Programming in Java: Video Library Management System, Assignments of Java Programming

Toggle sidebar
bg1
Assume a Video Library scenario. Create four classes :
Customer -cust_no, cust_name
Membership - Mem_no, cust_no
Cassette - cass_no, cass_name, Language
Iss_rec - iss_no, iss_date( as a string), mem_no, cass_no
Use constructors to initialize the member variables. Define the non-member
functions to perform the following operations( five functions); .Pass the array of
objects needed for each operation as a arguments to the functions :
1. List all the customer names with their membership numbers.
2. List all the issues for the any given month with the customer names and
cassette names.
3. List all customer names and date who take the cassette of given
language
4. Display each customer member id and the total number of cassettes
taken( in the ascending order)
5. Display the customer name, cassette name, issue date of a given issue
number.
Code:
class customer
{
String cust_name;
int cust_no;
customer(int cust_no,String cust_name )
{
this.cust_no=cust_no;
this.cust_name=cust_name;
}
pf3
pf4
pf5
pf8

Partial preview of the text

Download Object-Oriented Programming in Java: Video Library Management System and more Assignments Java Programming in PDF only on Docsity!

Assume a Video Library scenario. Create four classes :

Customer - cust_no, cust_name

Membership - Mem_no, cust_no

Cassette - cass_no, cass_name, Language

Iss_rec - iss_no, iss_date( as a string), mem_no, cass_no

Use constructors to initialize the member variables. Define the non-member

functions to perform the following operations( five functions); .Pass the array of

objects needed for each operation as a arguments to the functions :

1. List all the customer names with their membership numbers.

2. List all the issues for the any given month with the customer names and

cassette names.

3. List all customer names and date who take the cassette of given

language

4. Display each customer member id and the total number of cassettes

taken( in the ascending order)

5. Display the customer name, cassette name, issue date of a given issue

number.

Code: class customer { String cust_name; int cust_no; customer(int cust_no,String cust_name ) { this.cust_no=cust_no; this.cust_name=cust_name; }

void display(){ System.out.println(cust_no+" "+cust_name); } } class membership { int mem_no; int cust_no; membership(int mem_no, int cust_no ) { this.cust_no=cust_no; this.mem_no=mem_no; } void display(){ System.out.println(mem_no+" "+cust_no); } } class cassette { int cass_no; String cass_name,language; cassette(int cass_no ,String cass_name,String language) { this.cass_no=cass_no; this.cass_name=cass_name; this.language=language; }

customer s1=new customer(1101,"Arun"); customer s2=new customer(1102,"Aarti"); customer s3=new customer(1103,"Vanshika"); customer s4=new customer(1104,"Vishal"); membership s5 =new membership(1201,1101); membership s6 =new membership(1202,1102); membership s7 =new membership(1203,1103); membership s8 =new membership(1204,1104); cassette s9 =new cassette(101,"Heat waves" ,"English"); cassette s10 =new cassette(102,"Harley in Hawaii" ,"English"); cassette s11 =new cassette(103,"Makhana" ,"Hindi"); cassette s12 =new cassette(104,"pushpa" ,"Tamil"); iss_rec s13=new iss_rec(201,"30- 01 - 2022",1201,1101); iss_rec s14=new iss_rec(202,"31- 01 - 2022",1202,1102); iss_rec s15=new iss_rec(203,"01- 02 - 2022",1203,1103); iss_rec s16=new iss_rec(204,"02- 02 - 2022",1204,1104); s1.display(); s2.display(); s3.display(); s4.display(); s5.display(); s6.display(); s7.display(); s8.display(); s9.display(); s10.display(); s11.display(); s12.display(); s13.display();

s14.display(); s15.display(); s16.display(); } }