Help me with this one please. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Help me with this one please.

import java.util.Scanner; import java.io.*; public class Exams { Scanner key = new Scanner(System.in); int pscore, mscore, sscore, fscore, total; boolean[] prelims = {false, false, false, false, false}; boolean[] midterms = {false, false, false, false, false}; boolean[] semifinals = {false, false, false, false, false}; boolean[] finals = {false, false, false, false, false}; public void prelims() { System.out.println("Prelims Exam\nTrue or False: Write T if true and F if false."); System.out.println("1. Java was first developed by Oracle"); if (key.nextLine().equals("F")) { prelims[0] = true; pscore = pscore + 1; } System.out.println("2. Java is an object oriented programming language."); if (key.nextLine().equals("T")) { prelims[1] = true; pscore = pscore + 1; } System.out.println("3. You can store Java classes in a .jar extension for distribution without manifest");

4th Apr 2020, 4:09 PM
Hera Calaguio
1 Answer
0
//call it from main public class Program { public static void main(String[] args) { var p = new Exams(); p.prelims(); } } // and add two parenthes at the end of Exams class .. }}
4th Apr 2020, 4:38 PM
zemiak