Skip to content

Instantly share code, notes, and snippets.

@AnnaBoro
Created October 25, 2015 22:20
Show Gist options
  • Save AnnaBoro/370b33beb684c7b90999 to your computer and use it in GitHub Desktop.
Save AnnaBoro/370b33beb684c7b90999 to your computer and use it in GitHub Desktop.
lesson4 - Frame7
package lesson4;
public class Bed {
String color;
String manufactureBy;
int bedLength;
int bedWidth;
int reccomendLoading;
boolean isComfortable;
boolean isBroken;
boolean haveToChangeBed(){
return true;
}
int[] bedSize(int length, int width) {
int[] arraySizeBed = new int[2];
return arraySizeBed;
}
boolean canLayDown(int manWeight) {
return true;
}
boolean isSheetSuitable(int[] arraySizeBed) {
return true;
}
int howManyMenCanLay(int averageManWidth) {
return bedWidth / averageManWidth;
}
}
package lesson4;
public class Book {
String name;
String authorName;
int yearOfPublishing;
int numberOfPage;
int readPages;
int menWhoReadBook;
long bookPrice;
boolean isInteresting;
boolean isSuitableForChildren;
boolean isBookTorn;
boolean isBookFinished() {
return true;
}
int countReadPages(int averageReadPagesPerDay, boolean isInteresting) {
return readPages += averageReadPagesPerDay;
}
void printBookInfo() {
}
String needToGlue() {
return "";
}
boolean isSuitForMyDaughter(boolean isInteresting, boolean isSuitableForChildren) {
return true;
}
}
package lesson4;
public class Husband {
String name;
String surname;
String nickname;
String wifeName;
String hairColor;
String eyesColor;
String olderChildName;
String hobby;
int age;
int weight;
int height;
int footSize;
int children;
int clothesSize;
int readBooks;
long salary;
boolean isHungry;
boolean isHappy;
boolean isWeightMoreThanNormal;
boolean hasCar;
boolean isHardWorkToday;
boolean hasPet;
boolean isGoodWealth;
boolean hasClearShirt;
boolean isExerciseMadeToday;
int nextMorningWeight(int weight, boolean isExerciseMadeToday) {
return weight - 1;
}
String askWifeWashShirt(boolean hasClearShirt, String wifeName) {
return "Dear " + wifeName + "...";
}
boolean isNecessaryToDoExercises(boolean isGoodWealth, boolean isHappy, boolean isWeightMoreThanNormal) {
return false;
}
String getInvitationFromWifeAfterWork(String nickName, boolean isHardWorkToday, boolean isHungry) {
return nickName + "do you want a beer?!";
}
int changeClothesSize(boolean isWeightMoreThanNormal) {
return clothesSize + 2;
}
boolean satisfiedWithTheSalary(long salary, boolean hasCar) {
return true;
}
void improveMood(boolean isExerciseMadeToday, boolean isHungry) {
}
void getBeerWithFriends() {
}
void playFootball() {
}
void digPotatoes() {
}
void smile() {
}
void dance() {
}
String snore() {
return "SHSHH";
}
void buildHouse() {
}
void buyDiamondsForWife() {
}
void kissWife() {
}
void buyNewCar() {
}
void walk() {
}
void eat() {
}
void planeTree() {
}
void sleep() {
}
void brushTeeth() {
}
void prepareDinner() {
}
void doHomeworkWithChild() {
}
void goToHairdresser() {
}
void goForAWalkWithChildren() {
}
}
package lesson4;
public class Pig {
String nickName;
int age;
int weight;
int numberOfPiglets;
long moneySpentOnFood;
boolean isHealthy;
boolean wantsToEat;
boolean isClear;
boolean needToClean() {
return isClear;
}
void callPigForDinner() {
}
long changeMoneySpentOnFood(int moneyForFoodPerDay, boolean wantsToEat) {
return moneySpentOnFood += moneyForFoodPerDay;
}
long soldPriceOfPig() {
return moneySpentOnFood * 5;
}
void printPriceTagForSale(String nickname, int weight, long priceOfPig) {
}
}
package lesson4;
public class Tree {
String name;
int age;
int height;
long leaves;
boolean isTreeBlooms;
boolean hasLeaves;
boolean hasHollow;
boolean hasNearAnotherTree;
boolean isSquirrelInHollow() {
return true;
}
int growthNextYear(int averageGrowthNameTreePerYear) {
return height +=averageGrowthNameTreePerYear;
}
long getLeavesQuantityAfterCaterpillarsInvasion(int daysOfInvasion, int caterpillarsNumber, int leavesPerDay) {
return leaves -= daysOfInvasion * caterpillarsNumber * leavesPerDay;
}
boolean isTreeOld() {
return true;
}
void getTreeCharacteristics() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment