java程序设计课程?java程序设计课程考试重点
大家好,今天给各位分享java程序设计课程的一些知识,其中也会对java程序设计课程考试重点进行解释,文章篇幅可能偏长,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在就马上开始吧!
JAVA程序设计课程讲什么内容
《Java程序设计》课程是使用Java语言进行应用程序设计的课程。课程的主要目标有三:一、掌握Java语言的语法,能够较为深入理解Java语言机制,掌握Java语言面向对象的特点。二、掌握JavaSE中基本的API,掌握在集合、线程、输入输出、文本处理、图形用户界面、网络等方面的应用。三、能够编写有一定规模的应用程序,养成良好的编程习惯。本课程要对Java语言的一些机制会详细讲解,所以具有系统性。本课程还注重实践性,要讲Java语言在文本、文件、窗体界面、图形、数据库、多线程、并行编程方面的应用。还会讲到编好代码的经验与技巧,包括面向对象的思想、软件开发工具的使用等。在教学中,采用教师讲授、学生自测、学生讨论、编程实践相结合的方法。
java设计课程类
仅供参考
packagecom.kidd.test.zhidao;
importjava.util.ArrayList;
importjava.util.List;
/**
*Helloworld!
*
*/
publicclassExecute{
publicstaticvoidmain(String[]args){
Lessonlesson1,lesson2,lesson3;
lesson1=newLesson();
lesson1.setName("语文");
lesson1.setCredit(7);
lesson2=newLesson();
lesson2.setName("英语");
lesson2.setCredit(8);
lesson3=newLesson();
lesson3.setName("数学");
lesson3.setCredit(10);
Studentstudent=newStudent();
student.setName("陈云");
student.setNum("2017060901");
student.addLesson(lesson1);
student.addLesson(lesson2);
student.addLesson(lesson3);
lesson1.setScore(60);
try{
student.exam(lesson1);
}catch(ScoreExceptione){
System.out.println("输入的分数不合法.");
}
lesson2.setScore(70);
try{
student.exam(lesson2);
}catch(ScoreExceptione){
System.out.println("输入的分数不合法.");
}
lesson3.setScore(90);
try{
student.exam(lesson3);
}catch(ScoreExceptione){
System.out.println("输入的分数不合法.");
}
System.out.println(student);
student.removeLesson(lesson2);
System.out.println(student);
lesson3.setScore(50);
student.printLessons();
student.printCredit();
student.printAverage();
}
}
classLesson{
privateStringname;
privateintcredit;
privatefloatscore;
publicStringgetName(){
returnname;
}
publicvoidsetName(Stringname){
this.name=name;
}
publicintgetCredit(){
returncredit;
}
publicvoidsetCredit(intcredit){
this.credit=credit;
}
publicfloatgetScore(){
returnscore;
}
publicvoidsetScore(floatscore){
this.score=score;
}
}
classStudent{
privateStringname;
privateStringnum;
privateList<Lesson>lessons;
publicStudent(){
lessons=newArrayList<>();
}
publicvoidaddLesson(Lessonlesson){
intindex=lessons.indexOf(lesson);
if(index!=-1){
System.out.println("该学生已经学习了该课程.");
return;
}
lessons.add(lesson);
}
publicbooleanexam(Lessonlesson)throwsScoreException{
intindex=lessons.indexOf(lesson);
if(index==-1){
System.out.println("该学生并未学习此课程.");
returnfalse;
}
if(lesson.getScore()<=0||lesson.getScore()>=100){
thrownewScoreException();
}
lessons.get(index).setScore(lesson.getScore());
returntrue;
}
publicbooleanremoveLesson(Lessonlesson){
intindex=lessons.indexOf(lesson);
if(index==-1){
returnfalse;
}
lessons.remove(index);
returntrue;
}
publicStringgetName(){
returnname;
}
publicvoidsetName(Stringname){
this.name=name;
}
publicStringgetNum(){
returnnum;
}
publicvoidsetNum(Stringnum){
this.num=num;
}
publicList<Lesson>getLessons(){
returnlessons;
}
publicvoidsetLessons(List<Lesson>lessons){
this.lessons=lessons;
}
publicfloatgetAverage(){
floata=0f;
for(Lessonlesson:lessons){
a+=lesson.getScore();
}
returna/lessons.size();
}
publicintgetTotal(){
inta=0;
for(Lessonlesson:lessons){
if(lesson.getScore()>=60){
a+=lesson.getCredit();
}
}
returna;
}
@Override
publicStringtoString(){
StringBuildermessage=newStringBuilder();
message.append("该学生总共修了"+lessons.size()+"门课程.分别是:");
for(Lessonlesson:lessons){
message.append(lesson.getName()+",");
}
message.append("
");
message.append("该学生的平均成绩是:"+getAverage()+"
");
message.append("该学生的总学分是:"+getTotal()+"
");
returnmessage.toString();
}
publicvoidprintLessons(){
System.out.println("该学生总共修了"+lessons.size()+"门课程.分别是:");
for(inti=0,k=lessons.size();i<k;i++){
System.out.println(lessons.get(i).getName()+"成绩是:"+lessons.get(i).getScore());
}
System.out.println("");
}
publicvoidprintAverage(){
System.out.print("该学生平均成绩是:");
System.out.println(getAverage());
}
publicvoidprintCredit(){
System.out.print("该学生总学分是:");
System.out.println(getTotal());
}
}
classScoreExceptionextendsException{
/**
*
*/
privatestaticfinallongserialVersionUID=1L;
}
Java课程设计!急!!!(高分)
我帮你编写了一部分,实现了“输入十个同学的相关信息,并在文本框中显示”(图形界面实现)。
要实现接下去的功能其实也真的不难的,但是真的很麻烦、很浪费时间……我就帮你做到这里了,你自己添加一下代码就可以(或者提高悬赏的话可以考虑考虑啊!哈哈……)代码如下:
importjava.awt.BorderLayout;
importjavax.swing.JPanel;
importjavax.swing.JFrame;
importjava.awt.Dimension;
importjavax.swing.JButton;
importjava.awt.Rectangle;
importjavax.swing.JLabel;
importjavax.swing.SwingConstants;
importjavax.swing.JScrollPane;
importjavax.swing.JTextArea;
importjavax.swing.JOptionPane;
publicclassTongJiextendsJFrame{
privatestaticfinallongserialVersionUID=1L;
privateJPaneljContentPane=null;
privateJButtonjButton=null;
privateJLabeljLabel=null;
privateJScrollPanejScrollPane=null;
privateJTextAreajTextArea=null;
/**
*Thisisthedefaultconstructor
*/
publicTongJi(){
super();
initialize();
}
/**
*Thismethodinitializesthis
*
*@returnvoid
*/
privatevoidinitialize(){
this.setSize(412,372);
this.setContentPane(getJContentPane());
this.setTitle("成绩统计");
this.addWindowListener(newjava.awt.event.WindowAdapter(){
publicvoidwindowClosing(java.awt.event.WindowEvente){
System.exit(0);
}
});
this.setVisible(true);
}
/**
*ThismethodinitializesjContentPane
*
*@returnjavax.swing.JPanel
*/
privateJPanelgetJContentPane(){
if(jContentPane==null){
jLabel=newJLabel();
jLabel.setBounds(newRectangle(18,66,65,18));
jLabel.setHorizontalAlignment(SwingConstants.CENTER);
jLabel.setText("统计结果:");
jContentPane=newJPanel();
jContentPane.setLayout(null);
jContentPane.add(getJButton(),null);
jContentPane.add(jLabel,null);
jContentPane.add(getJScrollPane(),null);
}
returnjContentPane;
}
/**
*ThismethodinitializesjButton
*
*@returnjavax.swing.JButton
*/
privateJButtongetJButton(){
if(jButton==null){
jButton=newJButton();
jButton.setBounds(newRectangle(18,16,86,28));
jButton.setText("开始统计");
jButton.addActionListener(newjava.awt.event.ActionListener(){
publicvoidactionPerformed(java.awt.event.ActionEvente){
/////录入成绩信息
String[][]mymsg=newString[10][6];
for(inti=0;i<10;i++){
Stringstrnum=JOptionPane.showInputDialog(null,"请输入第"+(i+1)+"个学生的学号","信息录入",JOptionPane.WARNING_MESSAGE);
Stringstrname=JOptionPane.showInputDialog(null,"请输入第"+(i+1)+"个学生的姓名","信息录入",JOptionPane.WARNING_MESSAGE);
Stringdoublemath=JOptionPane.showInputDialog(null,"请输入第"+(i+1)+"个学生的数学成绩","信息录入",JOptionPane.WARNING_MESSAGE);
Stringdoubleeng=JOptionPane.showInputDialog(null,"请输入第"+(i+1)+"个学生的英语成绩","信息录入",JOptionPane.WARNING_MESSAGE);
Stringdoublejava=JOptionPane.showInputDialog(null,"请输入第"+(i+1)+"个学生的JAVA成绩","信息录入",JOptionPane.WARNING_MESSAGE);
Stringdoublecomp=JOptionPane.showInputDialog(null,"请输入第"+(i+1)+"个学生的计算机成绩","信息录入",JOptionPane.WARNING_MESSAGE);
mymsg[i][0]=strnum;
mymsg[i][1]=strname;
mymsg[i][2]=doublemath;
mymsg[i][3]=doubleeng;
mymsg[i][4]=doublejava;
mymsg[i][5]=doublecomp;
}
////显示成绩信息
jTextArea.setText("学号姓名数学英语JAVA计算机");
for(inti=0;i<10;i++){
jTextArea.setText(jTextArea.getText()+"
");
for(intj=0;j<6;j++){
jTextArea.setText(jTextArea.getText()+mymsg[i][j]+"");
}
}
}
});
}
returnjButton;
}
/**
*ThismethodinitializesjScrollPane
*
*@returnjavax.swing.JScrollPane
*/
privateJScrollPanegetJScrollPane(){
if(jScrollPane==null){
jScrollPane=newJScrollPane();
jScrollPane.setBounds(newRectangle(18,86,370,230));
jScrollPane.setViewportView(getJTextArea());
}
returnjScrollPane;
}
/**
*ThismethodinitializesjTextArea
*
*@returnjavax.swing.JTextArea
*/
privateJTextAreagetJTextArea(){
if(jTextArea==null){
jTextArea=newJTextArea();
jTextArea.setEditable(false);
}
returnjTextArea;
}
publicstaticvoidmain(Stringargs[]){
newTongJi();
}
}//@jve:decl-index=0:visual-constraint="10,10"
效果如下图:
关于java程序设计课程,java程序设计课程考试重点的介绍到此结束,希望对大家有所帮助。