I am a C/C++ progammer, and am new at Java. I am spending 3 to 4 hours a day
teaching my self; however I am at an impasse with debugging. The Java syntax
is heafty, thus I have concluded that it's going totkae long to learn than
what I anticipate.

These programs were constructed according to the syntax from a Java programming
book I purchased at Borden books. Still I am getting errors that I am at
a lost correcting:

Prog#1
import java.awt.event.*;
import java.util.*;
public class Course
{
public Course( String Cnum, String Cnam )
{
init( Cnum, Cnam ,"unknown","unknown", "unknown","unknown","unknown");
}
public Course( String Cnum, String Cnam,String Cdis )
{
init( Cnum, Cnam,"unknown","unknown","unknown","unknown","unknown" );
}
public Course( String Cnum, String Cnam,String Cdis,String Iname )
{
init( Cnum, Cnam, Cdis,Iname ,"unknown","unknown","unknown");
}
public Course( String Cnum, String Cnam,String Cdis,String Inname,String
Acterm )
{
init( Cnum, Cnam, Cdis, Iname, Acterm ,"unknown","unknown");
}
public Course( String Cnum, String Cnam,String Cdis,String Inname,String
Acterm,String Cstatus )
{
init( Cnum, Cnam, Cdis, Iname, Acterm, Cstatus,"unknown" );
}
public Course( String Cnum, String Cnam,String Cdis,String Iname,String Acterm,String
Cstatus, String Cgrade)
{
init( Cnum, Cnam, Cdis, Iname, Acterm, Cstatus, Cgrade );
}
public void setCourseNumber(String Cnum ) { coursenumber = Cnum; }
public String getCourseNumber(){ return coursenumber; }
public void setCourseName(String Cnam ) { coursename = Cnam; }
public String getCourseName() { return coursename; }
public void setCourseDescription(String Cdis ) { coursedis = Cdis; }
public String getCourseDescription(){ return coursedis; }
public void setInstructorName(String Inname ) { Iname = Inname; }
public String getInstructorName() { return Iname; }
public void setAcadamicTerm(String Acterm ) { acadterm = Acterm; }
public String getAcadamicTerm() { return acadterm ;}
public void setRequiredElective(String Cstatus ) { coursestatus = Cstatus;
}
public String getRequiredElective() { return coursestatus; }
public void setCourseGrade(String Cgrade ) { coursegrade = Cgrade; }
public String getCourseGrade() { return coursegrade; }

public void dump()
{
System.out.println( "Course Number: "+ coursenumber );
System.out.println ( "Course Name: "+ coursename );
System.out.println ( " Course Descpition: " +coursedis );
System.out.println ( "Instructor Name : " + Iname );
System.out.println ( " Acadamic Term: " + acadterm );
System.out.println ( " Required or Elective " +coursestatus );
System.out.println ( " Course Grade " + coursegrade );
}
private void init (String a,String b, String c, String d, String e, String
f,String g)
{
coursenumber = a;
coursename = b;
coursedis = c;
Iname = d;
acadterm = e;
coursestatus = f;
coursegrade = g;
}
private String coursenumber;
private String coursename;
private String coursedis;
private String Iname;
private String acadterm;
private String coursestatus;
private String coursegrade;
}

Prog#2
import java.io.*;
import java.util.*;
class RecordData
{ public static void main(String[] args) throws IOException
{
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));


SRecord RR2 = new ARecord("101","Luke Jone");
String addMore = "yes";
while (true)
{ System.out.print("Add more course? ");
addMore = stdin.readLine();
if (addMore.equalsIgnoreCase("no")) break;
RR2.addCourse();
}

SRecord RR3 = new ARecord();
System.out.print("Enter student number: ");
RR3.setStudentNum(stdin.readLine());
System.out.print("Enter student name: ");
RR3.setStudentName(stdin.readLine());
addMore = "yes";
while (true)
{ System.out.print("Add more course? ");
addMore = stdin.readLine();
if (addMore.equalsIgnoreCase("no")) break;
RR3.addCourse();
}
RR2.dumpRecord();
RR3.dumpRecord();
}
}

