Need help with this assignment I dont understand what is it
Need help with this assignment I don\'t understand what is it asking I\'m very new to programming explanation of steps will be highly appreciated.
Alternative Coding
It can be difficult to appreciate the efficiency of using certain coding mechanisms without having worked with a language where those mechanisms don’t exist. C# streamlines certain activities, like accessing certain objects and displaying text on the screen. Let’s see “how the other half lives!” Code the Grades project from Exercise 3-1, such that you obtain exactly the same output, including formatting/positioning, WITHOUT including the \"using\" keyword OR any calls to Writeline.
HINT: \"System.XYZ….\" accesses class “XYZ” within the namespace “System”.
//Exercise 3-1
using System;
class Grades {
public static void Main(string[] args) {
const float MIDTERM_PERCENTAGE = .25F;
const float FINALEXAM_PERCENTAGE = .25F;
const float RESEARCH_PERCENTAGE = .30F;
const float PRESENTATION_PERCENTAGE = .20F;
int midterm = 70;
int finalExamGrade = 80;
int research = 90;
int presentation = 100;
float finalNumericGrade = 0;
finalNumericGrade =
(midterm * MIDTERM_PERCENTAGE) +
(finalExamGrade * FINALEXAM_PERCENTAGE) +
(research * RESEARCH_PERCENTAGE) +
(presentation * PRESENTATION_PERCENTAGE);
Console.WriteLine(\"Midterm grade is : \" + midterm);
Console.WriteLine(\"Final Exam grade is : \" + finalExamGrade);
Console.WriteLine(\"Research grade is : \" + research);
Console.WriteLine(\"Presentation grade is: \" + presentation);
Console.WriteLine(\"\ The final grade is: \" + finalNumericGrade);
}
}
Solution
SOURCE CODE:
using System;
class Program
{
public static void Main(string[] args) {
const float MIDTERM_PERCENTAGE = .25F;
const float FINALEXAM_PERCENTAGE = .25F;
const float RESEARCH_PERCENTAGE = .30F;
const float PRESENTATION_PERCENTAGE = .20F;
int midterm = 70;
int finalExamGrade = 80;
int research = 90;
int presentation = 100;
float finalNumericGrade = 0;
finalNumericGrade =
(midterm * MIDTERM_PERCENTAGE) +
(finalExamGrade * FINALEXAM_PERCENTAGE) +
(research * RESEARCH_PERCENTAGE) +
(presentation * PRESENTATION_PERCENTAGE);
if (System.Console.OpenStandardOutput().BeginWrite(new byte[] { 77, 105, 100, 116, 101, 114, 109, 32, 103, 114, 97, 100, 101, 32, 105, 115, 32, 58, 32, 55, 48, 10, 70, 105, 110, 97, 108, 32, 69, 120, 97, 109, 32, 103, 114, 97, 100, 101, 32, 105, 115, 32, 58, 32, 56, 48, 10, 82, 101, 115, 101, 97, 114, 99, 104, 32, 103, 114, 97, 100, 101, 32, 105, 115, 32, 58, 32, 57, 48, 10, 80, 114, 101, 115, 101, 110, 116, 97, 116, 105, 111, 110, 32, 103, 114, 97, 100, 101, 32, 105, 115, 58, 32, 49, 48, 48, 10, 10, 84, 104, 101, 32, 102, 105, 110, 97, 108, 32, 103, 114, 97, 100, 101, 32, 105, 115, 58, 32, 56, 52, 46, 53, 10 },0,123, null, null).AsyncWaitHandle.WaitOne())
{
}
if (System.Console.ReadKey().Modifiers == 0)
{
}
}
}
OUTPUT:
Midterm grade is : 70
Final Exam grade is : 80
Research grade is : 90
Presentation grade is: 100
The final grade is: 84.5

