Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raymond Fitzgerald #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 35 additions & 6 deletions NumberUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,58 @@
public class NumberUtilities {

public static String getRange(int stop) {
return null;
String rangeString = "";
for (int i = 0; i < stop; i++){
rangeString += i;
}
return rangeString;
}

public static String getRange(int start, int stop) {
return null;
String rangeString = "";
for (int i = start; i < stop; i++){
rangeString += i;
}
return rangeString;
}


public static String getRange(int start, int stop, int step) {
return null;
String rangeString = "";
for (int i = start; i < stop; i+=step){
rangeString += i;
}
return rangeString;
}

public static String getEvenNumbers(int start, int stop) {
return null;
String evenNumbers = "";
for (int i = start; i < stop; i++){
if (i % 2 == 0){
evenNumbers +=i;
}
}
return evenNumbers;
}


public static String getOddNumbers(int start, int stop) {
return null;
String oddNumbers = "";
for (int i = start; i < stop; i++){
if (i % 2 == 1){
oddNumbers +=i;
}
}
return oddNumbers;
}


public static String getExponentiations(int start, int stop, int exponent) {
return null;
String exNumbers = "";
for (int i = start; i <= stop; i++){
exNumbers += (int)Math.pow(i,exponent);
}

return exNumbers;
}
}
23 changes: 19 additions & 4 deletions TableUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,29 @@

public class TableUtilities {
public static String getSmallMultiplicationTable() {
return null;
}
String multTable = "";
for (int i = 1; i <=5; i++){
for (int j = 1; j <= 5; j++){
multTable += String.format("%3d |", i*j);
} multTable += "\n";
}return multTable;
}

public static String getLargeMultiplicationTable() {
return null;
String multTable = "";
for (int i = 1; i <=10; i++){
for (int j = 1; j <= 10; j++){
multTable += String.format("%3d |", i*j);
} multTable += "\n";
}return multTable;
}

public static String getMultiplicationTable(int tableSize) {
return null;
String multTable = "";
for (int i = 1; i <=tableSize; i++){
for (int j = 1; j <= tableSize; j++){
multTable += String.format("%3d |", i*j);
} multTable += "\n";
}return multTable;
}
}
38 changes: 32 additions & 6 deletions TriangleUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,45 @@
public class TriangleUtilities {

public static String getRow(int numberOfStars) {
return null;
}

String rowYaBoat = "";
for(int i = 0; i < numberOfStars; i++){
rowYaBoat += "*";
}
return rowYaBoat;
}

public static String getTriangle(int numberOfRows) {
return null;
String rowYaBoat = "";
for(int i = 0; i < numberOfRows; i++){
for (int j = 0; j <= i; j++){
rowYaBoat += "*";
}
rowYaBoat += "\n";
}
return rowYaBoat;

}


public static String getSmallTriangle() {
return null;
String rowYaBoat = "";
for(int i = 0; i < 4; i++){
for (int j = 0; j <= i; j++){
rowYaBoat += "*";
}
rowYaBoat += "\n";
}
return rowYaBoat;
}

public static String getLargeTriangle() {
return null;
String rowYaBoat = "";
for(int i = 0; i < 9; i++){
for (int j = 0; j <= i; j++){
rowYaBoat += "*";
}
rowYaBoat += "\n";
}
return rowYaBoat;
}
}