Author Archives: nagrajmetta

Different schools of software design

Different  schools of software design

  1. Array programming
  2. Aspect  Oriented design
  3. Class based programming
  4. Recursion
  5. Template meta Programming
  6. Flow based programming
  7. Spreadsheet
  8. Action Language
  9. Structured programming

Structured programming :

    A technique for organizing and coding computer programs in which a hierarchy of modules is used, each having a single entry and a single exit point, and in which control is passed downward through the structure without unconditional branches to higher levels of the structure.

Three types of control flow are used: sequential, test, and Repetation

  • Sequence: one task after another
  • Test :  making a choice between actions
  • In “repetition”  : a statement is executed until the program reaches a certain state, or operations have been applied to every element of a collection. This is usually expressed with keywords such as while, dowhile etc, Often it is recommended that each loop should only have one entry point (and in the original structural programming, also only one exit point, and a few languages enforce this).

Almost any language can use structured programming techniques to avoid common pitfalls of unstructured languages. Unstructured programming must rely upon the discipline of the developer to avoid structural problems, and as a consequence may result in poorly organized programs

Object-oriented programming  can be thought of as a type of structured programming, uses structured programming techniques for program flow, and adds more structure for data to the model.

Advantages :

  • Easy to write:
    Modular design increases the programmer’s productivity by allowing them to look at the big   picture first and focus on details later.Several Programmers can work on a single, large program, each working on a different module

    Studies show structured programs take less time to write than standard programs.

Template metaprogramming

       is a  metaprogramming  technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled. The output of these templates include complile timeconstants, data structures, and complete functions. The use of templates can be thought of as compile time time execution. The technique is used by a number of languages, the best-known being C++, but also Curl , D etc

The use of templates as a metaprogramming technique requires two distinct operations: a template must be defined, and a defined template must be instantiated.

The template definition describes the generic form of the generated source code, and the instantiation causes a specific set of source code to be generated from the generic form in the template.

Example

To swap the numbers using the concept of function template.

#include<iostream.h>

#include<conio.h>

template<class t>

void swap(t &x,t &y)

{

t temp=x;

x=y;

y=temp;

}

void fun(int a,int b,float c,float d)

{

cout<<“\na and b before swaping :”<<a<<“\t”<<b;

swap(a,b);

cout<<“\na and b after swaping  :”<<a<<“\t”<<b;

cout<<“\n\nc and d before swaping :”<<c<<“\t”<<d;

swap(c,d);

cout<<“\nc and d after swaping  :”<<c<<“\t”<<d;

}

void main()

{

int a,b;

float c,d;

clrscr();

cout<<“Enter A,B values(integer):”;

cin>>a>>b;

cout<<“Enter C,D values(float):”;

cin>>c>>d;

fun(a,b,c,d);

getch();

}

Output:

Enter A, B values (integer): 10  20

Enter C, D values (float):    2.50  10.80

A and B before swapping: 10 20

A and B after    swapping:  20 10

C and D before swapping: 2.50  10.80

C and D after               swapping: 10.80  2.50

 

Advertisements

labevalution-5 Nagaraj

http://www.4shared.com/office/KBVqCMJ1/Online_shopping.html
http://www.4shared.com/office/93A5wXnK/USers_manual.html

lab evaluation-4 Nagaraj

1)  Clauses of 9126

ISO 9126 Std                              Description Related ITD procedure
1)Functionality The functionality characteristic allows draw conclusions about how well software provides desired functions. QM
a)Suitability It correlates with metrics which measure attributes of software that allow to conclude the presence and appropriateness of a set of functions for specified tasks. QM
b)Accuracy The accuracy sub-characteristic allows to draw conclusions about how well software achieves correct or agreeable results QM
c)Interoperability It correlates with metrics which measure attributes of software that allow to conclude about its ability to interact with specified systems.

 

QM
d)Security The security sub-characteristic allows to draw conclusions about how secure software is QM
     
2)Reliability The reliability characteristic allows to draw conclusions about how well software maintains the level of system performance when used under specified conditions. DC
a)maturity It correlates with metrics which measure attributes of software that allow to conclude about the frequency of failure by faults in the software.

 

DC
b)Fault Tolerance It correlates with metrics which measure attributes of software that allow to conclude on its ability to maintain a specified level of performance in case of software faults or infringement of its specified interface.

 

QM
c)Recoverability The recoverability sub-characteristic allows to draw conclusions about how well software recovers from software faults or infringement of its specified interface.

 

