In: Computer Science
What would the pseudocode look like for this UML class diagram?
Class |
- oranges: String |
- bananas: String |
- grapes: String |
- apples: String |
+ Class(String bananas, String grapes, String apples) |
+ oranges( ): void |
+ isValidGrapes( ): boolean |
+ isValidApples( ): boolean |
+ getOranges( ): String |
+ getBananas( ): String |
+ setBananas(String bananas): void |
+ getGrapes( ): String |
+ setGrapes(String grapes): void |
+ getApples( ): String |
+ setApples(String apples): void |
below Sample Class Code
class Friuts {
private String oranges;
private String bananas;
private String grapes;
private String apples;
//constructor
public Friuts(String aOranges, String aBananas, String
aGrapes, String aApples) {
oranges = aOranges;
bananas = aBananas;
grapes = aGrapes;
apples = aApples;
}
//setters and getters
public void oranges() {
}
public String getOranges() {
return oranges;
}
public boolean isValidApples() {
return false;
}
public boolean isValidGrapes() {
return false;
}
public String getBananas() {
return bananas;
}
public void setBananas(String aBananas) {
bananas = aBananas;
}
public String getGrapes() {
return grapes;
}
public void setGrapes(String aGrapes) {
grapes = aGrapes;
}
public String getApples() {
return apples;
}
public void setApples(String aApples) {
apples = aApples;
}
}