Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Im Stuck On this program,could someone please help me on this program? this is i

ID: 674482 • Letter: I

Question

Im Stuck On this program,could someone please help me on this program? this is it here, thank you so much!

Rewrite a solution to Assignment #1 using classes. You may use your solution to Assignment #1 as a starting point, or you may use the posted solution. Your class should be called FinalMarkCalculator. It should contain fields for hybridActivities, labs, assignments, testsQuizzes, labTest, and finalExam as well as any calculated fields that you need such as finalMark. Carefully consider if any intermediate calculations (if required) should be a class field or a local variable. Note – you may use different names than are suggested here, however they should be descriptive to what is being stored in the variable (do not use num1, num2, etc.). In addition, you should have the following methods: a) default constructor – initializes to "no data" ie zeros. b) getGradesFromUser – prompts user for the individual grades hybridActivities, labs, assignments, testsQuizzes, labTest, and finalExam and reads in their input. c) calcFinalGrade – calculates the final grade d) display - displays the calculated values Rewrite your main method to declare an object reference of this class, and then call the methods on the object (method main should be in its own class).

This is my assignment 1 program just for your information to help me write the second - this are what the parts are worth hybridActivities =5% , labs =10% , Assignments =20% , MainTest = 25, TestQuizzes 10%= , finalExam = 30%

import java.text.DecimalFormat;
import java.util.Scanner;

/* Created by Carolyn MacIsaac
/* Updated by Roseabell Smith
*
* CST8110 F15 Assignment #1
* Due date: Friday, October 9, 2015, 6PM
*
* This program calculates the course final mark based on
* the weighting in the course outline:
*
* Lab Activity(ies) (10%) -> 10%/10 marks = 1% per mark
* Assignment(s) (20%) -> 20%/100 marks = 1/5% per mark
* Hybrid Assignment(s) (5%) -> 5%/5 marks = 1% per mark
* Quiz(zes)/Test(s) (25%) -> 25%/25 marks == 1% per mark
* Practical Assessment (s) (10%) -> 10%/5 = 2% per mark
* Final Exam (30%) -> 30%/30 = 1% per mark
*/

public class Assign1 {

public static void main(String[] args) {

//variable declarations and initializations
Scanner scan = new Scanner(System.in);
DecimalFormat form = new DecimalFormat("0.00");

double hybrid, lab, assign, tests, labTest, finalExam;
double finalMark;
  

//welcome message
System.out.println("Welcome to the Final Mark Calculator ");

//prompt user for data and enter data into memory
System.out.print("Enter your hybrid activity mark out of 5: ");
hybrid = scan.nextDouble();

System.out.print("Enter your lab mark out of 10: ");
lab = scan.nextDouble();

System.out.print("Enter your assignments mark out of 100: ");
assign = scan.nextDouble();

System.out.print("Enter your test(s)/quiz mark out of 25: ");
tests = scan.nextDouble();

System.out.print("Enter your lab test mark out of 5: ");
labTest = scan.nextDouble();

System.out.print("Enter your final exam mark out of 30: ");
finalExam = scan.nextDouble();

//calculate final mark
//supply appropriate weightings
finalMark = hybrid + lab + assign/5.0 + tests + labTest * 2.0 + finalExam;
  
//display final mark with two decimal places
System.out.println(" Calculated final mark: "+ form.format(finalMark)+"%");

}

}

Explanation / Answer

import java.text.DecimalFormat;
import java.util.Scanner;
/* Created by Carolyn MacIsaac
/* Updated by Roseabell Smith
*
* CST8110 F15 Assignment #1
* Due date: Friday, October 9, 2015, 6PM
*
* This program calculates the course final mark based on
* the weighting in the course outline:
*
* Lab Activity(ies) (10%) -> 10%/10 marks = 1% per mark
* Assignment(s) (20%) -> 20%/100 marks = 1/5% per mark
* Hybrid Assignment(s) (5%) -> 5%/5 marks = 1% per mark
* Quiz(zes)/Test(s) (25%) -> 25%/25 marks == 1% per mark
* Practical Assessment (s) (10%) -> 10%/5 = 2% per mark
* Final Exam (30%) -> 30%/30 = 1% per mark
*/
class FinalMarkCalculator
{
double hybrid, lab, assign, tests, labTest, finalExam;
double finalMark;
  
   FinalMarkCalculator()
   {
       hybrid=0;
       lab=0;
       assign=0;
       tests=0;
       labTest=0;
        finalExam=0;
       finalMark=0;
   }

   void getGradesFromUser()
   {
   DecimalFormat form = new DecimalFormat("0.00");
   Scanner scan = new Scanner(System.in);  

    //welcome message
       System.out.println("Welcome to the Final Mark Calculator ");
       //prompt user for data and enter data into memory
       System.out.print("Enter your hybrid activity mark out of 5: ");
       hybrid = scan.nextDouble();
       System.out.print("Enter your lab mark out of 10: ");
       lab = scan.nextDouble();
       System.out.print("Enter your assignments mark out of 100: ");
       assign = scan.nextDouble();
       System.out.print("Enter your test(s)/quiz mark out of 25: ");
       tests = scan.nextDouble();
       System.out.print("Enter your lab test mark out of 5: ");
       labTest = scan.nextDouble();
       System.out.print("Enter your final exam mark out of 30: ");
       finalExam = scan.nextDouble();
   }

   void calcFinalGrade()
   {
   //calculate final mark
       //supply appropriate weightings
       finalMark = hybrid + lab + assign/5.0 + tests + labTest * 2.0 + finalExam;
   }
      
   void display()
   {

   //display final mark with two decimal places
       System.out.println(" Calculated final mark: "+ form.format(finalMark)+"%");
   }

}

public class Assign1 {
public static void main(String[] args) {
//variable declarations and initializations
  
   FinalMarkCalculator o = new FinalMarkCalculator();
   o.getGradesFromUser();
   o.calcFinalGrade();
   o.display();


  
  
}
}