I keep getting this error. I am trying to make a executive search program about the problem. I also keep getting error lines on System.out.println(); I tried other complier like programmiz. It says identifier /tmp/a9mK0HuSgu/HelloWorld.java:38: error: expected System.out.println(mincost); ^ Exception in thread "main" java.lang.Error: Unresolved compilation problem: at ExecutiveSearch.main(ExecutiveSearch.java:3) public class ExecutiveSearch {

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
I keep getting this error. I am trying to make a executive search program about the problem. I also keep getting error lines on System.out.println();

I tried other complier like programmiz. It says identifier /tmp/a9mK0HuSgu/HelloWorld.java:38: error: expected System.out.println(mincost); ^

Exception in thread "main" java.lang.Error: Unresolved compilation problem: at ExecutiveSearch.main(ExecutiveSearch.java:3)


public class ExecutiveSearch {
    public static void main(String [] args) {
        int[] c1= {9,2,7,8};
        int[] c2= {6,4,3,7};
        int[] c3= {5,8,1,8};
        int[] c4= {7,6,9,4};
        int p1=0;
        int p2=0;
        int p3=0;
        int p4=0;
        int mincost=Integer.MAX_VALUE;
        
        for(int i=0;i<4;i++) {
            for(int j=0;j<4;j++) {
                for (int k=0;j<4;k++) {
                    for(int l=0;j<4;l++) {
                        if(i!=j && j!=k && k!=l && i!=k && i!=l && j!=l) {
                            if ((c1[i]+c2[j]+c3[k]+c4[l])<=mincost) {
                            
                            mincost = (c1[i]+c2[j]+c3[k]+c4[l]);
                            p1=i+1;
                            p2=j+1;
                            p3=k+1;
                            p4=l+1;
                        }
                        
                    }
                    else;
                        continue;
                    }
                }
            }
        }
    }
    System.out.println(mincost);
    System.out.println(p1);
    System.out.println(p2);
    System.out.println(p3);
    System.out.println(p4);
}

can you make this into a proper java code?

 

Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY