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

Feedback #1

Open
wants to merge 7 commits into
base: feedback
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
18 changes: 18 additions & 0 deletions 01-leap-year/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class Main{
public static void main(String[]args){
isleapyear(2022);//false
isleapyear(2024);//false
isleapyear(1900);//false
isleapyear(2000);//false
}//end of main method

public static void isLeapYear(int year){
if((year % 4 == 0) && ((year % 100 != )) || (year%400 == 0))){
System.out.println("This is a leap year");
}

else{
System.ot.println("This is not a leap year");
}
}
}
21 changes: 21 additions & 0 deletions 02-fizzbuzz/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
class Main {
public static void main(String[] args){
String game = "";
for(int a = 1;a <= 100;a++){
if(a % 3 == 0){
game = "fizz";
if(a % 5 == 0){
game += "buzz";
}
}else if(a % 5 == 0){
game = "buzz";

}else{
game = Integer.toString(a);
}
System.out.println(game);
}
}
}


27 changes: 27 additions & 0 deletions 03-count-quarters/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class Main {
public static void main(String[] args) {
System.out.println(countQuarters(1278));
System.out.println(countQuarters(50));
System.out.println(countQuarters(5000));
System.out.println(countQuarters(125));
System.out.println(countQuarters(2279));
System.out.println(countQuarters(34));
System.out.println(countQuarters(0));
}//end of main method

public static int countQuarters(int cents){

String cent = Integer.toString(cents);

if(cent.length() < 2){
return 0;
}

String remain = cent.substring(cent.length() - 2);

int remaining = Integer.valueOf(remain);

int numberOfQuarters = remaining/25;
return numberOfQuarters;


35 changes: 35 additions & 0 deletions 04-letter-grade/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
class Main {
public static void main(String[] args) {
int grade = 99;
System.out.println(letterGrade(grade));

grade = 81;
System.out.println(letterGrade(grade));

grade =70;
System.out.println(letterGrade(grade));

grade = 69;
System.out.println(letterGrade(grade));

grade = 55;
System.out.println(letterGrade(grade));


}//end of main method

public static String letterGrade(int grade){

if (grade <= 100&& grade >= 90){
return "A";
} else if(grade < 90 && grade >= 80){
return "B";
} else if(grade < 80 && grade >= 70){
return "C";
} else if(grade < 70 && grade >= 60){
return "D";
} else {
return "F";
}
}
}// end of grade method
22 changes: 22 additions & 0 deletions 05-div-by-3/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
class Main {
public static void main(String[] args) {
divby3(1234);//True

}//end of main method

public static void divby3(int div){
int sum = 0;

while (div != 0) {
sum += div % 10;
div = div / 10;
}

if(sum % 3 == 0) {
System.out.println("This number divisible by 3");
}
else {
System.outprintln("This number is not divisible by 3");
}
}
}
27 changes: 27 additions & 0 deletions 06-shapes/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class Main {
public static void main(final String[] args) {
sentence(6, 4);
}

public static void sentence(final int l, final int w) {
for (int row = 0; row < w; row++) {
for (int col = 0; col < l; col++) {
System.out.print("*");
}
System.out.println();
}
}


class Main{
public static void main(String [] args){
rightTriangle(4);
}
public static void rightTriangle(int s){
int p = 0;
for(int row = 0; )
for(int col=0; col <=p; col++){

}
}
}