Unit 1 HW
public class Printing {
public static void main(String args[]) {
System.out.println("Evan Sanchez");
System.out.println("Team 10");
}
}
Printing.main(null);
public class Biodata {
public static void main(String[] args) {
String name = "Evan";
int age = 17;
boolean underclassmen = false;
double height = 5.75;
}
}
Biodata.main(null);
public class Num {
public static void main(String[] args) {
int num = ((6 * 1234124 / 11345 - 890809 + 90800) % 980098);
System.out.println(num);
System.out.println(num/100);
}
}
Num.main(null);
public class math {
public static void main(String args[]) {
int a = 4;
int b = 5;
int c = 2;
a += b;
c *= a;
System.out.println(c);
}
}
math.main(null);
public class conversion {
public static void main(String args[]) {
double a = 123456.123456;
int b = (int) a;
System.out.println(b);
// this integer is too large and will create an error
//int c = 678901234567890;
}
}
conversion.main(null);
import java.util.Scanner;
public class gradeCalc {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Is your final in an individual category? (t/f)");
boolean testCat = sc.nextBoolean();
if (testCat == true) {
//current grade
System.out.println("What is your current grade?");
float currentGrade = sc.nextInt();
currentGrade /= 100;
//percentage of final
System.out.println("What percentage of your grade is the final?");
float percentOfGrade = sc.nextInt();
percentOfGrade /= 100;
//desired grade
System.out.println("What grade do you plan to finish with?");
float desiredGrade = sc.nextInt();
desiredGrade /= 100;
//grade needed calculation
float gradeNeeded = ((desiredGrade - ((1 - percentOfGrade)* currentGrade)) / percentOfGrade) * 100;
System.out.println("You need a " + gradeNeeded + "%");
}
else {
System.out.println("No score inputed.");
}
}
}
gradeCalc.main(null);