Prog#3
import java.io.*;
class CourseData
{
public static void main(String[] a) throws IOException
{
BufferedReader s = new BufferedReader(new InputStreamReader(System.in));


Course c101 = new Course("comp 101");
Course c102 = new Course("comp 102");
Course c103 = new Course("comp 103");


System.out.println("Enter course number:");
c101.setCourseNumber(s.readLine());
System.out.println("Enter course name:");
c101.setCourseName(s.readLine());
System.out.println("Enter course discription:");
c101.setCourseDescription(s.readLine());
System.out.println("Enter Instructor name:");
c101.setInstructorName(s.readLine());
System.out.println("Enter course term:");
c101.setAcadamicTerm(s.readLine());
System.out.println("Enter course status:");
c101.setRequiredElective(s.readLine());
System.out.println("Enter course grade:");
c101.setCourseGrade(s.readLine());
c101.dumpCourse();
c102.dumpCourse();
c103.dumpCourse();

}
}

Prog#4
import java.util.*;
class RegiRecord
{
public RegiRecord(String SchoolName)
{
InstName = SchoolName;
}

private String InstName;

private Hashtable ht = new Hashtable();

public String getInstName()
{
return InstName;
}
public void setInstName(String SchoolName)
{
InstName=SchoolName;
}

public void addNewRecord(SRecord RR)

{
ht.put(RR.getStudentNum(),RR);
}

public SRecord getRecord(String SKey)

{
SRecord RR2 = new SRecord();
RR2 = (SRecord) ht.get(SKey);
return RR2;
}

public void dumpRegistrar()

{
System.out.println("\nInstitution Name: " + InstName);
SRecord RR = new SRecord();
Enumeration e = ht.elements();
while (e.hasMoreElements())
{
RR = (SRecord) e.nextElement();
RR.dumpRecord();
}
}
}

Prog#5
import java.util.*;
import java.io.*;
public class Record
{
public Record(String Snam)
{
init(Snam,Snum);
}
public Record(String Snam,String Sum)
{
init( Snam,Snum);
}
private Vector Clist = new Vector();
public String getStudentNumber(){ return StudentNumber; }
public void setStudentName(String Snam ) { StudentName = Snam; }
public String getStudentName(){ return StudentName; }

public void addCourse() throws IOException
{BufferedReader Stdin = new BufferedReader(new InputStremReader(System.in));

Course cNew = new Course();
System.out.print("Enter course number:");
cNew.setCourseNumber(Stdin.readline());
System.out.print("Enter course name:")
cNew.setCoursename(Stdin.readline());
System.out.print("Enter course discription:");
cNew.setCoursedis(Stdin.readline());
System.out.print("Instructor Name:");
cNew.setIname(Stdin.readline());
System.out.print("Accadamic Term:");
cNew.setAcadterm(Stdin.readline());
System.out.print("Enter course Status:");
cNew.setCoursestatus(Stdin.readline());
System.out.print("Enter course Grade:");
cNew.setCoursegrade(Stdin.readline());
Courselist.addElement(cnew);
}
public void dumpRecord()
{
System.out.println();
System.out.println( "Student Number: "+ StudentName );
System.out.println ( "Course Name: "+ StudentNumber );
System.out.println("Course taken;");
Course cCourse = new Course();
Enumeration e = CourseList.elements();
while (e.hasMoreelements())
{ cCours = (Course) e.nextElement();
cCourse.dumpCouse();
}
}
}

