Commit b6069def authored by erfan's avatar erfan

karga source code

parents
Pipeline #2011 failed with stages
package com.company;
/**
* This class is about student
* its access is public
*/
public class Main {
public static void main(String[] args) {
Student[] student = new Student[5];
student[0]=new Student("sdf","fsdfdsf","2");
student[1]=new Student("sdf","fsdfdsf","2");
student[2]=new Student("sdf","fsdfdsf","2");
student[3]=new Student("sdf","fsdfdsf","2");
student[4]=new Student("sdf","fsdfdsf","2");
}
}
\ No newline at end of file
package com.company;
public class Student {
private String firstName;
private String lastName;
private int grade;
private String Id;
public Student(String fn, String ln, String id){
firstName=fn;lastName=ln;grade=0;Id=id;
}
public String getFirstName() {
return firstName;
}
public int getGrade() {
return grade;
}
public String getLastName() {
return lastName;
}
public String getId() {
return Id;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public void setGrade(int grade) {
this.grade = grade;
}
public void setId(String id) {
Id = id;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public void print(){
System.out.println("first name:"+ firstName +"last name" + lastName +"id:" + Id + "grade:"+ grade);
}
}
\ No newline at end of file
package com.company;
/**
* @author erfan omid seyed
* this class have 4 field and it's about student of a school
* @since 2020-01-24
* @
*/
public class lab {
Student[] students;
int avg;
String day;
int capt;
int size;
public lab(int cap,String d){
}
/**
* this is method for lab class
* @param std this is the first parametr
*/
public void enrollStudent(Student std){
if(size < capt){
students[size] = std;
size++;
}else{
System.out.println("Lab is full!!!");
}
}
public void print(){}
public Student[] getStudents(){
return students;
}
public int getAvg() {
return avg;
}
public int getCapt() {
return capt;
}
public int getSize() {
return size;
}
public String getDay() {
return day;
}
public void setAvg(int avg) {
this.avg = avg;
}
public void setDay(String day) {
this.day = day;
}
public void setCapt(int capt) {
this.capt = capt;
}
public void setSize(int size) {
this.size = size;
}
public void setStudents(Student[] students) {
this.students = students;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment