QDBordtoshred / WEni

MIT License
0 stars 0 forks source link

FRQ #4 #21

Open QDBordtoshred opened 7 months ago

QDBordtoshred commented 7 months ago

(a) NumberGroup Interface:

public interface NumberGroup {
    boolean contains(int num);
}

(b) Range Class:

public class Range implements NumberGroup {
    private int min;
    private int max;

    public Range(int min, int max) {
        this.min = min;
        this.max = max;
    }

    @Override
    public boolean contains(int num) {
        return num >= min && num <= max;
    }
}

(c) MultipleGroups Class contains Method:

import java.util.List;

public class MultipleGroups implements NumberGroup {
    private List<NumberGroup> groupList;

    public MultipleGroups(List<NumberGroup> groupList) {
        this.groupList = groupList;
    }

    @Override
    public boolean contains(int num) {
        for (NumberGroup group : groupList) {
            if (group.contains(num)) {
                return true;
            }
        }
        return false;
    }
}
aidenhuynh commented 7 months ago

Comments:

The requirement for assignment is a Jupyter Notebook that runs the code, correctly identifying the FRQ type, and a reflection for the problem.

Score:

0.6/0.9

VINERAJ commented 7 months ago

Your code should be in a Jupyter Notebook, and you show have an issue with the connection between the FRQ and PBL. For this FRQ, I will give you a score of 0.63/0.9