QM
d)compliance It correlates with metrics which measure attributes of software that allow to conclude about the adherence to application related standards, conventions, and regulations in laws and similar prescriptions.

 

QM
     
3)Usability The usability characteristic allows to draw conclusions about how well software can be understood, learned, used and liked by the developer. QP
a)Understandability Internal understandability reuse metrics assess whether new software engineers/developers can understand: whether the software is suitable;

 

DC
b)Learn ability Internal learn ability metrics assess how long software engineers or developers take to learn how to use particular functions, and the effectiveness of documentation. Learn ability is strongly related to understandability, and understandability measurements can be indicators of the learn ability potential of the software. QM
c)operability Internal programmability metrics assess whether software engineers/developers can integrate and control the software. QM
     
     
4)Re usability Internal usability metrics are used for predicting the extend of which the software in question can be understood, learned, operated, is attractive and compliant with usability regulations and guidelines where here using means integrating it in a larger software system. QM
a)Understandability for

reuse

Software engineers/developers should be able to select a software product which is suitable for their intended use. Internal understandability reuse metrics assess whether new software engineers/developers can understand: whether the software is suitable; how it can be used for particular tasks. QM
b)Learn ability for re use , internal learn ability metrics assess how long software engineers or developers take to learn how to use particular functions, and the effectiveness of documentation. Learn ability is strongly related to understandability, and understandability measurements can be indicators of the learn ability potential of the software. DC
     
5) Efficiency The efficiency characteristic allows to draw conclusions about how well software provides required performance relative to amount of resources used. It can be used for assessing, controlling and predicting the extent to which the software product (or parts of it) in question satisfies efficiency requirements. QP
a)time  behavior The time behavior sub-characteristic allows to draw conclusions about how well the time behavior of software is for a particular purpose. DC
b)resource utilization . It correlates with metrics which measure attributes of software that allow to conclude about the amount and duration of resources used while performing its function.

 

 

QM
     
6)Maintainability The maintainability characteristic allows to draw conclusions about how well software can be maintained. It can be used for assessing, controlling and predicting the effort needed to modify the software product (or parts of it) in question. QM
a)Analyzability The analyzability sub-characteristic allows to draw conclusions about how well software can be analyzed. It correlates with metrics which measure attributes of software that allow to conclude about the effort needed for diagnosis of deficiencies or causes of failures, or for identification of parts to be modified. QM
b)Stability The stability sub-characteristic allows to draw conclusions about how stable software is. It correlates with metrics which measure attributes of software that allow to conclude about the risk of unexpected effects as result of modifications.

 

QM
c)Testability The testability sub-characteristic allows to draw conclusions about how well software can be tested and is tested. It correlates with metrics which measure attributes of software that allow to conclude about the effort needed for validating the software and about the test coverage. QM
     
7)Portability The portability characteristic allows to draw conclusions about how well software can be ported from one environment to another. It can be used for assessing, controlling and predicting the extend to which the software product (or parts of it) in question satisfies portability requirements. QM
a)Adaptability The adaptability sub-characteristic allows to draw conclusions about how well software can be adapted to environmental change. It correlates with metrics which measure attributes of software that allow to conclude about the amount of changes needed for the adaptation of software to different specified environments.

 

QM
b)Install ability The installability sub-characteristic allows to draw conclusions about how well software can be installed in a designated environment. It correlates with metrics which measure attributes of software that allow to conclude about the effort needed to install the software in a specified environment.

 

 

QP
c)Replace ability The replaceability sub-characteristic allows to draw conclusions about how well software can replace other software or parts of it. It correlates with metrics which measure attributes of software that allow to conclude about opportunity and effort using it instead of specified other software in the environment of that software.

 


 

QM
     
     

 

2) The traditional SCM identifies four procedures that must be defined for each software project to ensure a good SCM process is implemented. They are

  • Configuration Identification
  • Configuration Control
  • Configuration Status Accounting
  • Configuration Authentication

3. The testing for the features are as follows.

Reliability : Software Reliability Testing requires checking features provided by the software,the load that software can handle and regression testing.

Feature test

feature test for software conducts in following steps

  • Each operation in the software is executed once.
  • Interaction between the two operations is reduced and
  • Each operation each checked for its proper execution.

feature test is followed by the load test.

Load test

This test is conducted to check the performance of the software under maximum work load. Any software performs better up to some extent of load on it after which the response time of the software starts degrading. For example, a web site can be tested to see till how many simultaneous users it can function without performance degradation. This testing mainly helps for Databases and Application servers. Load testing also requires to do software performance testing where it checks that how well some software performs under workload.

Regression test

Regression testing is used to check if any bug fixing in the software introduced new bug. One part of the software affects the other is determined. Regression testing is conducted after every change in the software features. This testing is periodic. The period depends on the length and features of software.

  • Compatibility:- The Compatibility testing can be done as follows
  • Computing capacity of Hardware Platform (IBM 360, HP 9000, etc.)..
  • Bandwidth handling capacity of networking hardware
  • Compatibility of peripherals (Printer, DVD drive, etc.)
  • Operating systems (Linux, Windows, etc.)
  • Database (Oracle, SQL Server, MySQL, etc.)
  • Other System Software (Web server, networking/ messaging tool, etc.)
  • Browser compatibility (Chrome, Firefox, Netscape, Internet Explorer, Safari, etc.)

Browser compatibility testing, can be more appropriately referred to as user experience testing. This requires that the web applications are tested on different web browsers, to ensure the following:

  • Users have the same visual experience irrespective of the browsers through which they view the web application.
  • In terms of functionality, the application must behave and respond the same way across different browsers.
  • Carrier compatibility (Verizon, Sprint, Orange, O2, AirTel, etc.)
  • Backwards compatibility.
  • Hardware (different phones)
  • Different Compilers (compile the code correctly)
  • Runs on multiple host/guest Emulators

Usability testing:

The best way to implement usability testing is two fold – firstly from a design & development perspective, then from a testing perspective.

From a design viewpoint, usability can be tackled by (1) Including actual Users as early as possible in the design stage. If possible, a prototype should be developed – failing that, screen layouts and designs should be reviewed on-screen and any problems highlighted.. The earlier that potential usability issues are discovered the easier it is to fix them.

(2) Following on from the screen reviews, standards should be documented i.e. Screen Layout, Labelling/Naming conventions etc. These should then be applied throughout the application.

Where an existing system or systems are being replaced or redesigned, usability issues can be avoided by using similar screen layouts – if they are already familiar with the layout the implementation of the new system will present less of a challenge, as it will be more easily accepted (provided of course, that that is not why the system is being replaced).

3). Including provisions for usability within the design specification will assist later usability testing. Usually for new application developments, and nearly always for custom application developments, the design team should either have an excellent understanding of the business processes/rules/logic behind the system being developed; and include users with first hand knowledge of same. However, although they design the system, they rarely specifically include usability provisions in the specifications.

An example of a usability consideration within the functional specification may be as simple as specifying a minimum size for the ‘Continue’ button.

4). At the unit testing stage, there should be an official review of the system – where most of those issues can more easily be dealt with. At this stage, with screen layout & design already reviewed, the focus should be on how a user navigates through the system. This should identify any potential issues such as having to open an additional window where one would suffice. More commonly though, the issues that are usually identified at this stage relate to the default or most common actions. For example, where a system is designed to cope with multiple eventualities and thus there are 15 fields on the main input screen – yet 7 or 8 of these fields are only required in rare instances. These fields could then be set as hidden unless triggered, or moved to another screen altogether.

5). All the previous actions could be performed at an early stage if Prototyping is used. This is probably the best way to identify any potential usability/operability problems. You can never lessen the importance of user-centered design, but you can solve usability problems before they get to the QA stage (thereby cutting the cost of rebuilding the product to correct the problem) by using prototypes (even paper prototypes) and other “discount usability” testing methods.
6). From a testing viewpoint, usability testing should be added to the testing cycle by including a formal “User Acceptance Test”. This is done by getting several actual users to sit down with the software and attempt to perform “normal” working tasks, when the software is near release quality. I say “normal” working tasks because testers will have been testing the system from/using test cases – i.e. not from a users viewpoint. User testers must always take the customer’s point of view in their testing.

User Acceptance Testing (UAT) is an excellent exercise, because not only will it give you there initial impression of the system and tell you how readily the users will take to it, but this way it will tell you whether the end product is a closer match to their expectations and there are fewer surprises. (Even though usability testing at the later stages of development may not impact software changes, it is useful to point out areas where training is needed to overcome deficiencies in the software.

(7) Another option to consider is to include actual users as testers within the test team. One financial organization I was involved with reassigned actual users as “Business Experts” as members of the test team. I found their input as actual “tester users” was invaluable.

8). The final option that may be to include user testers who are eventually going to be (a) using it themselves; and/or (b) responsible for training and effectively “selling” it to the users.

