Answer to Question #60930 in Java | JSP | JSF for Liya

Question #60930
i have an assignment to create a subject marks calculator in java netbeans, I've already done the GUI which includes the labels : mark, total, percentage, textfields for those 3. i have to find the percentage and the coding must be done in a calculate button and the percentage must appear in the percentage label when running the program. This is the code i have :

public static void main(String[] args){
int total, score;
float percentage;
Scanner inputNumScanner = new Scanner(System.in);

System.out.println("Enter the total, or max, score: ");
total = inputNumScanner.nextInt();

System.out.println("Enter the score obtained: ");
score = inputNumScanner.nextInt();

percentage = (score * 100/ total);

System.out.println("The percentage is = " + percentage + " %");
}

but the problem is that it is not appearing in the GUI.
1
Expert's answer
2016-07-25T13:45:02-0400
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-60930.pdf

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS