We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More

Assignment No. 01 Fall 2015 CS506- Web Design and Development Total Marks: 20 Due Date: 24/11/2015

Assignment No. 01

 Fall 2015
CS506- Web Design and Development

Total Marks: 20

Due Date: 24/11/2015

Please read the following instructions carefully before solving & submitting assignment:

It should be clear that your assignment will not get any credit  if:

  • The assignment is submitted after due date.
  • The submitted assignment does not open or file corrupt.
  • The assignment is fully or partially copied from (other student or ditto copy from handouts or internet).
  • Student ID is not mentioned in the assignment File or name of file is other than student ID.
  • The assignment is not submitted in .java format.

 

Uploading instructions

Your submission must include:

 

  1. All the source code (.java files) and other necessary files to compile and run your program.
  2. You have to make one java file and Upload it on VULMS.

 

Note: Use Notepad or Notepad++ for coding and JDK package for java source code compilation and running (A guideline document on JDK installation and configuration is given in course download section)

Objective

The objective of this assignment is to

  • Give you some practice exercise of Classes and Objects. And how to compile and run java programs.
  • Develop GUI (Graphical User Interface) in java
  • Understand the concept of Collections in java

 

 

Problem Statement:                                                        

You are required to write a java program which contains only two classes named as “BookInfo” and “BookMgtSys”.

 

BookInfo class must have the following data members:

  • ISBN
  • Book Name
  • Author Name
  • Total Books

When you will add book then it will increment variable Total Books and decrement when you will delete book.

 

BookInfo class must have the following member methods:

  • Default constructor
  • Parameterized constructor
  • addbook () 
  • searchBook ()
  • deleteBook ()

 

BookMgtSys is a public driver class that contains the main() method. The name of you file should be BookMgtSys as it is a public class in your program.                                                                             

Detailed Description:

Default constructor: The default constructor will create an ArrayList.

Parameterized constructor: It should take three String parameters named as (ISBN, Book Name, and Author Name) and initializes the data members values with the passed parameters.

addBook(): This method will ask the user to enter ISBN, Book name and Author name and then add the book in 

ArrayList and increment the Total Book variable. After successful adding the book, A message box should be displayed containing Book information.

searchBook(): This method takes one parameter which is book name and search the book name in the ArrayList. If search is found then display the Book information otherwise display message that Book not found.

deleteBook(): This method takes one parameter which is book name and delete the book from the ArrayList and then decrement the Total Book variable. 

 

Use JOptionPane for input and output data.

 

Sample Output:

Within main() method, the following message box should be displayed.

 

If user presses 1 then it should ask the user to add further information

Deadline

Your assignment must be uploaded/submitted at or before 24th Nov, 2015.

 

 

For any query about the assignment, contact at cs506@vu.edu.pk

GOOD LUCK

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 16911

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Attachments:

Replies to This Discussion

  • Student ID is not mentioned in the assignment File or name of file is other than student ID.
  • The assignment is not submitted in .java format.


is ka mtlb ha k agr assignment main student id k alava name likha hva ya file java main na hoe to koe number nhe milna.yeni java file or file name as ur id must 

.java my assignment upload ni krna. matlb .txt my assignment upload kary. aur Student ID na likhy?

book info ke class static or inner class hogi tbhi bookmgtsys ke

ye kis ne kha ha

pouch rahi hun?

its complete

create a text document file save code in it replace vuid with ur id like mc1... save file as cs506.java 

package bookpkg;

import java.util.ArrayList;
import javax.swing.JOptionPane;

public class vuid

public static void main(String[] args) 
{
BookInfo bookObj = new BookInfo();
String inputStr = null;
int intVal = 0;

while(true)
{
inputStr = JOptionPane.showInputDialog("Enter 1 to Add Book\n"
+ "Enter 2 to Search Book\nEnter 3 to Delete Book\nEnter 4 to Exit System");
intVal = Integer.parseInt(inputStr);

if(intVal == 1)
{
String ISBN = JOptionPane.showInputDialog("Enter the ISBN");
String bookName = JOptionPane.showInputDialog("Enter the Book Name");
String authorName = JOptionPane.showInputDialog("Enter the Author Name");

bookObj.addBook(ISBN, bookName, authorName);
}
else if(intVal == 2)
{
if(bookObj.totalBooks > 0)
{
inputStr = JOptionPane.showInputDialog("Enter Book Name to Search");
bookObj.searchBook(inputStr);
}
else
{
JOptionPane.showMessageDialog(null, "There is no book in the list!");
}
}
else if(intVal == 3)
{
if(bookObj.totalBooks > 0)
{
inputStr = JOptionPane.showInputDialog("Enter Book Name to Delete");
bookObj.deleteBook(inputStr);
}
else
{
JOptionPane.showMessageDialog(null, "There is no book in the list!");
}
}
else if(intVal == 4)
{
System.exit(0);
}
else
{
JOptionPane.showMessageDialog(null, "Invalid Input!");
}
}
}

