Ohms law calculator + whitelist of user. Learning use I've been learning a ton of c++ lately on Codecademy and I'm soon done with the course of c++.

(Still need to learn classes, object-oriented programming and harder projects.)

But I wanted to get a review of my recent program.

And I also wanted to know if its possible to make an Unique ID, that only fits me, kinda like the cicada.

Psst, the program is to solve Ohm's Formular in physics and actively takes input to solve exactly your case.

Leave suggestions on what I could do better in this project + what I should try to program next too.

//Include
#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

 int main(){

    //Declare variables
    double Wolt;
    double Ohm;
    double Amp;
    std::string Formular;
    std::string Username;
    std::string Whitelist;

    //Login sequence:
    std::cout &lt;&lt; "Hvad er dit username?: ";
    cin &gt;&gt; Username;

    //Whitelist
    Whitelist = "Fred267s", "Seb4572s", "Popp4593s";

    //Check if username is on whitelist
    if (Username == Whitelist){

        std::cout &lt;&lt; "Velkommen til fysik formel udregner til strøm " &lt;&lt; Username &lt;&lt; " \n";
        std::cout &lt;&lt; "Lavet af Frederik Schmidt 1.S \n";
    }

    //If username is NOT on the whitelist
    else if (Username != "Fred267s", "Seb4572s", "Popp4593s" ){

        std::cout &lt;&lt; "Sorry, you do not have access! \n";
        return 0;
    }

    //Questions
    std::cout &lt;&lt; "Hvad er det du skal udregne? ";
    cin &gt;&gt; Formular;

    //Wolt formular

    if (Formular == "Wolt"){

        //Questions
        std::cout &lt;&lt; "Hvad er Ohmen?: ";
        cin &gt;&gt;Ohm;
        std::cout &lt;&lt; "Hvad er Amperen?: ";
        cin &gt;&gt; Amp;

        //Formular
        Wolt = Ohm*Amp;

        //Return
        std::cout &lt;&lt; "Volten er: " &lt;&lt; Wolt &lt;&lt; " \n";
    }

    //Amp formular

    else if (Formular == "Amp"){

        //Questions
        std::cout &lt;&lt; "Hvad er Volten?: ";
        cin &gt;&gt;Wolt;
        std::cout &lt;&lt; "Hvad er Ohmen?: ";
        cin &gt;&gt;Ohm;

        //Formular
        Amp = Wolt/Ohm;

        //Return
        std::cout &lt;&lt; "Amperen er: " &lt;&lt; Amp &lt;&lt; " \n";
    }

    //Ohm formular

    else if (Formular == "Ohm"){

        //Questions
        std::cout &lt;&lt; "Hvad er Volten?: ";
        cin &gt;&gt;Wolt;
        std::cout &lt;&lt; "Hvad er Amperen?: ";
        cin &gt;&gt;Amp;

        //Formular 
        Ohm = Wolt/Amp;

        //Return
        cout &lt;&lt; "Ohmen er: " &lt;&lt; Ohm &lt;&lt; " \n";
    }

    //If the Formular inputtet is NOT on the list.

    else {

        cout &lt;&lt; "Error in the formular, please try again!";

    }
}
Don't 

using namespace std;


This doesn't do what you want (only first one works):

    //Whitelist
    Whitelist = "Fred267s", "Seb4572s", "Popp4593s";

    //Check if username is on whitelist
    if (Username == Whitelist){



[It's also a VERY dodgy access control mechanism!]

I don't like asking user for a string describing the "Formula". How does the user know they should type "Wolt"? What if they type "wolt" instead? I think it would be more reasonable to show 3 choices:

1 - Wolt    2 - Amp    3 - Ohm

Please Enter (1-3): 


And then clean the user input checking if it is a valid integer between 1-3 and then represent the choice internally using a Class enum in your code. 

This will open up a range of oppotunities to use functions in your code. 


enum class Formula ( wolt = 1, amp = 2, ohm = 3 );

...

Formula prompt_formula() {
  // code to read from std::cin clean input and cast to enum class
}


Then try to find a way to add even more structure to your program rather than one huge if/elseif/else statement. I am not going to give you the code, because that would defeat the purpose, but your main function should be more like this:

int main() {
  explain_usage();
  Formular form = prompt_formular();
  auto [label, answer] = compute(form);
  print_answer(label, answer);
}


I could go on, but that's probably plenty to get on with for now.