Affordability testing:

A way to do affordability testing is to ask customer what is his buget and if the project manager thinks that he can do it then  affordability can be met else there is no way.

 

2) TEST CASES

 

Online Book Store Test

Baseline test

Baseline:

  1. Stakeholders (Application users) are two identical users, customer and administrator.
  2. Customer shall register their information to the database (ID, password, name, address, phone number, email, credit card number, etc)
  3. The application shall support simple search of books (by ISBN, title and author etc)
  4. User be able to order books (registered user only)
  5. Administrator shall add the inventory list.
  6. Administrator shall delete the inventory list.

Test Number #1

 

Test case

: Stakeholders (Application users) are two identical users, customer and administrator.

 

Test procedure:

  1. Check whether the webpage exists for customer.

Test resultSatisfied.

  1. Check whether the webpage separated with one for administrator exists for customer.

Test resultSatisfied.

 

Test Number #2

 

Test case

: Customer shall register their information to the database (ID, password, name, address, phone number, email, credit card number, etc)

 

Test procedure:

  1. Move to the webpage for customer.
  2. Check whether the menu for registration exists or not.

Test resultSatisfied. In the right top part of the webpage

  1. Check whether the menu for registration is linked correctly.

Test resultSatisfied.

  1. Check whether the customer be able to register successfully.

Test resultSatisfied.

 

Test Number #3

 

Test case

: The registered customer should be able to search books. (By ISBN, title and author)

 

Test procedure:

  1. Check whether the menu for simple search exists or not.

Test resultSatisfied. In the right top part of the webpage for the customer logged in.

  1. Check whether the menu for search is linked correctly.

Test resultSatisfied.

  1. Check whether the customer be able to search books by ISBN successfully.

Test resultSatisfied.

  1. Check whether the customer be able to search books by title successfully.

Test resultSatisfied.

  1. Check whether the customer be able to search books by author successfully.

Test resultSatisfied.

 

Test Number #4

 

Test case

: The registered customer should be able to order a book.

 

Test procedure:

  1. Check whether the menu for ordering a book exists or not.

Test resultSatisfied. In the right top part of the webpage for the customer logged in.

  1. Check whether the menu for ordering a book is linked correctly.

Test result: Satisfied.

  1. Check whether the administrator be able to order a book successfully.

Test resultSatisfied.

 

Test Number #5

 

Test case

: Administrator shall add the inventory list

 

Test procedure:

  1. Move to the webpage for administrator
  2. Check whether the menu for adding and deleting exists or not.

Test resultSatisfied. In the right top part of the webpage

  1. Check whether the menu for adding a book is linked correctly.

Test resultSatisfied.

  1. Check whether the administrator be able to add a book successfully.

Test resultSatisfied.

 

Test Number #6

 

Test case

: Administrator shall delete the inventory list

 

Test procedure:

  1. Move to the webpage for administrator
  2. Check whether the menu for deleting exists or not.

Test resultSatisfied. In the right top part of the webpage

  1. Check whether the menu for adding a book is linked correctly.

Test resultSatisfied

  1. Check whether the administrator be able to delete a book successfully.

Test resultSatisfied.

 

 

Usability Testing

Usability Testing

  In Usability Testing, a small-set of target end-users, of a  software system, “use” it to expose usability defects. This testing mainly focuses on the user’s-ease to use the application, flexibility in handling controls and ability of the system to meet its objectives.

This testing is recommended during the initial design phase of  SDLC , which gives more visibility on the expectations of the users.

 

Goals of Usability Testing

Goal of this testing is to satisfy users and it mainly concentrates on the following parameters of a system:

 

Effectiveness of system

  • Is the system is easy to learn?
  • Is the system useful and adds value to the target audience?
  • Is Content, Color, Icons, Images used are aesthetically pleasing ?

Efficiency

  • Navigation required to reach desired screen/webpage should be very less. Scroll bars shouldn’t be used frequently.
  •  Uniformity in the format of screen/pages in your application/website.
  • Provision to search within your software application or website

Accuracy

  • No outdated or incorrect data like contact information/address should be present.
  • No broken links should be present.

User friendliness

  • Controls used should be self-explanatory and must not require training to operate
  • Help should be provided for the users to understand the application / website
  • Alignment with above goals helps in effective usability testing

 

 

Pros and Cons of Usability testing:

As with anything in life, usability testing has its merits and de-merits. Lets look at them

Pros:

  • It helps uncover usability issues before the product is marketed.
  • It helps improve end user satisfaction
  • It makes your system highly effective and efficient
  • It helps gather true feedback from your target audience who actually use your system during usability test. You do not need to rely on “opinions” from random people.

Cons:-

  • Cost is a major consideration in usability testing. It takes lots of resources to set up a Usability Test Lab. Recruiting and management of usability testers can also be expensive

However, these costs pay themselves up in form of higher customer satisfaction, retention and repeat business. Usability testing is therefore highly recommended.

Creative Commons

Creative Commons (CC)

  • Creative Commons helps you share your knowledge and creativity with the world.
  • Creative Commons develops, supports, and stewards legal and technical

infrastructure that maximizes digital creativity, sharing, and
innovation.

  • Creative Commons is a nonprofit organization that enables the sharing and use of creativity and knowledge through free legal tools.

What can Creative Commons do for me?

If you want to give people the right to share, use, and even build upon a work you’ve created, you should consider publishing it under a Creative Commons license. CC gives you flexibility (for example, you can choose to allow only non-commercial uses) and protects the people who use your work, so they don’t have to worry about copyright infringement, as long as they abide by the conditions you have specified.

Creative Commons licenses do not replace copyright, but are based upon it. They replace individual negotiations for specific rights between copyright owner (licensor) and licensee, which are necessary under an “all rights reserved” copyright management with a “some rights reserved” management employing standardized licenses for re-use cases where no commercial compensation is sought by the copyright owner. The result is an agile, low overhead and cost copyright management regime, profiting both copyright owners and licensees.

Creative Commons has been described as being at the forefront of the copy left movement, which seeks to support the building of a richer public domain by providing an alternative to the automatic “all rights reserved” copyright, dubbed “some rights reserved.” David Berry and Giles Moss have credited Creative Commons with generating interest in the issue of intellectual property and contributing to the re-thinking of the role of the “commons” in the “information age”. Beyond that, Creative Commons has provided “institutional, practical and legal support for individuals and groups wishing to experiment and communicate with culture more freely.”

Why CC?

The idea of universal access to research, education, and culture is made possible by the Internet, but our legal and social systems don’t always allow that idea to be realized. Copyright was created long before the emergence of the Internet, and can make it hard to legally perform actions we take for granted on the network: copy, paste, edit source, and post to the Web. The default setting of copyright law requires all of these actions to have explicit permission, granted in advance, whether you’re an artist, teacher, scientist, librarian, policymaker, or just a regular user. To achieve the vision of universal access, someone needed to provide a free, public, and standardized infrastructure that creates a balance between the reality of the Internet and the reality of copyright laws. That someone is Creative Commons.

Logic Programming Paradigm

Logic Programming

  Logic programming is one of the 4 main programming paradigms. Its theory of computation is based on first order logic . programming languages such as Prolog and datalog  implement it.

  •  Prolog (Programming in logic, 1972) is the most well known
  • representative of the paradigm. Prolog is based on Horn clauses and SLD resolution.
  • Mostly developed in fifth generation computer systems project.
  • Specially designed for theorem proof and artificial intelligence.
  • but allows general purpose computation.

A form of logical sentences commonly found in logic programming, but not exclusively, is the  Horn clause . An example is:

p(X, Y) if q(X) and r(Y)

Some logic programming languages accept other logical sentences, such as the “choice” sentence in answer set programming.

Logical sentences can be understood purely declaratively. They can also be understood procedurally as goal-reduction procedures : to solve p(X, Y), first solve q(X), then solve r(Y).

A ramming paradigm Progbased on logic (more accurately, the Predicate Calculus?). A program is represented by a set of facts (statements/relationships which are held to be true), and a set of axioms (i.e. if A is true, then B is true). The axioms and clauses may have arguments.

For example, one could define the relation child(A,B), meaning that A is a child of B. One then could establish a set of facts (stored in a database–see below):

Child (Pebbles, Fred)

Child (Pebbles, Wilma)

Child (Wilma, Freds-mother-in-law) (what’s her name?)

Child (Bam-bam, Barney)

Child (Bam-bam, Betty)

One can query the database:

Child ? (Pebbles, Fred) -> True

Child ?  (Pebbles, Barney) -> False (at least Fred hopes not!)

One then can define define a descendent relationship, the transitive closure of the child relationship (this is pseudocode , obviously)

Descendent (A ,  B) := child(A,B)

Descendent  (A, B) := exists(x : child(A,  x) && descendent(x, B))

One can query these relationships as well.

