This is my C++ code for the problem given below. But since i'm newbie to java, dont know how to write equivalent Java code. If you people can help, plz do so. Helping hands are always praised worthy. Im stuck...Plz assist me..
Code for Login page in C++
int main(int argc, char *argv)
int count = 0;
if(fp_in == NULL)
cout << "Could not open user file, exiting." << endl;
if(line_in.length() > 0)
pos = line_in.find("\t",0);
if( pos != string::npos)
user_pass[count] = line_in.substr(0,pos);
user_pass[count] = line_in.substr(pos+1);
if(!count > 0)
cout << "Userlist is empty, exiting" << endl;
cout << "Enter user name: ";
cin >> user;
cout << "Enter password: ";
cin >> pass;
int found = 0;
for(int x=0;x<count && !found;x++)
found = 1;
found = 1;
logged_in = 1;
cout << "Invalid password!" << endl;
cout << "Invalid username!" << endl;
cout << "Logged in successfully!" << endl;
string readString(ifstream& reader)
string str1 = buffer;
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 following the guidelines for writing code
b. Make use of Hungarian Notation for coding purpose
c. Make use of Comments in the Code where required necessary.