#include <iostream>
#include <string>
#include <sstream>
#include <windows.h>
usingnamespace std;
int main()
{
double velocity, frequency, lamder;
int vwf;
string useless;
start:
cout << "Welcome to my very poor program, i can't even afford a GUI! now for\n";
cout << "starters this program is designed to find either velocity, frequency";
cout << " or\nwavelength.";
cout << "\nNow below enter a number for the calculation you wish to make\n";
cout << "Velocity - 1\n";
cout << "Wavelength - 2\n";
cout << "Frequency - 3\n";
cout << "Decide which calculation you are performing and enter its \n";
cout << "corresponding number below.\n";
cin >> vwf;
switch (vwf)
{
case 1:
cout << "Type in the frequency below, usually in hertz (Hz)\n";
cin >> frequency;
cout << "before we go any further i must say, Alan Collis is a fag!\n";
cout << "Now please enter the wavelength below \n";
cin >> lamder;
velocity = frequency*lamder;
cout << "ok good, since frequency is " << frequency << " and wavelength is " << lamder << "\n";
cout << "velocity is " << velocity <<"!\n";
break;
case 2:
cout << "Type in your velocity below.\n";
cin >> velocity;
cout << "Please enter Frequency this time.\n";
cin >> frequency;
lamder = velocity/frequency;
cout << "Since velocity is " << velocity << " and frequency is " << frequency << "\n";
cout << "then wavelength is " << lamder << "!\n";
break;
case 3:
cout << "Type in the velocity below.\n";
cin >> velocity;
cout << "Type the wavelength.\n";
cin >> lamder;
frequency = velocity/lamder;
cout << "Since velocity is " << velocity << " and wavelength is " << lamder << "\n";
cout << "so frequency would be " << frequency << "!\n";
break;
}
cout << "Program will start again in 5 seconds\n\n";
Sleep(5000);
cout << "-----------------------------------------------------------";
cout << "-----------------------------------------------------------";
cout << "------------------------------------------";
if (5 != 8) goto start;
return 0;
}
my program calculates wavelength and all that, but how would i get my users to be able to input something like 3.00 x10²
or something??
it is a scientific program i and really need to be able to have my users input numbers using scientific notation.