Write a program that reads the student information from a tab separated values (tsv) file. The program then creates a text file that records the course grades of the students. Each row of the tsv file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student. A sample of the student information is provided in StudentInfo.tsv. Assume the number of students is at least 1 and at most 20.
The program performs the following tasks:
Read the file name of the tsv file from the user.
Open the tsv file and read the student information.
Compute the average exam score of each student.
Assign a letter grade to each student based on the average exam score in the following scale:
A: 90= B: 80=< X < 90
C: 70=< X < 80
D: 60=< X < 70
E: X < 60
Compute the average of each exam.
• Output the last names, first names, exam scores, and letter grades of the students into a text file named report.txt.
• Output one student per row and separate the values with a tab character.
• Output the average of each exam, with two digits after the decimal point at the end of report.txt. Hint: Use the setprecision manipulator to format the output.
Ex: If the input of the program is:
StudentInfo.tsv
and the contents of Studentinfo tsv are:
Barrett Edan 70 45 59
Bradshaw Reagan 96 97 88
Charlton Caius 73 94 80
Mayo Tyrese 88 61 36
Stern Brenda 90 86 45
the file report.txt should contain:
Barrett Edan 70 45 59 F
Bradshaw Reagan 96 97 88 A
Charlton Caius 73 94 80 B
Mayo Tyrese 88 61 36 D
Stern Brenda 90 86 45 C
Averages: midtermi 83.40, midterm2 76.60, final 61.60

Answers

Answer 1
#include
#include
#include
#include
#include
#include


using namespace std;

// Class student required to store the data
class Student{
public:
string lname;
string fname;
int marks[3];
char grade;

// Function which generates the grade for student
void calculate_grade(){
double sum = 0;
for(int i=0;i<3;i++){
sum+= marks[i];
}
double average = sum/3;
if(average>=90 && average<100)
this->grade = 'A';
else if(average>=80)
this->grade = 'B';
else if(average>=70)
this->grade = 'C';
else if(average>=60)
this->grade= 'D';
else this->grade = 'F';
}
};

// This function reads the file , and creates a vector of Students data
vector read_file(string fileName){

// Opening the file
fstream fin;
fin.open(fileName);


// Temp variables
vector list;
vector row ;
string line, word, temp;

// Read the data into vector
while(getline(fin,line)){
row.clear();
stringstream s(line);

while(getline(s,word,'\t')){

row.push_back(word);

}
Student st;
st.fname = row[0];
st.lname = row[1];
st.marks[0] = stoi(row[2]);
st.marks[1] = stoi(row[3]);
st.marks[2] = stoi(row[4]);
st.calculate_grade();
list.push_back(st);
}
fin.close();
return list;
}

// This function takes filname to be output as input, and list of student
void writeFile(string filename, vector list){

// Opening the new file
ofstream fin(filename);
for(int i=0;i string line = list[i].fname+"\t"+list[i].lname+"\t"+to_string(list[i].marks[0])+"\t"
+to_string(list[i].marks[1])+"\t"+to_string(list[i].marks[2])+"\t"+list[i].grade+"\n";
fin<
}


// Find the stats required
double average1 =0,average2 =0 ,average3 = 0;
for(int i=0;i average1+=list[i].marks[0];
average2+=list[i].marks[1];
average3+=list[i].marks[2];
}
average1/=list.size();
average2/=list.size();
average3/=list.size();

// Writting the stats
fin<<"\n"<<"Average: "<<"mid_term1 "<
// Closing the file
fin.close();
}
int main(){

// Taking the input
cout<<"Enter the filename: ";
string filename;
cin>>filename;
vector list;

// Reading and Writting to the file
list = read_file(filename);
writeFile("report.txt",list);


}

Related Questions

Read two numbers from user input. Then, print the sum of those numbers.
Hint -- Copy/paste the following code, then just type code where the question marks are to finish the code.
num1 = int(input())
num2 = ?
print(num1 + ?)

Answers

Answer:

First ? - int(input())

Second ? - num2

Explanation:

This works because we are just mimicing the first input in your first variable.

The second one is adding them together.

Don't remember to give me brainliest :)

Brainliest if correct. 3. You are researching ways to boost employee morale for a proposal. How can you
avoid copyright issues when you find materials from outside sources? (1 point)

Answers

To avoid copyright you can give credit to the original author. For example if I copy information that said “all humans are meant to be extinct by 2073” from notarealwebsite.com I shout credit them for this.

Consider that a man is watching a picture of a Black Horse. He receives an external stimulus from input channel. Man gains some information about the picture from external environment and stores it in the memory. Once the initial information is gained, it is compared with the memory and then stores it. Finally upon perceiving and storing the information in memory Man says that the picture contains Black horse.
Based on the information-processing model, cognition is conceptualized as a series of processing stages where perceptual, cognitive, motor processors are organized in relation to one another.
You are required to identify and elaborate that which cognitive processes i.e. Perceptual system, Cognitive system, and motor system are involved when man interacts with the picture and also that which input channel is responsible in taking information to the brain.

Answers

The first Cognitive Process that was in play according to the excerpt is Perceptual System. It is also called Perceptual Representation and Intelligence.

This function of the brain is responsible for the sensory input which may be auditory (sounds), visual (pictures), and kinesthetic (emotions or feelings).

So the Perceptual Cognitive system (visual) relays the input (image of the horse to his brain, then it is stored.

This next stage is handled by the memory.  Memory (a crucial process for learning) is a cognitive function that enables us to code, store, and recover information from the past.

Notice that the man perceived the information, and as the input interacts with the memory, he is able to say that the image or picture contains a black horse because there is a recall function.

Learn more about cognitive functions in the link below:

https://brainly.com/question/7272441

what is operating system?​

Answers

The software that supports a computer's basic functions, such as scheduling tasks, executing applications, and controlling peripherals.

Your job is to protect your company's information assets. What security objectives
should you address?
1) Assets, liabilities, and threats
2) Common vulnerabilities and exposures
3) Confidentiality, integrity and availability
4) Risks, threats and vulnerabilities

Answers

Answer:3

Explanation: The CIA Triangle is the basis of all Security related needs.

The ratio of sparrows to bluejays at the bird sanctuary was 5 to 3 If there were 15 bluejays in the sanctuary, how many sparrows were there?​

Answers

The answer is 25 sparrows.

displaying advertisements specific or users internet based on their buy preference is called ._________.​

Answers

Targeted advertising       hope it helps

Please debbug this code for me

public class SavingAccount { // interest rate for all accounts private static double annualInterestRate = 0; private final double savingsBalance; // balance for currrent account // constructor, creates a new account with the specified balance public void SavingAccount( double savingsBalance ) { savingsBalance = savingsBalance; } // end constructor // get monthly interest public void calculateMonthlyInterest() { savingsBalance += savingsBalance * ( annualInterestRate / 12.0 ); } // end method calculateMonthlyInterest // modify interest rate public static void modifyInterestRate( double newRate ) { annualInterestRate = ( newRate >= 0 && newRate <= 1.0 ) ? newRate : 0.04; } // end method modifyInterestRate // get string representation of SavingAccount public String toString() { return String.format( "$%.2f", savingsBalance ); } // end method toSavingAccountString } // end class SavingAccount

Answers

Answer:

/

Explanation:

Window server how it works

Answers

The server handles the administrative group-related activities on a network. It basically stores, recover and send the files to all the devices that are connected to the network of that server. Windows has made a line of operating systems specifically for use in servers.
Windows Server is a group of operating systems designed by Microsoft that supports enterprise-level management, data storage, applications, and communications. Previous versions of Windows Server have focused on stability, security, networking, and various improvements to the file system.
A window is a separate viewing area on a computer display screen in a system that allows multiple viewing areas as part of a graphical user interface ( GUI ). Windows are managed by a windows manager as part of a windowing system . A window can usually be resized by the user.

Which of the following will you do in step X in the following series of clicks to change the bounds of
a chart axis: Chart > Chart Tools > Format tab > Current Selection> Format Selection > Format Axis
> Axis Options > Vertical Axis crosses > At Category number > X?
O Expand Labels, then under Interval between labels, select Specify interval unit and type the
number you want in the text box.
O Expand Tick Marks, and then in the Interval between tick marks box, and type the number that
you want
N
Type the number that you want in the text box.
O Expand Tick Marks, and then select the options that you want in the Major type and Minor type
boxes.

Answers

In order to change the bounds of  a chart axis after performing the aforementioned series of clicks, at step X: C. Type the number that you want in the text box.

A step chart can be defined as a line chart that uses both the vertical and horizontal lines to connect two (2) data points. Thus, it enables an end user to see the exact point on the X-axis when there is a change in the Y-axis.

In Microsoft Excel, the series of clicks that are used to change the bounds of  a chart axis are:

Click on chart.Select chart tools and then format tab.Select the current selection and then format selection.Click on format axis and then axis options.Click on vertical axis crosses.At category number, you should type the number that you want in the text box.

In conclusion, typing the number that you want in the text box is the action that should be performed at step X.

Read more on step chart here: https://brainly.com/question/9737411

what is the full form of computer​

Answers

Answer:

Common Operating Machine Purposely Used for Technological and Educational Research

Explanation:

"A computer is a general-purpose electrical device that is used to do arithmetic and logical processes automatically," according to some.

RAM or RIM is correct?

Answers

RAM is the correct answer

Create a Python script that will compare two (2) numbers entered by the user. Refer to the attached image and to the following algorithm. There is no need to create a class similar to how Java works.

3.1. User enters the first number.
3.2. User enters the second number.
3.3. If the first number is less than, greater than, or equal the second number, a message is displayed.

Please Help me. Thank You!
Marry Christmas!​

Answers

x = int(input("Enter first number\n"))

y = int(input("Enter second number\n"))

if x > y:

   print(x, "is greater than", y)

elif x < y:

   print(x, "is less than", y)

else:

   print(x, "is equal to", y)

i'm not the greatest coder, but it works :)

Suppose a password must have at least 8, but no more than 12 characters, where each character can be either:

Answers

Answer:

A combination of uppercase letters, lower case letters, numbers, and special characters.

Explanation:

A password is a word that permit you to register, log or sign in a site.

VPN or Proxy is safer?

Answers

Proxy chain is safer

Brainliest if correct. 5. if you wanted b show how many employees at your office ride a bicycle to work in
comparison to the number of employees who drive a car, take public transportation,
or walk wihat visual would be best? (1 point)

Answers

Answer:

I believe a bar graph would be best for me. What are your answer options though?

Explanation:

describe the process of terminating a crossover cable​

Answers

Background: In the Information Technology World, the Ethernet cable has been the most trusted medium that is link computers to the world wide web. However, in recent years, wireless technology has limited the use of the Ethernet cable. Nonetheless, true computer geeks know that in order to receive optimum speed within a computer network in a business or inside our homes; the proper cabling technics are crucial when installing a computer network. Therefore, this instructable will provide step-by-step procedures on the proper way to terminate a CAT 6 cable using the TIA 568B standard for a straight-through cable. The procedures used for the straight-through cable can also be utilized to terminate a cross-over and roll-over cable.

Cable Pin-outs: Straight-Through, Cross-over, and Roll-over cables

Step 1: Prepare the cable

Using the cable snips, remove approximately one half inch of outer cable sheath/jacketing from each cable end.

Step 2: Cut cable wires to the appropriate length

Cutting the wires to the proper length allows for the CAT 6 cable to properly fit in the RJ-45 connector.

Step 3: Align cable wires for the specific configuration that will be terminated

The alignment of the wires will ensure they enter the proper channel within the RJ-45 connector when inserting the wires.

Step 4. Slide cable into the RJ-45 Connector

When sliding the cable into the RJ-45 connector, use enough force to ensure the end of the wires are seated firmly at the end of the RJ-45 connector channels.

Step 5. Insert the RJ-45 connector in the crimping tool and Crimp the RJ-45 connector

When inserting the cable into the crimping tool, use enough force to ensure that the cable doesn’t slide out of the crimping tool and the wires do not become misaligned. In addition, while crimping the connector, use enough force to push the copper conductors down on to the wires and the plastic tab on to the outer sheath of the cable. You will hear a click once all the copper tabs are seated properly.

Step 6. Perform a visual inspection of the connector

The visual inspection is to ensure that the connector is properly terminated to the cable. Look for issues with wire alignment and connector looseness.

Step 7. Repeat steps to terminate multiple connectors.

What type of system software manages memory?

Answers

Answer:

"Operating System"

Explanation:

The type of system software that manages memory is an operating system. To manage memory, the operating system employs a number of software strategies.

What is system software?

The most crucial piece of software that runs on a computer is the operating system. It controls the memory, operations, software, and hardware of the computer.

You can converse with the computer using this method even if you don't understand its language. Memory connections are the structures that come before and after all memory areas, whether they are allocated or available.

Working memory, short-term memory, and long-term memory are the three primary categories of memory. While long-term memory stores your enduring memories, working memory and short-term memory enable you to retain and use transient information.

Therefore, an operating system is a sort of system software that controls memory.

To learn more about system software, refer to the link:

https://brainly.com/question/12908197

#SPJ2

how to download film​

Answers

Which film are you talking about?
what film are you trying to download from

in which country was Abacus build
if ur smart don't searh​

Answers

Answer:

Abacus many be built first in China

Explanation:

I know Abacus ^o^

Answer:

Hewo There!!!!

__________________

China- i thinkkk maybe?

__________________

“Hold fast to dreams,

For if dreams die

Life is a broken-winged bird,

That cannot fly.”

― Langston Hughes

__________________

Think of life as a mytery because well it sort of is! You don't know what may happen may be good or bad but be a little curious and get ready for whatever comes your way!! ~Ashlynn

hi hi hihihihihivvv hihihihihihi v vhi

Answers

Answer: hihihihihihiihihi hihihihiihihih

Explanation: hi.

Why linked list is better than an array?

Answers

In conclusion there are many different data structures. Each data structure has strengths and weaknesses which affect performance depending on the task. Today, we explored two data structures: arrays and linked lists. Arrays allow random access and require less memory per element (do not need space for pointers) while lacking efficiency for insertion/deletion operations and memory allocation. On the contrary, linked lists are dynamic and have faster insertion/deletion time complexities. However, linked list have a slower search time and pointers require additional memory per element in the list. Figure 10 below summarizes the strength and weakness of arrays and linked lists.

write down the application areas of an ICT?​

Answers

Answer:

These are internet, telephone, mobile phone, TV, radio and office automation systems such as word-processing, fax, audio conferencing, video conferencing, computer conferencing, multimedia, etc, through the use of networks of satellite and fiber optics..

Explanation:

hope its help

please write an Introduction on intrusion detection system and prevention system
PLEASE

Answers

Answer:

An Intrusion Detection System (IDS) is a system that monitors network traffic for suspicious activity and issues alerts when such activity is discovered. It is a software application that scans a network or a system for harmful activity or policy breaching. Any malicious venture or violation is normally reported either to an administrator or collected centrally using a security information and event management (SIEM) system. A SIEM system integrates outputs from multiple sources and uses alarm filtering techniques to differentiate malicious activity from false alarms.

You enter a hardware store where you have an account, pick up a pair of $5.00 pliers, and wave them at the manager as you leave the store. This would be an example of a(n):

Answers

Shoplifting! Did he pay for those?!?!

The given situation is an example of shoplifting.

What is hardware?

All the mechanical components made of simply plastic or metal used in houses or industries are termed as hardware.

You enter a hardware store where you have an account, pick up a pair of $5.00 pliers, and wave them at the manager as you leave the store.

This gives an idea of the shoplifting, as he hold the account with them. He doesn't need to pay every time he buys anything.

This, this would be an example of shoplifting.

Learn more about hardware.

https://brainly.com/question/15232088

#SPJ2

Implement a class named BankAccount. Every bank account has a starting balance of $0.00. The class should implement methods to accept deposits and make withdrawals. __init__(self): Sets the balance to 0. deposit(self, amount): Deposits money. Return True if transaction is successful. Return False if amount is less than 0 and ignore the transaction. widthdraw(self, amount): Withdraws money. Return True if transaction is successful. Return False if amount is more than the balance and ignore the transaction.

Answers

The BankAccount class implementation in Python 3.8 is found in the attached image

The deposit method  uses an if statement to check if the amount to be deposited is negative. If so, it does nothing, but returns False signifying that the transaction failed.

However, if the test finds out that the amount to deposit is positive or zero, the deposit method increments the balance, then returns True, signifying a successful transaction.

The withdraw method is similar, but this time, it tests if the amount to be withdrawn is greater than the available balance. If so, it ignores the transaction, and returns False.

If the withdrawal amount is less or equal to the available balance, the withdraw method decrements the available balance, then returns True, signifying a successful transaction.

Learn more about Python programming here https://brainly.com/question/20379340

Write a python program to calculate the sum of three numbers and as well require the user to input the numbers.​

Answers

Answer:

numbers = []

for i in range(3):

 numbers.append(eval(input("Enter number: ")))

print('Sum is:', sum(numbers))

Explanation:

You want to use a loop to prevent repeating your code.

Answer:

numbers = []

for i in range(3):

numbers.append(eval(input("Enter number: ")))

print('Sum is:', sum(numbers))

As a Waterfall project manager, your goal is to minimize any changes that could lead to scope creep. You want to protect your team from building something the client or stakeholders don’t want. What formal and rigorous process could you set up to safeguard against this?

Answers

The necessary things that should be done to avoid a project scope creep include documenting the project requirements and setting up change control processes.

The scope of a project simply means the work that is required in order to complete a project. On the other hand, project scope creep means the occurrence that happens when changes are made to the scope without a change request.

To avoid project scope creep, it's important to document the project requirements, set up changes in control processes, and have a clear project schedule.

Learn more about projects on:

https://brainly.com/question/4853153

C++
see attached file for quesion

Answers

The picture doesn’t load.

Please hurry, it's a test! 30 POINTS. :)
What computing and payment model does cloud computing follow?

Cloud computing allows users to_____ computing resources and follows the ______
payment model.

1. Buy, Own, Rent, Sell
2. pay-as-you-go, pay-anytime-anywhere, pay-once-use-multiple-times

Answers

1 own
2 pay anytime anywhere
Other Questions
which tool would be best for measuring centimetersA. Metric ruler B. Balance scaleC. Meter scaleD. Measuring tape Is - 4 the absolute value of 3 7? Explain. Can someone plz help me? Help me please!! I dont understand I,too poem literary and poetic devices write a short paragraph (three to four sentences) that explains how it works for computers and internet communications in relation to cybersecurity. A bag of fruit contains 4 apples and 2 banans 3 oranges and 5 peaches. Darlene will randomly select two piecies of fruit one at a time from the bag and not put them back what is the probabilty that the first piece of fruit Darlene secelts will be on apple and the second piece of fruit will be orange Simplify the expression completely. You work for a company that provides payroll automation software to its clients. You are creating a program that will automate payroll tasks for small businesses with few employees. You are on track to meet your deadline for the project, and you anticipate having a lot of money leftover in the project budget. Mid-project, you receive a call from the human resources manager at MakeStuff, a company that will use the small-business payroll software. The manager informs you that MakeStuff has decided to offer its employees a 401k investment option and asks whether the small-business payroll program can automatically manage 401k investments. Currently, the project plan does not include that function, but you believe making the addition would be valuable to your business. You are worried about requesting permission to add this functionality for two reasons. First, the deadline for this project is very close, and it cannot be moved. Second, you have created software that automates flexible savings account management, but you haven't automated 401k investments before, and you know they are more complicated. You must fill out a change order form to request this change. Select the best option for each portion of the form.a. Purpose of Changeb. Scope of Changec. Plan for Changed. Risk Analysise. Backout Plan How do I do this? It's a modulus question. Eight times a number increased by 4 times the number is less than 36. What is the number? . logo thon 13 then find the Collett and Marsh (1974) videotaped instances when two people met in a hallway to avoid collision. This type of research is called Which of the following is a solution of 4x + 3x = 12?(a) (4,0)(b) (3,0) Choose a synonym for the underlined homonym (a word with two or more meanings).I did not expect the boat to rock so much.a.boulderc.astoundb.swayd.shock _________ is called when the passer throws the ball away to prevent loss of yardage.Unsportsmanlike conductEncroachmentIntentional groundingDelay of game what was walt disneys first job when he was a young boy? What is the word element related to milk? can anyone please tell me how to do this how many moles of water in 100 grams quickly answer to get brainly