peacefully: (lilo: who's the best????)
Your Personal Positive Attitude ([personal profile] peacefully) wrote2009-10-27 04:40 pm

(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

[identity profile] kame-pie.livejournal.com 2009-10-27 11:45 pm (UTC)(link)
Is that....Java ;-;

/slowly backs into a corner

[identity profile] anzu-less.livejournal.com 2009-10-27 11:47 pm (UTC)(link)
IT'S C++

I'M SO BAD AT AT

AND NOW I'M PISSED

MY ANSWER AREN'T COMING OUT RIGHT

THEY SHOULD HAVE THREE NUMBERS AFTER THE DECIMAL POINT BUT IF I ENTER .5 IT COMES OUT 0.5.... NOT 0.500 LIKE I THINK SHE WANTS



BUT I'M SO OVER THIS

/cries in a corner

[identity profile] kame-pie.livejournal.com 2009-10-27 11:49 pm (UTC)(link)
There's some sort of... something you can use to fix that. Augh my programming skills are shit.

I have to drop my Java class this semester rofl. orz I got off on the wrong foot.

[identity profile] anzu-less.livejournal.com 2009-10-27 11:54 pm (UTC)(link)
I-I just got it. I needed to put showpoint in there along with seprecision... it works now... /cries I'm so happy :')

Oh sad. What are you working on instead?

[identity profile] kame-pie.livejournal.com 2009-10-27 11:57 pm (UTC)(link)
Yay! \o/

I have no idea adlkjjakj Just... my other classes. English, psychology, sociology... idk. Must get my shit together. orz

[identity profile] anzu-less.livejournal.com 2009-10-27 11:58 pm (UTC)(link)
You can do it! /cheers :D

[identity profile] kame-pie.livejournal.com 2009-10-28 12:01 am (UTC)(link)
Aaaah good luck with your programming ;o;

[identity profile] anzu-less.livejournal.com 2009-10-28 12:05 am (UTC)(link)
Thank you :')

[identity profile] anzu-less.livejournal.com 2009-10-27 11:59 pm (UTC)(link)
but showpoint and setprecision works too, yeah?

/just edited it like two seconds ago

[identity profile] vampiricdescent.livejournal.com 2009-10-28 12:05 am (UTC)(link)
fixed is technically what you should use because showpoint will do weird stuff with whole numbers

but if that is what your teacher told you to do go for it

[identity profile] anzu-less.livejournal.com 2009-10-28 12:06 am (UTC)(link)
We're so early on, I'm not entirely sure what fixed is yet. We'll probably learn more about it later :)

/will mooch off of you for help >:)

[identity profile] vampiricdescent.livejournal.com 2009-10-28 12:57 am (UTC)(link)
mooch off of cplusplus.com not me :(

it is the best

[identity profile] anzu-less.livejournal.com 2009-10-28 03:29 am (UTC)(link)
ooh, thank you ♥

[identity profile] palpable.livejournal.com 2009-10-28 02:25 am (UTC)(link)
WHAT THE HELL IS THIS
WHY ARE THERE SMART PROGRAMMING PEOPLE ON MY FLIST /PEES

[identity profile] anzu-less.livejournal.com 2009-10-28 03:29 am (UTC)(link)
I'M NOT

I'M SO BAD AT THIS /flails

[identity profile] vampiricdescent.livejournal.com 2009-10-28 03:44 am (UTC)(link)
dude that is gross