Can you see whats wrong with the program : Test.java:7: error: cannot find symbol         Course CourseOne = new Course();         ^   symbol:   class Course   location: class Test Test.java:7: error: cannot find symbol         Course CourseOne = new Course();                                ^   symbol:   class Course   location: class Test 2 errors error: compilation failed The program is : import java.io.*; import javax.swing.*; public class Test { public static void main (String args[]){ Course CourseOne = new Course(); JTextField CourseIDField = new JTextField(5); JTextField CourseNameField = new JTextField(5); JTextField CourseCreditField = new JTextField(5); JTextField CourseDescField = new JTextField(5); String val; String Val2; String Val3; String Val4; CourseOne.SetCourseDetails("1000", "Java I","10", "This is good course"); CourseOne.printDetail(); Object[] message = { "Course ID", CourseIDField , "Course Name", CourseNameField , "Course Credit ", CourseCreditField, "Course Description", CourseDescField}; int option = JOptionPane.showConfirmDialog(null, message,"Course Details", JOptionPane.OK_CANCEL_OPTION); if (option == JOptionPane.OK_OPTION){ val = CourseIDField.getText(); Val2 = CourseNameField.getText(); Val3 = CourseCreditField.getText(); Val4 = CourseDescField.getText(); CourseOne.SetCourseDetails(val, Val2, Val3, Val4); CourseOne.printDetail(); } } } And the second one : public class Course{ private String Code; private String Name; private String Credit; private String Description; public void SetCourseDetails(String CourseCode, String CourseName, String CourseCredit, String CourseDesc){ Code = CourseCode; Name = CourseName; Credit = CourseCredit; Description = CourseDesc; } public void printDetail(){ System.out.println("Course Code :" + Code); System.out.println("Course Name :" + Name); System.out.println("Credit Score :" + Credit); System.out.println("Description Score :" + Description); } }

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

Can you see whats wrong with the program : Test.java:7: error: cannot find symbol
        Course CourseOne = new Course();
        ^
  symbol:   class Course
  location: class Test
Test.java:7: error: cannot find symbol
        Course CourseOne = new Course();
                               ^
  symbol:   class Course
  location: class Test
2 errors
error: compilation failed

The program is :

import java.io.*;
import javax.swing.*;

public class Test {
public static void main (String args[]){

Course CourseOne = new Course();
JTextField CourseIDField = new JTextField(5);
JTextField CourseNameField = new JTextField(5);
JTextField CourseCreditField = new JTextField(5);
JTextField CourseDescField = new JTextField(5);
String val;
String Val2;
String Val3;
String Val4;
CourseOne.SetCourseDetails("1000", "Java I","10", "This is good course");
CourseOne.printDetail();
Object[] message = { "Course ID", CourseIDField , "Course Name", CourseNameField , "Course Credit ", CourseCreditField, "Course Description", CourseDescField};
int option = JOptionPane.showConfirmDialog(null, message,"Course Details", JOptionPane.OK_CANCEL_OPTION);
if (option == JOptionPane.OK_OPTION){
val = CourseIDField.getText();
Val2 = CourseNameField.getText();
Val3 = CourseCreditField.getText();
Val4 = CourseDescField.getText();
CourseOne.SetCourseDetails(val, Val2, Val3, Val4);
CourseOne.printDetail();
}
}
}

And the second one :

public class Course{

private String Code;
private String Name;
private String Credit;
private String Description;

public void SetCourseDetails(String CourseCode, String CourseName, String CourseCredit, String CourseDesc){
Code = CourseCode;
Name = CourseName;
Credit = CourseCredit;
Description = CourseDesc;
}
public void printDetail(){
System.out.println("Course Code :" + Code);
System.out.println("Course Name :" + Name);
System.out.println("Credit Score :" + Credit);
System.out.println("Description Score :" + Description);
}

}

Expert Solution
steps

Step by step

Solved in 4 steps with 2 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