avi fried
i am learning to code and i can need some help mainly in java until i move to other forms
public class HelloWorld{
public static void main(String []args){
Scanner scanner = new Scanner(System.in);
int[] scores = new int [10];
int amountoftest = 0;
while(amount of test<10)
{
scores[amountoftest] = scanner.nextInt();
amountoftest++;
}
int total = 0;
amountoftest = 0;
while(amountoftest<10)
{
total = total+ scores[amountoftest];
System.out.print.(scores\10);
}
}
}
Hey this might help you. I already had this one.
import java.util.*; import java.text.*; public class GPACalculator { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("How many subjects do you have?: "); int classes = input.nextInt(); String grades = ""; double total = 0; double dec; for (int j = 0; j < classes; j++) { Scanner inputs = new Scanner(System.in); System.out.print("What is your Grade in subject "+(j+1)+" ?: "); grades = inputs.nextLine(); if (grades.equals("A")){ dec = 4; total += dec; } else if (grades.equals("B")){ dec = 3; total += dec; } else if (grades.equals("C")){ dec = 2; total += dec; } else if (grades.equals("D")){ dec = 1; total += dec; } else if (grades.equals("F")){ dec = 0; total += dec; } } double GPA = total / classes; System.out.println("Your GPA is "+GPA); DecimalFormat formatter = new DecimalFormat("0.##"); System.out.println("If required in formatted form :"+formatter.format(GPA)); } }You can change as per your grade value.