Hello everyone, I am working on a project and I ran into a dead end due to my knowledge. I wrote what I can but I know I'm missing things, I would greatly appreciate some assistance in finishing it. I will write what I need and what I have so far below.
Assignment: I need to write an application that asks the user for an input file name. ( the file that holds the information). And it writes its output to a file called occupations.out
On each line of the input file there is an occupation job title (without blank spaces with at most 30 characters) followed by a floating-point number representing the national average salary. My program should be able to process 20 occupations (so, my arrays will have 20 elements). The contents of a sample input file:
and so on.
I need the data to be read from the input file and then put into two parallel arrays. The program sorts the data by wage values from highest to lowest. The program calculates and prints the average and median wage values. Format wages with a $ and exactly two digits to the right of the decimal. Job titles should be aligned to the left, wage values to the right. If the input file has more than 20 occupations in it, do not process the ones after 20.
Again assistance would be most appreciated ^_^
Oh no, this is my first time on here, must be someone with same assignment. My main problem is when I run this it doesn't work properly. Sometimes it puts random information but formatted right. To be honest I think I went about this the wrong way but I wanted to get a more experienced person to give me pointers or to possibly fix my code so it will work right. Thanks for the reply.