Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a data file with 1 0 lines. Each line in the file consists of a faculty member s first name, last name, rank, and
Create a data file with lines. Each line in the file consists of a faculty members first name,
last name, rank, and salary. The faculty members first name and last name for the ith line are
FirstNamei and LastNamei. The rank is randomly generated as assistant, associate, and full. The
salary is randomly generated as a number with two digits after the decimal point. The salary for
an assistant professor should be in the range from to for associate professor from
to and for full professor from to Save the file in Salary.txt
Here are some sample data:
FirstName LastName assistant
FirstName LastName associate
FirstName LastName full
Second Part:
Read the records from Salary.txt file. Each line in the file consists of a faculty members first
name, last name, rank, and salary Write a program to display the total salary for assistant
professors, associate professors, full professors, and faculty, respectively, and display the
average salary for assistant professors, associate professors, full professors, and faculty,
respectively
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started