Skip to content
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
9 changes: 9 additions & 0 deletions Structures/src/AssignGrade.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ public class AssignGrade {

public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Score: ");
int score = scan.nextInt();

double grade = ((100 - score)/50.0) * 3 + 1;

if (grade <= 4.0) {
System.out.println("Pass with grade: " + grade);
} else {
System.out.println("Fail with grade: " + grade);
}
//todo: when executing the program you will be ask to write a score.
//The program converts the score then into a grade and prints that grade (1.0, 1.3, 1.7, ...)
//Note that the student passed when the student gets a score of 50.0 points (4.0)
Expand Down
10 changes: 10 additions & 0 deletions Structures/src/EvenOdd.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ public class EvenOdd {

public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Number: ");
int number = scan.nextInt();


for (int count = 0; count < number; count ++) {
if (count % 2 != 0) {
System.out.println(count);
}
}


//todo: The program takes a number as input.
//It then goes through all integer values till reaching that value and prints all the odd ones.
Expand Down