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
home / study / engineering / computer science / questions and answers / dear programmers please help me with this task; ...
Question: Dear Programmers please help me with this task; I ...
Bookmark
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 \'\' and under button the list;
registrar, websites, lookup, login, ultimate team, not working, format, to pdf online, conventer, registration, definition, fifa 17, development, ideas etc.. with check boxes
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.
Note: All i need source codes and screenshot of running program if possible. I don\'t have time problem for the solution. Just answer when you complete this program please. You can use my tree for the program. No problem. You can also change some parts of current tree above if you would like. Just mention in your answer if you do.
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
Hello, i will try to do the code for the above problem with java.Since i dont have any IDE with me now,please use the function i have provided just for now if it is urgent.Once i have the IDE i will provide the exact solution by tommorrow. I will tell you how to use the function with java gui. Use netbeans for gui. Give the values for the buttons as 1 = Address,2=definition,3=lookup,111=registrar,112=website,113=lookup and like wise. Call the function from the action performed method of the button.
Please use this solution for now,
I have added program1,program2 and a function.Program1 and program2 are command line menu based application, function is provided to include in the java gui program.
I have considered path Web->address path only for the coding, so it can be replicated to the others.
Program1 : This program shows the menu based on the selection from root to leaf. No direct internal node selection possible with this program. Please find program2 for direct internal node selection.
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be \"Main\" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
System.out.println(\"WEB\");
System.out.println(\"1.Address \ 2.App \ 3.Archive\");
double address_val=0.9;
double reg=0.9;
double def=0.8;
double lok=0.7;
double regi=0.9;
double web=0.8;
int flag=1;
while(flag==1)
{
System.out.println(\"Enter your selection:\");
int select = sc.nextInt();
System.out.println(\"You selected:\"+select);
double sum=0;
switch(select)
{
case 1 :
sum=sum+address_val;
System.out.println(\"1.registration \ 2.definition \ 3.Lookup\");
System.out.println(\"Enter your selection:\");
int select2 = sc.nextInt();
System.out.println(\"You selected:\"+select2);
if(select2==1)
{
sum=sum+reg;
System.out.println(\"1.registrar \ 2.websites \ 3.Lookup\");
System.out.println(\"Enter your selection:\");
int select3 = sc.nextInt();
System.out.println(\"You selected:\"+select3);
if(select2==1)
{
sum=sum+regi;
break;
}
}
else if(select2==2)
{
sum=sum+def;
break;
}
else if(select2==3)
{
sum=sum+lok;
break;
}
else
{
System.out.println(\"Not a valid selection\");
break;
}
default :
System.out.println(\"Invalid selection\");
}
System.out.println(\"Total value=\"+sum);
System.out.println(\"Do you want to continue?\");
System.out.println(\"1.Yes \ 2.No\");
int cont = sc.nextInt();
if(cont==1)
flag=1;
else
flag=0;
}
}
}
Output:
WEB
1.Address
2.App
3.Archive
Enter your selection: 1
You selected:1
1.registration
2.definition
3.Lookup
Enter your selection:1
You selected:1
1.registrar
2.websites
3.Lookup
Enter your selection:1
You selected:1
Total value=2.7
Do you want to continue?
1.Yes
2.No
Program2: Program with direct selection of internal nodes.
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be \"Main\" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
System.out.println(\"WEB\");
System.out.println(\"1.Address\");
System.out.println(\"11.Registration \ 12.Defination \ 13.Lookup\");
System.out.println(\"111.Registrar \ 112.Website \ 113.Lookup\");
double address_val=0.9;
double reg=0.9;
double def=0.8;
double lok=0.7;
double regi=0.9;
double web=0.8;
int flag=1;
while(flag==1)
{
System.out.println(\"Enter your selection:\");
int select = sc.nextInt();
System.out.println(\"You selected:\"+select);
double sum=0;
switch(select)
{
case 1 :
sum=sum+address_val;
break;
case 11 :
sum=sum+address_val+reg;
break;
case 12:
sum=sum+address_val+def;
break;
case 13:
sum=sum+address_val+lok;
break;
case 111:
sum=sum+address_val+reg+regi;
break;
case 112:
sum=sum+address_val+reg+web;
break;
case 113:
sum=sum+address_val+reg+lok;
break;
default :
System.out.println(\"Invalid selection\");
}
System.out.println(\"Total value=\"+sum);
System.out.println(\"Do you want to continue?\");
System.out.println(\"1.Yes \ 2.No\");
int cont = sc.nextInt();
if(cont==1)
flag=1;
else
flag=0;
}
}
}
Function:
void calculate_value(String val)
{
double address_val=0.9;
double reg=0.9;
double def=0.8;
double lok=0.7;
double regi=0.9;
double web=0.8;
int flag=1;
double sum=0;
int select = Integer.parseInt(val);
switch(select)
{
case 1 :
sum=sum+address_val;
total_val_label.setText(sum);
break;
case 11 :
sum=sum+address_val+reg;
total_val_label.setText(sum);
break;
case 12:
sum=sum+address_val+def;
total_val_label.setText(sum);
break;
case 13:
sum=sum+address_val+lok;
total_val_label.setText(sum);
break;
case 111:
sum=sum+address_val+reg+regi;
total_val_label.setText(sum);
break;
case 112:
sum=sum+address_val+reg+web;
total_val_label.setText(sum);
break;
case 113:
sum=sum+address_val+reg+lok;
total_val_label.setText(sum);
break;
default :
System.out.println(\"Invalid selection\");
}
}




