Your Personal Positive Attitude (
peacefully) wrote2009-10-27 04:40 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
(no subject)
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
//Mimi Guarino
//CSC 1230 Date: October 27th, 2009
//HW4- Selection With "If" and One Function
//A program that will output the coorisponding color to an imputed wavelength
#include
#include
using namespace std;
void welcomeUser()
{
cout << "Hello user, welcome to the Color Wavelength-o-tron! \n";
cout << "This program is designed to tell you the relationship between\nwavelength, and color shown on this chart. \n\n";
cout << "\tColor \tWavelength Range\n";
cout << "\tViolet \t0.400-0.424\n";
cout << "\tBlue \t0.424-0.491\n";
cout << "\tGreen \t0.491-0.575\n";
cout << "\tYellow \t0.575-0.585\n";
cout << "\tOrange \t0.585-0.647\n";
cout << "\tRed \t0.647-0.700\n";
cout << "Simply enter your wavelength and let us do the rest!\n";
cout << "\n";
cout << "Enter wavelength: ";
}
int main ()
{
cout << "";
welcomeUser();
double waveLength;
cin >> waveLength;
double violet = 0.418;
double violetBlue = 0.424;
double blueViolet = 0.429;
double blue = 0.485;
double blueGreen = 0.491;
double greenBlue = 0.496;
double green = 0.570;
double greenYellow = 0.575;
double yellowGreen = 0.580;
double yellowOrange = 0.585;
double orangeYellow = 0.590;
double orange = 0.642;
double orangeRed = 0.647;
double redOrange = 0.652;
double red = 0.700;
if (waveLength < 0.400)
cout << setprecision(4) << waveLength << " microns is out of visual range \n";
else if (waveLength <= violet)
cout << setprecision(4) << waveLength << " microns is Violet \n";
else if (waveLength <= violetBlue)
cout << setprecision(4) << waveLength << " microns is Violet on the Violet/Blue border \n";
else if (waveLength <= blueViolet)
cout << setprecision(4) << waveLength << " microns is Blue on the Violet/Blue border \n";
else if (waveLength <= blue)
cout << setprecision(4) << waveLength << " microns is Blue \n";
else if (waveLength <= blueGreen)
cout << setprecision(4) << waveLength << " microns is Blue on the Green/Blue border \n";
else if (waveLength <= greenBlue)
cout << setprecision(4) << waveLength << " microns is Green on the Green/Blue border \n";
else if (waveLength <= green)
cout << setprecision(4) << waveLength << " microns is Green \n";
else if (waveLength <= greenYellow)
cout << setprecision(4) << waveLength << " microns is Green on the Yellow/Green border \n";
else if (waveLength <= yellowGreen)
cout << setprecision(4) << waveLength << " microns is Yellow on the Yellow/Green border \n";
else if (waveLength <= yellowOrange)
cout << setprecision(4) << waveLength << " microns is Yellow on the Orange/Yellow border \n";
else if (waveLength <= orangeYellow)
cout << setprecision(4) << waveLength << " microns is Orange on the Orange/Yellow border \n";
else if (waveLength <= orange)
cout << setprecision(4) << waveLength << " microns is Orange \n";
else if (waveLength <= orangeRed)
cout << setprecision(4) << waveLength << " microns is Orange on the Red/Orange border \n";
else if (waveLength <= redOrange)
cout << setprecision(4) << waveLength << " microns is Red on the Red/Orange border \n";
else if (waveLength <= red)
cout << setprecision(4) << waveLength << " microns is Red \n";
else if (waveLength > 0.700)
cout << setprecision(4) << waveLength << " microns is out of visual range \n";
return 0;
}
Hello user, welcome to the Color Wavelength-o-tron!
This program is designed to tell you the relationship between
wavelength, and color shown on this chart.
Color Wavelength Range
Violet 0.400-0.424
Blue 0.424-0.491
Green 0.491-0.575
Yellow 0.575-0.585
Orange 0.585-0.647
Red 0.647-0.700
Simply enter your wavelength and let us do the rest!
Enter wavelength: .5
0.500 microns is Green
Press any key to continue . . .
Hello user, welcome to the Color Wavelength-o-tron!
This program is designed to tell you the relationship between
wavelength, and color shown on this chart.
Color Wavelength Range
Violet 0.400-0.424
Blue 0.424-0.491
Green 0.491-0.575
Yellow 0.575-0.585
Orange 0.585-0.647
Red 0.647-0.700
Simply enter your wavelength and let us do the rest!
Enter wavelength: .4159
0.416 microns is Violet
Press any key to continue . . .
Hello user, welcome to the Color Wavelength-o-tron!
This program is designed to tell you the relationship between
wavelength, and color shown on this chart.
Color Wavelength Range
Violet 0.400-0.424
Blue 0.424-0.491
Green 0.491-0.575
Yellow 0.575-0.585
Orange 0.585-0.647
Red 0.647-0.700
Simply enter your wavelength and let us do the rest!
Enter wavelength: .585
0.585 microns is Yellow on the Orange/Yellow border
Press any key to continue . . .
Hello user, welcome to the Color Wavelength-o-tron!
This program is designed to tell you the relationship between
wavelength, and color shown on this chart.
Color Wavelength Range
Violet 0.400-0.424
Blue 0.424-0.491
Green 0.491-0.575
Yellow 0.575-0.585
Orange 0.585-0.647
Red 0.647-0.700
Simply enter your wavelength and let us do the rest!
Enter wavelength: .701
0.701 microns is out of visual range
Press any key to continue . . .
Hello user, welcome to the Color Wavelength-o-tron!
This program is designed to tell you the relationship between
wavelength, and color shown on this chart.
Color Wavelength Range
Violet 0.400-0.424
Blue 0.424-0.491
Green 0.491-0.575
Yellow 0.575-0.585
Orange 0.585-0.647
Red 0.647-0.700
Simply enter your wavelength and let us do the rest!
Enter wavelength: .486
0.486 microns is Blue on the Green/Blue border
Press any key to continue . . .
TAKE THAT IN YOUR PIPE AND SMOKE IT >:D
EDIT; OKAY, NOW IT'S DONE FOR REAL. WHOLE THING IS UP HERE, AND IT IS GOING ON BLACK BOARD
/trundles off to do math homework
//Mimi Guarino
//CSC 1230 Date: October 27th, 2009
//HW4- Selection With "If" and One Function
//A program that will output the coorisponding color to an imputed wavelength
#include
#include
using namespace std;
void welcomeUser()
{
cout << "Hello user, welcome to the Color Wavelength-o-tron! \n";
cout << "This program is designed to tell you the relationship between\nwavelength, and color shown on this chart. \n\n";
cout << "\tColor \tWavelength Range\n";
cout << "\tViolet \t0.400-0.424\n";
cout << "\tBlue \t0.424-0.491\n";
cout << "\tGreen \t0.491-0.575\n";
cout << "\tYellow \t0.575-0.585\n";
cout << "\tOrange \t0.585-0.647\n";
cout << "\tRed \t0.647-0.700\n";
cout << "Simply enter your wavelength and let us do the rest!\n";
cout << "\n";
cout << "Enter wavelength: ";
}
int main ()
{
cout << "";
welcomeUser();
double waveLength;
cin >> waveLength;
double violet = 0.418;
double violetBlue = 0.424;
double blueViolet = 0.429;
double blue = 0.485;
double blueGreen = 0.491;
double greenBlue = 0.496;
double green = 0.570;
double greenYellow = 0.575;
double yellowGreen = 0.580;
double yellowOrange = 0.585;
double orangeYellow = 0.590;
double orange = 0.642;
double orangeRed = 0.647;
double redOrange = 0.652;
double red = 0.700;
if (waveLength < 0.400)
cout << setprecision(4) << waveLength << " microns is out of visual range \n";
else if (waveLength <= violet)
cout << setprecision(4) << waveLength << " microns is Violet \n";
else if (waveLength <= violetBlue)
cout << setprecision(4) << waveLength << " microns is Violet on the Violet/Blue border \n";
else if (waveLength <= blueViolet)
cout << setprecision(4) << waveLength << " microns is Blue on the Violet/Blue border \n";
else if (waveLength <= blue)
cout << setprecision(4) << waveLength << " microns is Blue \n";
else if (waveLength <= blueGreen)
cout << setprecision(4) << waveLength << " microns is Blue on the Green/Blue border \n";
else if (waveLength <= greenBlue)
cout << setprecision(4) << waveLength << " microns is Green on the Green/Blue border \n";
else if (waveLength <= green)
cout << setprecision(4) << waveLength << " microns is Green \n";
else if (waveLength <= greenYellow)
cout << setprecision(4) << waveLength << " microns is Green on the Yellow/Green border \n";
else if (waveLength <= yellowGreen)
cout << setprecision(4) << waveLength << " microns is Yellow on the Yellow/Green border \n";
else if (waveLength <= yellowOrange)
cout << setprecision(4) << waveLength << " microns is Yellow on the Orange/Yellow border \n";
else if (waveLength <= orangeYellow)
cout << setprecision(4) << waveLength << " microns is Orange on the Orange/Yellow border \n";
else if (waveLength <= orange)
cout << setprecision(4) << waveLength << " microns is Orange \n";
else if (waveLength <= orangeRed)
cout << setprecision(4) << waveLength << " microns is Orange on the Red/Orange border \n";
else if (waveLength <= redOrange)
cout << setprecision(4) << waveLength << " microns is Red on the Red/Orange border \n";
else if (waveLength <= red)
cout << setprecision(4) << waveLength << " microns is Red \n";
else if (waveLength > 0.700)
cout << setprecision(4) << waveLength << " microns is out of visual range \n";
return 0;
}
Hello user, welcome to the Color Wavelength-o-tron!
This program is designed to tell you the relationship between
wavelength, and color shown on this chart.
Color Wavelength Range
Violet 0.400-0.424
Blue 0.424-0.491
Green 0.491-0.575
Yellow 0.575-0.585
Orange 0.585-0.647
Red 0.647-0.700
Simply enter your wavelength and let us do the rest!
Enter wavelength: .5
0.500 microns is Green
Press any key to continue . . .
Hello user, welcome to the Color Wavelength-o-tron!
This program is designed to tell you the relationship between
wavelength, and color shown on this chart.
Color Wavelength Range
Violet 0.400-0.424
Blue 0.424-0.491
Green 0.491-0.575
Yellow 0.575-0.585
Orange 0.585-0.647
Red 0.647-0.700
Simply enter your wavelength and let us do the rest!
Enter wavelength: .4159
0.416 microns is Violet
Press any key to continue . . .
Hello user, welcome to the Color Wavelength-o-tron!
This program is designed to tell you the relationship between
wavelength, and color shown on this chart.
Color Wavelength Range
Violet 0.400-0.424
Blue 0.424-0.491
Green 0.491-0.575
Yellow 0.575-0.585
Orange 0.585-0.647
Red 0.647-0.700
Simply enter your wavelength and let us do the rest!
Enter wavelength: .585
0.585 microns is Yellow on the Orange/Yellow border
Press any key to continue . . .
Hello user, welcome to the Color Wavelength-o-tron!
This program is designed to tell you the relationship between
wavelength, and color shown on this chart.
Color Wavelength Range
Violet 0.400-0.424
Blue 0.424-0.491
Green 0.491-0.575
Yellow 0.575-0.585
Orange 0.585-0.647
Red 0.647-0.700
Simply enter your wavelength and let us do the rest!
Enter wavelength: .701
0.701 microns is out of visual range
Press any key to continue . . .
Hello user, welcome to the Color Wavelength-o-tron!
This program is designed to tell you the relationship between
wavelength, and color shown on this chart.
Color Wavelength Range
Violet 0.400-0.424
Blue 0.424-0.491
Green 0.491-0.575
Yellow 0.575-0.585
Orange 0.585-0.647
Red 0.647-0.700
Simply enter your wavelength and let us do the rest!
Enter wavelength: .486
0.486 microns is Blue on the Green/Blue border
Press any key to continue . . .
TAKE THAT IN YOUR PIPE AND SMOKE IT >:D
EDIT; OKAY, NOW IT'S DONE FOR REAL. WHOLE THING IS UP HERE, AND IT IS GOING ON BLACK BOARD
/trundles off to do math homework