Dear Programmers please help me with this task I need a prog
Dear Programmers please help me with this task;
I need a program written in any language including java, c++, javascript etc to show \'\' best chain solution \'\' with a simple user interface from decision making tree for example
here i built a tree from google search with it\'s priority tags such as 0.9 , 0.8 , 0.7
what i need ?
Step 1) Progam should have basic user interface with all of leaf and internal nodes to be selected by user in a kind of list and a button with title \'\' Please select for the solution \'\' >> registrar, websites, lookup, login, ultimate team, not working, format, to pdf online, conventer, registration, definition, fifa 17, development, ideas etc..
Step 2) User selects one / or more of those leaf or internal nodes and program shows us in user interface results according to sum of priority tags
For example user selected two leaf nodes registrar and login , then program shows us results like;
Best chain solutions;
1) Web_address_registration_registrar
2) Web_app_fifa_17_login
and this order of results depends on sum of priority tags 1) 0.9 + 0.9 + 0.9 = 2.7 2) 0.8 + 0.9 + 0.9 = 2.6
Step 3) User interface should have additional button like \'\' Try again \'\' or \'\' Go back \'\' for selecting and getting results again.
All i need source codes and screenshot of running program if possible. I don\'t have time problem for the solution. Just answer whenever you complete this program please. You can use my tree for the program. No matter. You do not need to create a new tree.
address 0.9 0.8 registration definition 0.9 0.8 registrar websites Web 0.9 0.7 0.8 0.9 0.9 archive 0.7 app 0.7 0.7 0.8 0.8 lookup fifa 17 way back instagram development ideas file 0.9 0.7 0.8 ultimate format to pdf online conventer not working lookup teamSolution
Below is the sample java program along with the Database connectivity for the login page.
Fill the form fields i.e. username and password and click on SignUp button.After fill up all the fields when you click on SignUp button JOptionPane message window will be display.
To create sign up page along with database connectivity in java where we have created a new user sign up page and stored its record into database with the help of SQL statements and also viewed the table records with the help of respective SQL queries.
//import statements
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class Connectivity //create class Connectivity
{
// JDBC driver name and database URL
static final String JDBC_DRIVER = \"com.mysql.jdbc.Driver\";
static final String DB_URL = \"jdbc:mysql://localhost/demo\";
// Database credentials
static final String USER = \"root\" ;
static final String PASS = \"root\";
public static void main(String[] args) //main method
{
Connection conn = null; //create object of Connection and define it null
try //try block
{
//STEP 2: Register JDBC driver
Class.forName(\"com.mysql.jdbc.Driver\");
//STEP 3: Open a connection
System.out.println(\"Connecting to a selected database...\");
conn = DriverManager.getConnection(DB_URL, USER, PASS);
//print on console
System.out.println(\"Connected database successfully...\");
}
catch(SQLException se) //catch block
{
//Handle errors for JDBC
se.printStackTrace();
}
catch(Exception e) //catch block
{
//Handle errors for Class.forName
e.printStackTrace();
}
finally //finally block
{
//finally block used to close resources
try //try block
{
if(conn!=null)//condition
conn.close(); //close connection
}
catch(SQLException se)//Handle errors
{
se.printStackTrace();
}//end finally try
}//end try
System.out.println(\"Goodbye!\"); //print on console
}//end main
}
//import statement
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Wrapper;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
public class NewUser extends JFrame //create class NewUser
{
private JPanel contentPane; //declare variable
private JTextField txtUser;
private JButton btnSignup;
private JTextField txtPassword;
protected java.lang.String Spassword;
// database URL
static final String DB_URL = \"jdbc:mysql://localhost/demo\";
// Database credentials
static final String USER = \"root\";
static final String PASS = \"root\";
protected static final String String = null;
/**
* Launch the application.
*/
public static void main(String[] args) // main method
{
EventQueue.invokeLater(new Runnable()
{
public void run() //define run method
{
try //try block
{
//create NewUser frame object
NewUser frame = new NewUser();
//set NewUser frame visible
frame.setVisible(true);
}
catch (Exception e) //catch block
{
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public NewUser() //create constructor
{
//set title
setTitle(\"New User Login\");
//set close operation
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//set bounds of frame
setBounds(100, 100, 450, 300);
//create object of JPanel
contentPane = new JPanel();
//set contentPane border
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
set ContentPane with new object
setContentPane(contentPane);
set contentPane layout is null
contentPane.setLayout(null);
// create text field for user
txtUser = new JTextField();
//set bounds for text fields
txtUser.setBounds(188, 51, 99, 20);
//in contentPane add text field
contentPane.add(txtUser);
//set column for text field
txtUser.setColumns(10);
//lable the text field
JLabel lblUserName = new JLabel(\"User Name\");
//set bounds for label
lblUserName.setBounds(70, 54, 86, 14);
//add into contentPane
contentPane.add(lblUserName);
//lable the text field
JLabel lblPassword = new JLabel(\"Password\");
//set bounds for label
lblPassword.setBounds(70, 109, 86, 14);
//add into contentPane
contentPane.add(lblPassword);
//create button signup
btnSignup = new JButton(\"SignUp\");
//add event handler on SignUp button
btnSignup.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
}
//Create wrapper object and define it null
Wrapper conn = null;
try //try block
{
//declare variables
String username = \"\";
String password = \"\";
//get values using getText() method
username = txtUser.getText().trim();
password = txtPassword.getText().trim();
// check condition it field equals to blank throw error message
if (username.equals(\"\")|| password.equals(\"\"))
{
JOptionPane.showMessageDialog(null,\" name or password or Role is wrong\",\"Error\",JOptionPane.ERROR_MESSAGE);
}
else //else insert query is run properly
{
String IQuery = \"INSERT INTO `demo`.`loginaccount`(`username`,`password`,`ts`) VALUES(\'\"+username+\"\', \'\"+password+\"\',current_timestamp)\";
System.out.println(IQuery);//print on console
System.out.println(\"Connecting to a selected database...\");
//STEP 3: Open a connection
conn = DriverManager.getConnection(DB_URL, USER, PASS);
System.out.println(\"Connected database successfully...\");
((Connection)conn).createStatement().execute(IQuery);//select the rows
// define SMessage variable
String SMessage = \"Record added for \"+username;
// create dialog ox which is print message
JOptionPane.showMessageDialog(null,SMessage,\"Message\",JOptionPane.PLAIN_MESSAGE);
//close connection
((java.sql.Connection)conn).close();
}
}
catch (SQLException se)
{
//handle errors for JDBC
se.printStackTrace();
}
catch (Exception a) //catch block
{
a.printStackTrace();
}
}.
});
//set bound for SignUp button
btnSignup.setBounds(131, 165, 89, 23);
//add button into contentPane
contentPane.add(btnSignup);
//create text field for password
txtPassword = new JTextField();
//set bound for password field
txtPassword.setBounds(188, 106, 99, 20);
//add text field on contentPane
contentPane.add(txtPassword);
//set column for password text field
txtPassword.setColumns(10);
}
You can check into MySQL database
Example of SQL Query:select * from `demo`.`loginaccount`







