Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Creating a program to sort employees based on their studies

I have create a project in codeblocks that outputs (or returns, and by that I mean displaying on the screen after running the code). My task sounds like this:
The following information is read about the employees of a company:
  • First name and last name
  • Their studies - f for no studies - m for medium studies - s for superior studies
  • For the employees with no studies nothing is saved.
  • For the employees with medium studies the year of gradution and city where they graduated are saved.
  • For the employees with superior studies the college they gratuated, the city where they graduated, and year of graduation are saved. The employees whould be displayed in the following order: the ones with superior studies, the ones with medium studies, and lastly, the ones with no studies.
I have written some of the code, after which I asked my teacher for a tip in order to write the code correctly, and she told me to use fstream. Here is a screenshot of the code I've written until now:
sorry
#include <iostream>
#include <conio.h>
#include <string.h>
#include <stdlib.h>
#include <fstream>
using namespace std;

struct angajati{
    char nume[30];   // first name and last name
    char pren[30];
    char doe[10];   // day of employment
    smedii datan;
    ssuperioare datan;

};
struct smedii{
    int aal[4];    // aal -> year of graduating hs
    char lal[30];    // lal -> city where the employee graduated hs
};
struct ssuperioare{
    char fac[40];    // fac -> college
    char loc[30];    // loc -> city
    int aa[4];     // aa -> year of graduating
};

angajat a[100];

int main();
{
    cout<<"nume=";cin>>a.nume;
    cout<<"prenume=";cin>>a.pren;
};
How can I complete this task? What should I keep from the program and what should go?

Comments