Make a program that asks the user to input his/her grades for3 subjects. And als
ID: 3615473 • Letter: M
Question
Make a program that asks the user to input his/her grades for3 subjects. And also asks the user to input the number of units foreach of the 3 subjects. Then computes for the general weightedaverage (GWA) of the 3 subjects. And then tells the user ifhe/she fails or passes. The possible grades that the user can onlyinput are the following: 1.00, 1.25, 1.50, 1.75, 2.00, 2.25, 2.50,2.75, 3.00, 3.50. The user fails if she/he gets a GWA of 3.50. theuser passes if she/he gets a GWA of 3.00 or better. GWA is computed by:- For each of the 3 subjects taken, multiply the numberof units by the corresponding grade;
- Add all the points and get the total; and
- Divide this total by the total number of units of the3 subjects taken.
Explanation / Answer
please rate - thanks your question has discrepancies! what is 3.0 to 3.5 pass or fail I'm assuming no arrays import java.util.*; public class untitled {public static void main(String[] args) {double g1,g2,g3,avg; int un1,un2,un3; Scanner in=new Scanner(System.in); System.out.print("grade for subject 1: "); g1=in.nextDouble(); System.out.print("grade for subject 2: "); g2=in.nextDouble(); System.out.print("grade for subject 3: "); g3=in.nextDouble(); System.out.print("number of units for subject 1:"); un1=in.nextInt(); System.out.print("number of units for subject 2:"); un2=in.nextInt(); System.out.print("number of units for subject 3:"); un3=in.nextInt(); avg=(g1*un1+g2*un2+g3*un3)/(un1+un2+un3); System.out.println("General weighted average:"+avg); if(avgRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.