Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Could u please helppp me to solve this lab homework!! In this lab hmw I should open a file.txt during writing this program!! The language

image text in transcribed
Could u please helppp me to solve this lab homework!!
In this lab hmw I should open a file.txt during writing this program!!
The language either Dev C++ or Eclipse it doesnt matter!!
Lab #2 1. This program tests the concepts of: o Review of Computer Programming 1 o File Streams Loops o Strings 2. Programs: o lab02.cpp -We are given a data file from a company containing all their employee names, salary, and gender. We are to process the data and display gender and salary statistics. File format (each field separated by a tab): First row is a header row All other ro ws: .first name Last_name salary gender o Safe assumptions to make . No spaces will be in the file, only tabs. (No last names have more than one word) - Gender will be only Female or Male - You do not need to STORE the entire file in memory, process each line and forget the details that do not matter, such as employee's name o Your code should work for any data that follows the formatting rules - File may contain MORE then 1000 records, perhaps millions - File name may be hard coded, however, do not add any path info -After reading in and processing the data: Output the number of employees found, the number of females, and the number of males .Output the average total salary, average female salary, and the average male salary -EXTRA FUN: Complete the lab using only NINE variables (with ifstream being one of them and not counting const) You can do it with even less, however, it affects readability. NOTE: To get full credit on this lab, you do not need to follow this bullet 3. Example Output: Total Persons: 1000 Total Females: 486 Total Males: 514 Average Salary for all: $105230 Average Salary for Females $108097 Average Salary for Males: $102519 NOTE: 100% match to example output required for full credit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions