HOME | Blog | Software | Reviews and Features | Forum | Help | Donate
Click here to
donate and join now!
Welcome Guest.   Make a donation to an author on the site March 28, 2015, 08:08:43 PM  *

Please login or register.
Or did you miss your validation email?

Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.

You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
Read the full one-year retrospective report on DonationCoder.com.
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Plz tell me how can i bring high quality to this Java code. it's urgent  (Read 2815 times)
Posts: 2

View Profile Give some DonationCredits to this forum member
« on: June 14, 2009, 12:40:42 AM »

well, i have written this code for the problem give below. Plz help me to bring high quality to this i.e use of Hungarian Notation and commnts as required in the problem given below:
Writing a maintainable code makes the product with High Quality. Here you are given a scenario where you have to write a maintainable code for the given problem.


Virtual Solutions is an IT solution provider company. It has hired you as a Software Engineer. Your job is to write code, but at the same it should be of High Quality.  Your Team Lead has asked you to write a very small code of user login functionality. The code should be of High Quality.

You are required to

a.   Write correct code for the user login in Java or C++
b.   Make use of Hungarian Notation for coding purpose
c.   Make use of Comments in the Code where required necessary.


<title>Khalid Mahmood   </title>



Please enter your user name and



 <form  action="process2.jsp "    method = "post" >

<input type = "text" name=


<input type = "password" name =

<input type="submit"     name="Submit"



<%@ page import="java.util.*" %>
<jsp:useBean id="idHandler" class="foo.Login" scope="request">
<jsp:setProperty name="idHandler" property="*"/>

   if (idHandler.validate()) {
<jsp:forward page="success.jsp"/>
   }  else {
<jsp:forward page="retry.jsp"/>

package foo;
 import java.sql.*;

 public class Login {

   private String username = "";
 private String password = "";

   public Login() {

  public void setUsername(String username) {
     this.username = username;

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

 public boolean  authenticate(String username2,
 String password2) {
  String query="select * from Registration;";
   String DbUserName="";
   String DbPassword="";
   String finalUser="";
  try {
   Statement stat=con.createStatement();
   ResultSet rst=stat.executeQuery(query);



   if (username2.equals(DbUserName) &&
 password2.equals(DbPassword)) {


 return true;
 }catch(Exception e){

 return false;
Charter Honorary Member
Posts: 8,787

[Well, THAT escalated quickly!]

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: June 14, 2009, 10:25:04 AM »

Pay more attention in class? smiley

- carpe noctem
Supporting Member
Posts: 58


View Profile WWW Give some DonationCredits to this forum member
« Reply #2 on: February 20, 2010, 02:13:45 AM »

Hey, where did ya get that? facebook puzzles?

smiley I love coding
Stoic Joker
Honorary Member
Posts: 5,644

View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: February 20, 2010, 10:45:55 AM »

So just add commenting to the code in Hungarian...

Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.055s | Server load: 0.04 ]