Mathy program

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
57
58
59
60
61
62
63
64
65
66
67
68
#include <iostream>
#include <string>
#include <sstream>
#include <windows.h>
using namespace 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.
You should tell your users to input something like
3.00E2
instead of
3.00 x10²
Last edited on
Topic archived. No new replies allowed.