Descendent ? (Pebbles , Fred) -> True

Descendent ? (Pebbles, Freds-mother-in-law)? True

Descendent ? (Pebbles, Barney) -> False.

A theorem proving system is used to search the database of facts and to determine what is true and what isn’t.

Lab evaluation-3 -Nagaraj

Case study:  Web framework for online book store

Activities

1)      The programming paradigm applicable for the case are

Object  Oriented programming paradigm

Functional oriented Programming paradigm

Multi paradigm programming language

2)      The elements of coding standards included in this case

Commenting code

Java Comments

 

Comment Type Usage Example
Documentation

Starts with /** and ends with */

Used before declarations of interfaces, classes, member functions, and fields to document them. /**

* Customer – a person or

* organization

*/

C style

 

Starts with /* and ends with */

Used to document out lines of code that are no longer applicable. It is helpful in debugging.

 

/*

This code was commented     out by

*/

 

Single line

 

Starts with // and go until the end of the line

Used internally within member functions to document business logic, sections of code, and declarations of temporary variables. // If the amount is greater

// than 10 multiply by 100

 Naming Accessor Member Functions

 

Getters: member functions that return the value of a field / attribute / property of an object.

Use prefix “get” to the name of the field / attribute / property if the field in not boolean

Use prefix “is” to the name of the field / attribute / property if the field is Boolean

A viable alternative is to use the prefix ‘has’ or ‘can’ instead of ‘is’ for boolean getters.

 

Examples

ex.getMessage();

Setters: member functions that modify the values of a field.

Use prefix ‘set’ to the name of the field.

Example

setMessage();

Member Function Visibility

 

A good design requires minimum coupling between the classes. The general rule is to be as restrictive as possible when setting the visibility of a member function. If member function doesn’t have to be public then make it protected, and if it doesn’t have to be protected than make it private.

3)

    Maintainability is achieved , ability of the system to undergo changes with a degree of ease. These    changes could impact components, services, features, and interfaces when adding or changing the functionality, fixing errors, and meeting new business requirements.

Usability  can achieved  how well the application meets the requirements of the user and consumer by being intuitive, easy to localize and globalize, providing good access for disabled users, and resulting in a good overall user experience.

Reliability is achieved f a system to remain operational over time. Reliability is measured as the probability that a system will not fail to perform its intended functions over a specified time interval.

Note:

I have used Java programming language, since the java programming language consits of  Object  Oriented programming paradigm ,Functional oriented Programming  paradigm

.

 

 

Code snippets

.login

<html>
<body bgcolor=”beige”>
<center>

<jsp:useBean id=”user” class=”obs.User” scope=”session” />

<jsp:setProperty name=”user” property=”*” />

<%
user.login();
if (! user.isLogged())
%>
<h3>Invalid Login. Click <a href=login.html>here</a> to try again! </h3>
<%
else
response.sendRedirect(“home.jsp”);
%>

</center>
</body>
</html>

Customer:

public class Customer
{

private String custname;
private String password;
private String email;
private String phoneno;

private Context ctx;

public Context getJNDIContext()
{
return ctx;
}

public Customer()
{
ctx = getInitialContext();
}

public void setCustname(String custname)
{ this.custname = custname; }

public String getCustname()
{ return custname; }

public void setPhoneno (String phoneno)
{ this.phoneno = phoneno; }

public String getPhoneno()
{ return phoneno; }

public void setPassword(String password)
{ this.password= password; }

public String getPassword()
{ return password; }

public void setEmail (String email)
{ this.email = email; }

public String getEmail()
{ return email; }

// returns true if uname and pwd are valid
public boolean isValid()
{
Connection con = null;
PreparedStatement ps = null;
try
{
con = getConnection();
ps = con.prepareStatement(“select phoneno, email from customers where custname = ? and pwd= ?”);
ps.setString(1,custname);
ps.setString(2,password);

ResultSet rs = ps.executeQuery();
boolean found = false;

if ( rs.next())
{ phoneno = rs.getString(“phoneno”);
email = rs.getString(“email”);
found = true;
}
return found;
}

CART-

public class Cart
{
ArrayList items = new ArrayList();

public Item find(String isbn)
{
Iterator itr = items.iterator();
Item itm;
while ( itr.hasNext())
{
itm = (Item) itr.next();
if ( itm.getIsbn().equals(isbn))
{
return itm;
}
} // end of while

return null;
}

Link of source code

https://github.com/nagrajmetta/Web-framework-for-online-book-store-lab