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

[identity profile] continuing.livejournal.com 2009-10-27 11:46 pm (UTC)(link)
... WHAT IS THIS ALIEN LANGUAGE

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

IT LOOKS PRETTIER IN VISUAL STUDIOS ;_;

AND I'VE BEEN TINKERING FOR EVER

I NEED TO PAY MORE ATTENTION IN CLASS /sobs

IT'S STILL WROOOOONG

[identity profile] continuing.livejournal.com 2009-10-27 11:50 pm (UTC)(link)
WHAT IS THIS I DON'T EVEN

I LOOK AT IT AND MY BRAIN LIKE... FIZZLES

[identity profile] anzu-less.livejournal.com 2009-10-27 11:56 pm (UTC)(link)
IT LOOKS LIKE THIS WHEN YOU RUN IT

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 . . .

AND I JUST GOT IT TO WORK

I PUT IN .5

AND .500 CAME OUT

I'M SO HAPPY

[identity profile] continuing.livejournal.com 2009-10-27 11:59 pm (UTC)(link)
IBSDIGUBSDGIUB YAAAAAAAAAAY YOU KICK ITS BUTT B(

[identity profile] anzu-less.livejournal.com 2009-10-28 12:06 am (UTC)(link)
THANK YOU I SHALL

/pumps fist to inspirational music

[identity profile] cruelruin.livejournal.com 2009-10-28 12:29 am (UTC)(link)
Ugh. Coding was always my least favourite thing in web design. Looks like C++ is just annoying in a different way.

If only troubleshooting with this kind of code was more advanced than "oh you have a syntax error in your FOURTEEN PAGES OF CODE"... one day, it'll have to be.

[identity profile] anzu-less.livejournal.com 2009-10-28 03:28 am (UTC)(link)
I'm so bad at it, but I love it.... I might be going down the path of the machoist

I know, I'm not looking forward to have long butt codes -_- but... I'll be better at them then? probably XD

[identity profile] cruelruin.livejournal.com 2009-10-28 09:06 am (UTC)(link)
Scary. I remember being positive at first, but... -_-

Hahaha! Maybe you will.

[identity profile] anzu-less.livejournal.com 2009-10-28 03:33 pm (UTC)(link)
Haha, I was, but then I got randomly depressed at my fail last night. But now I 'm back in form

TAKE THAT CODE
It is on! >:3

[identity profile] otosaretatenshi.livejournal.com 2009-10-28 02:10 am (UTC)(link)
Not being a dick, but 3 hours? Are you serious? I've written a MUCH more advanced program in C in less than an hour. O_o

[identity profile] otosaretatenshi.livejournal.com 2009-10-28 02:19 am (UTC)(link)
I shall add to that: I am a programming noob, as well.

[identity profile] vampiricdescent.livejournal.com 2009-10-28 11:31 am (UTC)(link)
I think you mean *slow clap*

[identity profile] cruelruin.livejournal.com 2009-10-29 09:45 am (UTC)(link)
So much win, so few words.

[identity profile] anzu-less.livejournal.com 2009-10-28 03:23 am (UTC)(link)
haha, that's okay... it's kind of justified.

pretty much, last class where we talked about this stuff I completely zoned out during class, so I pretty much just dove into the book having no idea how to do this, and worked by trial and error. All in all == very bad plan.

not to mention I'm not really that gifted at this XD I just find it weirdly fun in a way

[identity profile] otosaretatenshi.livejournal.com 2009-10-28 03:31 am (UTC)(link)
I guess it could be a little difficult if you don't have a knack for computer logic. That said, I skip my C lectures entirely, and still get 100's on the lab projects, because I simply look up a reference for any functions or other stuff I need. I'm pretty good at figuring out what I need to look up to solve any problem I might encounter.

[identity profile] anzu-less.livejournal.com 2009-10-28 03:38 am (UTC)(link)
Yeah, I get it, I'm retarded :)

[identity profile] otosaretatenshi.livejournal.com 2009-10-28 03:40 am (UTC)(link)
I wouldn't say you're retarded, you probably just need more experience using computer logic :X

[identity profile] anzu-less.livejournal.com 2009-10-28 03:42 am (UTC)(link)
haha, probably. I certainly hope so :)

[identity profile] kaondesu.livejournal.com 2009-10-28 04:19 am (UTC)(link)
*raises eyebrows*

[identity profile] anzu-less.livejournal.com 2009-10-28 05:51 am (UTC)(link)
:3

[identity profile] willfor-iv.livejournal.com 2009-10-28 04:28 am (UTC)(link)
I'm not THE BEST at C++ (I enjoy C# much more...) but I'm reasonably certain that you're supposed to put something after the #include statements. MAYBE NOT idk.

[identity profile] anzu-less.livejournal.com 2009-10-28 05:52 am (UTC)(link)
oh, haha. There is stuff there, it's just inside of > < these babies, so you can't see them :3

they're ninja code

[identity profile] anzu-less.livejournal.com 2009-10-28 03:46 pm (UTC)(link)
but thank you thank you for pointing that out! It... would have been so bad if I turned in a code without iostream at the beginning alkdgsa

[identity profile] sahara-storm.livejournal.com 2009-10-28 10:39 pm (UTC)(link)
I have no idea what this is! But fuck yeeeeeah GO MIMI!! ♥ 8D