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

create a C# program having 3 functions. (1) functionA calculates the total score

ID: 3726314 • Letter: C

Question

create a C# program having 3 functions. (1) functionA calculates the total score of a student taking CSC001. The course includes: -two quizzes-the full score of each quiz is 10 points, and the weight is 5%. -two assignments-the full score of each assignment is 100 points, and the weight is 10%, -a midterm exam . the full score is 50, and the weight is 10%. -a final exam-the full score is 100, and the weight is 40%. -a project-the full score is 25, and the weight is 25%. The score of each coursework is passed to the functionA by one function parameter. That is, functionA has 7 parameters representing the score of various coursework. After the total score is calculated, functionB is called by functionA that will calculate and return the letter grade (represented by, such as A, B, C, D or Fl Finally, functionA will print the total score and letter score. (2) functionB has one parameter and will return a value when it is done. When functionB is called, based on the total grade from step (1), function B calculates and returns the letter grade to functionA. The rules are listed below: -A 90%-100% ·B 80%·82% . C 70%-79% -D 6096-6996 -F 0%-59% (3) call functionA in the main method

Explanation / Answer


Given below is the code for the functions.
Please do rate the answer if it was helpful. Thank you


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Test
{
class Program
{
static void Main(string[] args)
{
int quiz1 , quiz2; //max is 10
int assign1, assign2; //max is 100
int mid ; //max is 50
int final ; //max is 100;
int project ; // max is 25
  
  
Console.WriteLine("Enter Quiz 1 score (max 10): ");
quiz1 = Convert.ToInt32(Console.ReadLine());
  
Console.WriteLine("Enter Quiz 2 score (max 10): ");
quiz2 = Convert.ToInt32(Console.ReadLine());
  
Console.WriteLine("Enter Assignment 1 score (max 100): ");
assign1 = Convert.ToInt32(Console.ReadLine());
  
Console.WriteLine("Enter Assignment 2 score (max 100): ");
assign2 = Convert.ToInt32(Console.ReadLine());
  
Console.WriteLine("Enter Midterm score (max 50): ");
mid = Convert.ToInt32(Console.ReadLine());
  
Console.WriteLine("Enter Finals score (max 100): ");
final = Convert.ToInt32(Console.ReadLine());
  
Console.WriteLine("Enter Project score (max 25): ");
project = Convert.ToInt32(Console.ReadLine());
  
  
Console.WriteLine("Final grade is " + functionA(quiz1, quiz2, assign1, assign2, mid, final, project));
  
  
}
  
public static char functionA(int quiz1, int quiz2, int assign1, int assign2, int mid, int final, int prj)
{
int maxQuiz = 10, maxAssign = 100, maxMid = 50, maxFinal = 100, maxPrj = 25;
  
double avgQuiz = 0.05 * (quiz1 + quiz2)/(2*maxQuiz); //quiz is 5%
double avgAssign = 0.10 * (assign1 + assign2) / (2*maxAssign); //assignments is 10%
double avgMid = 0.10 * mid / maxMid; //midterm is 10%
double avgFinal = 0.40 * final / maxFinal ; //finals is 40%
double avgPrj = 0.25 * prj / maxPrj;
  
double score = 100 * (avgQuiz + avgAssign + avgMid + avgFinal + avgPrj);
  

return functionB(score);
}
  
public static char functionB(double score)
{
if(score >= 90)
return 'A';
else if(score >= 80)
return 'B';
else if(score >= 70)
return 'C';
else if(score >= 60)
return 'D';
else
return 'F';
}

  

}

}
output
=====
Enter Quiz 1 score (max 10): 7
Enter Quiz 1 score (max 10): 8
Enter Assignment 1 score (max 100): 89
Enter Assignment 2 score (max 100): 95
Enter Midterm score (max 50): 45
Enter Finals score (max 100): 92
Enter Project score (max 25): 23
Final grade is B