Prog#6
import java.util.*;
import java.io.*;
public class SRecord
{
public Record(String Snum)
{
StudentNumber=Snum;Studentname="unknown"; Vector CourseList= new Vector();

}
public Record(String Snam,String Snum)
{
StudentName=Snam;StudentNumber=Snum; Vector CourseList= new Vector();
}
String Snum;String Sname;
private String StudentNumber;
private String StudentName;
private Vector CoureList;
public String getStudentNumber(){ return StudentNumber; }
public void setStudentName(String Snam ) { StudentName = Snam; }
public String getStudentName(){ return StudentName; }

public void addCourse() throws IOException
{
BufferedReader Instr = new BufferedReader(new InputStremReader(System.in));

Course Newc = new Course();
System.out.print("Enter course number:");
Newc.setCourseNumber(Instr.readline());
System.out.print("Enter course name:")
Newc.setCoursename(Instr.readline());
System.out.print("Enter course discription:");
Newc.setCourseDescription(Instr.readline());
System.out.print("Instructor Name:");
Newc.setInstuctorName(Instr.readline());
System.out.print("Accadamic Term:");
Newc.setAcadamicTerm(Instr.readline());
System.out.print("Enter course Status:");
Newc.setRequiredElective(Instr.readline());
System.out.print("Enter course Grade:");
Newc.setCourseGrade(Instr.readline());
Courselist.addElement(Newc);
}
public void dumpSRecord()
{
System.out.println();
System.out.println( "Student Number: "+ StudentName );
System.out.println ( "Course Name: "+ StudentNumber );
System.out.println("Course taken;");
Course CourseN = new Course();
Enumeration e = CourseList.elements();
while (e.hasMoreElements())
{ CourseN = (Course) e.nextElement();
CourseN.dumpCouse();
}
}
}


Prog#7
import java.util.*;
import java.io.*;
public class SRecord
{
public Record(String Snum)
{
StudentNumber=Snum;Studentname="unknown"; Vector CourseList= new Vector();

}
public Record(String Snam,String Snum)
{
StudentName=Snam;StudentNumber=Snum; Vector CourseList= new Vector();
}
String Snum;String Sname;
private String StudentNumber;
private String StudentName;
private Vector CoureList;
public String getStudentNumber(){ return StudentNumber; }
public void setStudentName(String Snam ) { StudentName = Snam; }
public String getStudentName(){ return StudentName; }

public void addCourse() throws IOException
{
BufferedReader Instr = new BufferedReader(new InputStremReader(System.in));

Course Newc = new Course();
System.out.print("Enter course number:");
Newc.setCourseNumber(Instr.readline());
System.out.print("Enter course name:")
Newc.setCoursename(Instr.readline());
System.out.print("Enter course discription:");
Newc.setCourseDescription(Instr.readline());
System.out.print("Instructor Name:");
Newc.setInstuctorName(Instr.readline());
System.out.print("Accadamic Term:");
Newc.setAcadamicTerm(Instr.readline());
System.out.print("Enter course Status:");
Newc.setRequiredElective(Instr.readline());
System.out.print("Enter course Grade:");
Newc.setCourseGrade(Instr.readline());
Courselist.addElement(Newc);
}
public void dumpSRecord()
{
System.out.println();
System.out.println( "Student Number: "+ StudentName );
System.out.println ( "Course Name: "+ StudentNumber );
System.out.println("Course taken;");
Course CourseN = new Course();
Enumeration e = CourseList.elements();
while (e.hasMoreElements())
{ CourseN = (Course) e.nextElement();
CourseN.dumpCouse();
}
}
}

Prog#8
import java.io.*;
class Pn
{
public static void main( String[ ] args )throws IOException
{
FileReader infile=new FileReader( "input.data" );
BufferedReader input = new BufferedReader( infile );
int i = 2, m;
String s=input.readLine();
s = s.trim();
int max =Integer.parseInt(s);
for (i = 2; i <= max ;i++)
{
for (m = 2;m < i;m++)
{
if( i % m == 0)break;
}
if (i == m)
System.out.println("Prime number: " +i);
}
}
}