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:
Your submission must include:
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)
The objective of this assignment is to
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:
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:
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
Tags:
jdk software install kaisy krna hy help kr dyn n coding me b.
Assalam o alikum
Me ny apni sari Assignement bna li lkin error a rha hy for loop ki compilation ky doran. Kia koi guide kry ga?
yes
AOA Ali bhai kase hain plz mare kuch help karian mujhe solution dekha dian plz help ka liye chay plz or yah java main karna ha yah net bean main
salam ali... can u help me ?
a-o-a Dear i am facing problem. i can not made my assignment solution.
kindly help me!
jdk1.8.0_40 installation and configure
Hi Friends In this video for help new students problem in jdk installation and configuration.
plz like my videos and subscribe my channel for new tutorials for helping materials with assignments.
AOA g kase hain ap sab mujh sa JDK install nai ho raha plz mare help karian
any one have correct solution??
please koi full soltion upload kar dy ya help kar dy ma na ya first class banaye ha
import javax.swing.*;
class bookInfo {
String bookName;
String author;
String total;
//parameterized constructor
//public bookInfo()
//{}
public bookInfo(String b, String a, String t) {
bookName = b; author = a; total = t;
}
//method for displaying person record on GUI
public void print( ) {
JOptionPane.showMessageDialog(null, "book: " + book + "author:" +author + "total :" +total);
}
}
Any one tell me how in import java libraries in netbeans 8.1
when i write code in net beans software same as in notes imort java swing then on this line apear a errorr any 1 help
I have completed almost but a few errors :
Can Any body fix them :
import javax.swing.*;
import java.util.*;
import java.io.*;
class BookInfo {
String ISBN;
String BookName;
String AuthorName;
String TotalBooks;
//parameterized constructor
//public (){}
public BookInfo(String i,String b,String a){
ISBN =i ; BookName=b; AuthorName=a;
}
ArrayListbooks;
//constructor
public BookInfo(){
books=new ArrayList();
loadbooks();
}
public void loadbooks(){
String tokens[] = null;
String no, name, author;
try {
FileReader fr = new FileReader("books.txt");
BufferedReader br = new BufferedReader(fr);
String line = br.readLine();
while ( line != null ) {
tokens = line.split(",");
no = tokens[0];
name = tokens[1];
author = tokens[2];
BookInfo b = new BookInfo(no, name, author);
books.add(b);
line = br.readLine();
}
br.close();
fr.close();
}catch(IOException ioEx){
System.out.println(ioEx);
}
}
public void savebooks ( ){
try {
BookInfo b;
String line;
FileWriter fw = new FileWriter("books.txt");
PrintWriter pw = new PrintWriter(fw);
for(int i=0; i
© 2021 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We are user-generated contents site. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post