Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

CITP XXXXXXXXXXFinal Exam Name:_____________________________________ Date:__________________________ Create an input file in notepad and save it to your final exam visual studio project as "input.txt"...

1 answer below »
CITP XXXXXXXXXXFinal Exam
Name:_____________________________________ Date:__________________________
Create an input file in notepad and save it to your final exam visual studio project as "input.txt"
containing the following data:
XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX100
Make sure your program is clear with no syntactical e
ors, co
ectly uses I/O syntax, co
ectly
uses
anching and looping syntax, that it contains functions with co
ect parameters and return
values, that it co
ectly uses a
ays with appropriate data types, and that you provide useful
comments throughout your program.
You must use basic elements of the programming language, use of include files, use of a working
main function, declaration and use of data types. You must produce a program that will compile
and execute without syntactical e
ors. You must use input and output mechanisms by processing
an input file and saving the contents of the file into an a
ay of Students (which is a Class which
contains only a variable grade). You must create and initialize two a
ays using the
appropriate data type, one a
ay of Students for storing the input data from file, another
a
ay for the grade distribution count. You must be able to use looping mechanisms to access
individual a
ay elements and be able to retrieve their information to produce program output.
You must use
anching mechanisms to include if, else, or switch statements to solve the grade
distribution problem.
Your program must have only three functions aside from Main: the Main function to call all
other functions for the program, a GetDataFromFile function to read file contents into a
ay, a
CalcResults function to compute lowest, highest, and the average (you need the sum of the
numbers to compute the average), and a DisplayGradeDistribution function to determine grade
distribution and display all other results. You must include comments explaining your choice of
arguments when calling the above functions from Main. You must include comments explaining
your method for reading from the file and additional comments to explain your code logic. You
must also provide comments justifying/explaining your choice of parameters and return types for
all of your functions.
Program should produce the following output:
For Instructor Use Only:

Language Basics…………... / 8
I/O Processing ……..……… / 8
Branching……………..…… / 8
Looping……………….……. / 8
Functions………………........ / 10
A
ays………………………. / 10
Logic………………….…….. / 10
Documentation………..……. / 8
Grade Distribution Solution... /30
XXXXXXXXXXTotal: /100
Answered Same Day Aug 08, 2021

Solution

Aditya answered on Aug 09 2021
146 Votes
CITP 3310 - Final Exam
A program is developed which is used to display highest marks, lowest marks, average marks and grade distribution while reading the marks data from a txt file “input.txt”.
Function Used In Program:
1) static void getDataFromFile(int[] studentA
ay ) : this function is used to read the data from the text file and store it in the student a
ay.
2) static void calcResult(int [] studentA
ay) : this funtion is used to calulate the hightest, lowest and average marks from student a
ay and display them
3) static void displayGradeDistribution(int [] studentA
ay) : this function is used to calculate the grade distribution and display them accordingly
Code:
using System;
using System.IO;
namespace GradeDistribution
{
class Program
{

static void Main(string[] args)
{
int [] studentA
ay = new int[20];
Creating a int a
ay to store the student marks
int[] gradeDistribution = new int[5];
Creating a int a
ay to store the count of grade distribution
getDataFromFile(studentA
ay);
Caliing function getDataFromFile with studentA
ay passsed as argument
calcResult(studentA
ay);
Calling the function calcResult with studentA
ay passed as argument
displayGradeDistribution(studentA
ay);
Calling the function displayGradeDistribution with studentA
ay passed as argument
}
static void getDataFromFile(int[] studentA
ay )
this function reads data from file input.txt
{
string textFile = "input.txt";
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here