Got Homework?
Connect with other students for help. It's a free community.
Here's the question you clicked on:
 0 viewing
BecomeMyFan=D
Group Title
Is there a mathematical way to do what this C program does
 3 years ago
 3 years ago
BecomeMyFan=D Group Title
Is there a mathematical way to do what this C program does
 3 years ago
 3 years ago

This Question is Closed

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
#define close_enough 0.01 main() { char facts[] = {"fat (grams)", "calcium (%)", "carbs (grams)", "vitamin D (%)", "cholesterol (%)" }; double ingred[3][5] = { { 0, 1, 2, 4, 3 }, { 3, 4, 5, 0, 3 }, { 0, 6, 0, 7, 8 } }; int numbers_should_equal_this[] = { 15, 43, 4, 7 ,3}; int looper[3]; for (looper[0] = 0 ; looper[0] < 100 ; looper[0]++) for (looper[1] = 0; looper[1] < 100  looper[0]; looper[1]++) for (looper[2] = 0; looper[2] < 100  (looper[0] + looper[1]) ; looper[2]++) if (ingred[0][0] * (looper[0] / 100.0) < close_enough) if (inged[1][0] * (looper[1] / 100.0) < close_enough) if (sugar[2][0] * (looper[1] / 100.0) < close_enough)
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
:) it is not complete, but you get the idea
 3 years ago

lokisan Group TitleBest ResponseYou've already chosen the best response.0
What is it meant to do?
 3 years ago

lokisan Group TitleBest ResponseYou've already chosen the best response.0
You do have a mathematical way to do this  it's your algorithm.
 3 years ago

suzi20 Group TitleBest ResponseYou've already chosen the best response.0
this is not complete but complicated
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
I'm closing my eyes. I had a test yesterday in Object Oriented Programming ._.
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
it will figure out what ratios of ingredients are needed for a given food. For example I have a cheesecake snack which contains only cream cheese, sour cream, sugar and eggs. I know from the box the nutritional facts of the box, and I know the nutritional facts about each ingredient. Now with this information I should be able to figure out the ratios with a program that just tries every possibility and checks to see if the numbers work.
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
simple
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
OOP is cool but this is not OPP
 3 years ago

suzi20 Group TitleBest ResponseYou've already chosen the best response.0
is this linear programming?
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
you guys should see my 24000 lines C++ code LOL
 3 years ago

lokisan Group TitleBest ResponseYou've already chosen the best response.0
programming scares me
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
I guess it is procedural programming, not linear, IMHO
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
programming is easier than most ppl think
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
lol angoo, I do practice programming, but I don't go deep into it.
 3 years ago

lokisan Group TitleBest ResponseYou've already chosen the best response.0
my programs never work properly and i have no patience and just get angry
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
what language do you use loki
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
LOL , let me guess, error error unable to complie LOL
 3 years ago

lokisan Group TitleBest ResponseYou've already chosen the best response.0
some random crap
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
which language do you use? Java, C++? C? C# etc etc
 3 years ago

suzi20 Group TitleBest ResponseYou've already chosen the best response.0
i used C program with bloodshed dev c++
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
you can learn enough of programming to make a simple text based role playing game in about a month
 3 years ago

lokisan Group TitleBest ResponseYou've already chosen the best response.0
I don't know. I was forced to do some as part of my degree. C or something.
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
I use Java , since it's the only language available to practice here in campus
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
YEY!!! I also used to use Bloodshed
 3 years ago

lokisan Group TitleBest ResponseYou've already chosen the best response.0
Yeah, you're all nerds...
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
I ain't a nerd, you should see me in real life LOL, you would be surprised
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
I know you are kidding, so am I
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
there's a difference between a nerd and a geek, geek = computer more person, nerd = study more person lol
 3 years ago

suzi20 Group TitleBest ResponseYou've already chosen the best response.0
to make a mathematical program from complicated case, u have to learn linear programming, i think.
 3 years ago

lokisan Group TitleBest ResponseYou've already chosen the best response.0
so you're saying if i saw you, i *would* think you were a nerd?
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
I was so proud of the program I wrote lol, finding the factorial of a number >_<
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
it took me AGES ._.
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
no, you would not, not a chance, everyone is surprised when I tell them I am into computers and geek stuff
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
they think I am a bodybuilder or something
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
kidding, no, in real life you it is quite easy to see I am into TECH
 3 years ago