public static class BookInfo 
{
private String ISBN;
private String bookName;
private String authorName;
public int totalBooks = 0;
private ArrayList arr = new ArrayList<BookInfo>();

public BookInfo()
{
this.ISBN = null;
this.bookName = null;
this.authorName = null;
}

public BookInfo(String ISBN, String bookName, String authorName)
{
this.ISBN = ISBN;
this.bookName = bookName;
this.authorName = authorName;
}

public void addBook(String ISBN, String bookName, String authorName)
{
BookInfo temp = new BookInfo(ISBN, bookName, authorName);
this.arr.add(temp);
this.totalBooks++;
JOptionPane.showMessageDialog(null, "Book Name: " + bookName + 
" Added Successfully!\nTotal Books: " + this.totalBooks);
}

public int searchBook(String bookName)
{
int index = -1;
BookInfo temp = new BookInfo();

for(int i = 0; i < this.arr.size(); i++)
{
temp = (BookInfo) this.arr.get(i);

if(temp.bookName.equals(bookName))
{
index = i;
}
}

if(index != -1)
{
JOptionPane.showMessageDialog(null, "Book Found Successfully!\nISBN: " + temp.ISBN + 
"\nBook Name: " + temp.bookName + "\nBook Author: " + temp.authorName);
return index;
}
else
{
JOptionPane.showMessageDialog(null, "Book Name: " + bookName + 
" Not Found!");
return -1;
}
}

public void deleteBook(String bookName)
{
int index = this.searchBook(bookName);

if(index != -1)
{
this.arr.remove(index);
this.totalBooks--;
JOptionPane.showMessageDialog(null, "Book Name: " + bookName + 
" Deleted Successfully!\nTotal Remaining Books: " + this.totalBooks);
}
}
}
}

this code i not workig M.Tariq Sb.

this error shows

ik yhi code to sab sy best working kr rha hai.

there is no error.

plz koi to hlp kr dy mera  JDK instal ni ho rha

 id kahn likhna hy test file m?kahn replac krna hy

dear,i've already gave u a link to understand jdk installment procedure in previous comments.check that.

at the uper part of code, in 1st class 

public class vuid

replace vuid with your bc120....

public class vuid bs090

kea esy ?malika

RSS

Latest Activity

Profile IconAini MCS and Muskan dia joined + M.Tariq Malik's group
9 minutes ago
mahi ahsan replied to + "Jɨyą's discussion CS501 Assignment No 01 Fall 2019 Solution & Discussion Due Date: 12-11-2019 in the group CS501 Advance Computer Architecture
22 minutes ago
rehmak liked + M.Tariq Malik's discussion CS619 Final Project Fall 2019 - My Travel Expenses Manager Android App
22 minutes ago
Mani Siddiqui BS VIII posted a status
"عشق وه علمِ ریاضی ھے که جس میں فارس.. دو سے جب ایک نکالیں تو صفر بچتا ھے"
25 minutes ago
+***piya o ry piya***+ replied to + "Jɨyą's discussion What are u gOod at....... :v
29 minutes ago
+***piya o ry piya***+ liked + "Jɨyą's discussion What are u gOod at....... :v
30 minutes ago
Mani Siddiqui BS VIII replied to ayesha's discussion CS614 Assignment NO.1 Fall 2019 Solution&Discussion Due date: 14 Nov 2019 in the group CS614 Data Warehousing
30 minutes ago
Mani Siddiqui BS VIII joined + M.Tariq Malik's group
30 minutes ago
Mani Siddiqui BS VIII joined + M.Tariq Malik's group
31 minutes ago
++Killing Joke++ updated their profile
47 minutes ago
Aakash Ahmed replied to +¢αяєℓєѕѕ gιяℓ's discussion CS408 - Human Computer Interaction Assignment No.1 Semester: Fall 2019 in the group CS408 Human Computer Interaction
1 hour ago
Profile IconAakash Ahmed and Preçîõûš joined + M.Tariq Malik's group
1 hour ago
+ Abb@s replied to + !! SARAH's discussion mne hassan ko mne kbhi nhi manga dua me ,..<3 love love hassan to azal se mera he na..!!
1 hour ago
+ Abb@s replied to + !! SARAH's discussion mne hassan ko mne kbhi nhi manga dua me ,..<3 love love hassan to azal se mera he na..!!
1 hour ago
Maham Rafiq and Muhammad Hussnain Hafeez are now friends
1 hour ago
roshan khetran liked + M.Tariq Malik's group ISL201 Islamic Studies
1 hour ago
Bilal Chaudhary replied to + M.Tariq Malik's discussion CS603 Assignment No 01 Fall 2019 Solution & Discussion Due Date: 11-11-2019 in the group CS603 Software Architecture and Design
1 hour ago
Bilal Chaudhary joined + M.Tariq Malik's group
1 hour ago
pakeeza fatima liked + M.Tariq Malik's discussion MGT101 Assignment No 01 Fall 2019 Solution & Discussion Due Date: 13-11-2019
1 hour ago
+ "αяsαℓ " Ќąƶµяɨ •" replied to + M.Tariq Malik's discussion MGT301 Principles of Marketing Assignment No 01 Fall 2019 Solution & Discussion in the group MGT301 Principles of Marketing
2 hours ago

Today Top Members 

© 2019   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service