SPF Calculator for Sunblock

Hi guys! I am working on a program that calculates sunblock data. One function is to calculate the SPF, given the UV index and the melanin level of an individual.

Basically, the user inputs the UV index for the day, and the melanin level, and the program will calculate the SPF.

The problem is that I do not the formula to calculate it. Google search did not give me exactly what I wanted. If anyone can help, I would greatly appreciate it.


1
2
3
4
5
6
7
8
9
10
11
void calculateSPF()
{
    SPFData data;
    int melaninLvl, UVIndex;
    int SPF;

    cout<<"What is the UV index for today, and the melanin level for this individual?"<<endl;
    cin>>data;
    cout<<data;
    cout<<endl;
}


Last edited on
Wikipedia says you don't have the data in the right units to calculate the SPF.
https://en.wikipedia.org/wiki/Sunscreen#Sun_Protection_Factor (Formula at the bottom of the section.)
Topic archived. No new replies allowed.