A program that will calculate a student’s grade average for a class and then sto
ID: 3636059 • Letter: A
Question
A program that will calculate a student’s grade average for a class and then store the result in an array to be able to print out the averages of the class. First you will need to calculate the test average and then the lab average. The user will then enter the midterm grade and final exam grades. The formula to find the semester average is 40% of lab average + 42% of test average +9% of midterm + 9% of final. The semester average is stored in an array of unknown size (for different classes) and then printed out. Here is a sample data sheet below but you may use any data you choose.My brother needs help on this and i just want to try to help him out thanks for looking
Explanation / Answer
// Even your Qn is Not Clear I tried out something . //If required more help Please write to me with full Qn details. package javaapplication2; import java.util.List; /** * Programe 4: Classs.java * @author DEEPU */ public class Classs { List testScores; List labScores; Double semisterAvarage; Double midtermGrade; Double finalGrade; public Classs(List testScores, List labScores, Double semisterAvarage, Double midtermGrade, Double finalGrade) { this.testScores = testScores; this.labScores = labScores; this.semisterAvarage = semisterAvarage; this.midtermGrade = midtermGrade; this.finalGrade = finalGrade; setGPA(); } public Double getFinalGrade() { return finalGrade; } public void setFinalGrade(Double finalGrade) { this.finalGrade = finalGrade; } public List getLabScores() { return labScores; } public void setLabScores(List labScores) { this.labScores = labScores; setGPA(); } public Double getMidtermGrade() { return midtermGrade; } public void setMidtermGrade(Double midtermGrade) { this.midtermGrade = midtermGrade; setGPA(); } public Double getSemisterAvarage() { return semisterAvarage; } public void setSemisterAvarage(Double semisterAvarage) { this.semisterAvarage = semisterAvarage; } public List getTestScores() { return testScores; } public void setTestScores(List testScores) { this.testScores = testScores; setGPA(); } public void addLabScore(Double labScores) { this.labScores.add(labScores); setGPA(); } public void addTestScore(Double testScores) { this.testScores.add(testScores); setGPA(); } public Double getLabScoreAvarage() { Double avaarage=0D; for(int i=0;i0) avaarage = avaarage/this.testScores.size(); return avaarage; } public Double getTestScoreAvarage() { Double avaarage=0D; for(int i=0;i0) avaarage = avaarage/this.testScores.size(); return avaarage; } public Double setGPA(){ Double gpa = 0D; gpa = (getLabScoreAvarage()*(40D/100D))+(getTestScoreAvarage()*(42D/100D))+(this.midtermGrade*(9D/100D))+(this.finalGrade*(9D/100D)); this.semisterAvarage=gpa; return gpa; } @Override public String toString() { StringBuffer sb= new StringBuffer(); sb.append(" ").append("LAB SCORE AVG : ").append(getLabScoreAvarage()).append(" "); sb.append("TEST SCORE AVG : ").append(getTestScoreAvarage()).append(" "); sb.append("MID TERM GRADE : ").append(this.midtermGrade).append(" "); sb.append("FINAL GRADE : ").append(this.finalGrade).append(" "); sb.append("SEMISTER AVG : ").append( this.semisterAvarage).append(" "); return sb.toString(); } } package javaapplication2; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Programe 4: ClassLoader.java * @author DEEPU */ public class ClassLoader { private List classs; public ClassLoader(List classs) { this.classs = classs; } public ClassLoader() { this.classs = new ArrayList(); } public List getClasss() { return classs; } public void setClasss(List classs) { this.classs = classs; } public void addClasss(Classs classs) { this.classs.add(classs); } public void removeTopClasss() { this.classs.remove(0); } public void removeClasss(int index) { this.classs.remove(index); } public void removeClasss(Classs classs) { this.classs.remove(classs); } @Override public String toString() { StringBuffer sb= new StringBuffer(); for(int i=0;iRelated 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.