An open API service indexing awesome lists of open source software.

https://github.com/milan-sony/mensturalmate

MensturalMate is a simple menu driven period calculator build in C language as part of my mini-project in MCA Semester 1
https://github.com/milan-sony/mensturalmate

c c-language c-programming menstrual-cycle menstrual-tracking mingw

Last synced: 3 months ago
JSON representation

MensturalMate is a simple menu driven period calculator build in C language as part of my mini-project in MCA Semester 1

Awesome Lists containing this project

README

        


Icon

# MensturalMate

A simple menu driven period calculator build in C language as part of my mini-project in MCA Semester 1

## Run locally

To run this project, you need to install an IDE/Code Editor (Visual Studio Code is preferable) and also a C/C++ compiler on your system. Some popular compilers are:
1. GCC on Linux
2. GCC via Mingw-w64 on Windows
3. Microsoft C++ compiler on windows
4. Clang for XCode on MacOS

Check out this link to know how to run a C program in Visual Studio Code.

## To compile the code

```bash
gcc periods_tracker.c -o periods_tracker
```

## Run the code

```bash
.\periods_tracker
```

## Sample code
```bash
// stucture to hold the period details
struct period_details
{
int day;
int month;
int year;
int cycle_length;
int period_length;
}periods;
```

```bash
int day = periods.day;
int month = periods.month;
int year = periods.year;
int days_in_month;
```

```bash
for (int i = 0; i < 3; i++){
day += periods.cycle_length;
if (day > days_in_month){
day -= days_in_month;
month++;
if (month > 12){
month = 1;
year++;
}
}
printf("\t=> \t%d/%d/%d\n\n", day, month, year);
}
```

## Screenshot