IT newbie needs help seriously. Thanks in advance.

Hi guys. I am a freshman IT students that needs help badly in codes. I have a homework and I hope you guys could help me.

1. Create an application that will simulate a rent-a-car system with the following conditions:

a. A node should be constructed with fields such as plate number, rent date and return date

b. Ask the user to choose from different task such as
[1] Rent a Car,
[2] Return a car,
[3] View Cars Rented ,
[4] Save Transactions
[5] Exit

c. Create functions for each chosen task
i. The rent a car function should add car rented in specified dates
ii. The return a car function should delete a car rented from the node
iii. The view cars rented function can display all cars rented with the number of days left before returning
iv. The save transactions function can store all node data in a text file

2. The application can load recorder transactions from the text file


I really hope you could help me with this. Thank you.
show us at least what you have done.
here's what I have so far and I'm totally lost. I'm sorry.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<strings.h>

struct Rental{
    char plateNo[5];
    int rentDate;
    int returnDate;
    struct Rent *next;
};

typedef struct Rental *Car;
Car top=NULL;

FILE *file;

void addRental(Car rental){
    if(top==NULL)
        top=rental;
    else{
        Car last=top;
        while(last->next!=NULL)
                last=last->next;
        last->next=rental;
        
        }
    }

void loadRentals(){
    file=fopen("exercise6.txt","r");
    while(!feof(file)){
        Car renatl = (Car)malloc(sizeof(struct Rental));
                fscanf(file,"%s %i",&rental->plateNo,&rental->returnDate,&rental->rentDate);
        rental->next=NULL;
        addRental(rental);
        }
        
        fclose(file);
    }
    
int viewAvailableRentals(){
int count=1;
    Car rental = top;
    while(rental!=NULL){
        printf("[%i] Plate No: %s \t Return Date: %i \n",count++,flight->number,flight->seats);
    rental=rental->next;
        }
        
        return count;
    }
    
system("pause");
fclose(file);

}

Topic archived. No new replies allowed.