suzi20 Group TitleBest ResponseYou've already chosen the best response.0
in the end noone can solve ur algorithm lol
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
lol, in other words , a geek with a pretty smile =D I guess?
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
I am just trying to confuse you all
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
LOL =D
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
not working here ^_^
 3 years ago

lokisan Group TitleBest ResponseYou've already chosen the best response.0
Yeah, I'm confused.
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
then angoo striked one person, he's what do you call that thing, um, socializing thingy?
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
so guys, anyone wants C++ lessons? *eating a bannana*
 3 years ago

suzi20 Group TitleBest ResponseYou've already chosen the best response.0
BMF u made a HERO confused, well done
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
he has done it before lol
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
loki is drunk ~
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
bananas get you excited LOL
 3 years ago

lokisan Group TitleBest ResponseYou've already chosen the best response.0
I never want to see C++ or any C again
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
I have never even seen C++ or C
 3 years ago

suzi20 Group TitleBest ResponseYou've already chosen the best response.0
i want to see A always
 3 years ago

lokisan Group TitleBest ResponseYou've already chosen the best response.0
If I can't do it with pen and paper or on excel, i get someone to write up a program
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
C++ is very simmilar to java
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
try try try again and again
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
that's what I've heard andy
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
but they say C++ is alot more easier than Java
 3 years ago

lokisan Group TitleBest ResponseYou've already chosen the best response.0
my problem is that it's so finicky. so much room for error. one mistake and you can spend hours looking for it.
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
and, no, bananas do NOT get me excited, they are just fruit
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
lol, they get you excited :)
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
nah, java and C++ are exactly of same difficulty
 3 years ago

suzi20 Group TitleBest ResponseYou've already chosen the best response.0
ahh outta topic
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
they have a very longnamed chemical that I don't remember that gives you energy ^_^ same thing with chocolate and barely. I forgot the name hmm wait
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
just that, java is used for one thing, and C++ in other situations
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
Oh yeah, Tryptophan! :) that's what it's called
 3 years ago

lokisan Group TitleBest ResponseYou've already chosen the best response.0
Tryptophan puts you to sleep!
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
banana , choco, and barely = goog for heart = because they contain serotonin.
 3 years ago

lokisan Group TitleBest ResponseYou've already chosen the best response.0
it's in turkey
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
lol, it's in bananas, chocolate and barely lol
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
I have attended an Organic Chemistry course for fun ^_^
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
Java: Finances Web Simple boring games C++ Operating Systems Almost all comercial software Bank server software Airplane software 3D games (like for PS3, PC...)
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
but they're using java now
 3 years ago

suzi20 Group TitleBest ResponseYou've already chosen the best response.0
folks, all of u get a job, someone asking about max domain
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
I'm not sure of the maximal domain >_<
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
nope, not everyone, java is great for smal programs, C++ is good for complex comercial ones, the multimilion ones
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
They've stopped teaching C++ though
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
do you know why? because with java it is easyer to make simple programs and dysplay simple graphics, which is good for learning, but C++ can take very long time to learn, just to draw a cube on the screen is hard
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
They say that in computer engineering, C++ will be taught and Java will be ignored.
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
anyways, languages are languages, all function the same in the end.
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
all have one place to go, all have same use.
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
stupid computer with some human intelligence
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
obedient to the rules.
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
check this, it has a simple C++ program with two 3D objects spinning aroun, AND a cpp file with the SOURCE CODe
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
so finaly you can see how C++ looks and how much code you need to do that simple stuff
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
I'll check it later , thanks
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
oh, and check this, it is more fun# =D
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
make sure to examine the code =D LOL
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
the cpp file
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
not in my current mood lol, but I will later.
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
thank you.
 3 years ago

nowhereman Group TitleBest ResponseYou've already chosen the best response.0
If you want a mathematical way, you should consider functional programming. e.g. Haskell
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
lol, finally someone has answered the question that was displayed
 3 years ago

BecomeMyFan=D Group TitleBest ResponseYou've already chosen the best response.0
ok, I will check out haskell, shouldn't be hard after learning C++
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
if you're good at the previous ones, then the new ones will be easily absorbed by you ^_^
 3 years ago

nowhereman Group TitleBest ResponseYou've already chosen the best response.0
Well, it is, after all, a different programming paradigm. You not only have to learn new names and a little syntax, but you also have to think differently about your algorithms — in a more mathematical way.
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
yeah, algorithms algorithms
 3 years ago

sstarica Group TitleBest ResponseYou've already chosen the best response.0
I'm off to go soon, later :)
 3 years ago
See more questions >>>
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.