Quantcast

A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

BecomeMyFan=D

  • 4 years ago

Is there a mathematical way to do what this C program does

  • This Question is Closed
  1. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 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)

  2. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    :) it is not complete, but you get the idea

  3. lokisan
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    What is it meant to do?

  4. lokisan
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    You do have a mathematical way to do this - it's your algorithm.

  5. suzi20
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    this is not complete but complicated

  6. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I'm closing my eyes. I had a test yesterday in Object Oriented Programming ._.

  7. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 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.

  8. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    simple

  9. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    OOP is cool but this is not OPP

  10. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    noticed.

  11. suzi20
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    is this linear programming?

  12. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    you guys should see my 24000 lines C++ code LOL

  13. lokisan
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    programming scares me

  14. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I guess it is procedural programming, not linear, IMHO

  15. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    programming is easier than most ppl think

  16. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    lol angoo, I do practice programming, but I don't go deep into it.

  17. lokisan
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    my programs never work properly and i have no patience and just get angry

  18. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    what language do you use loki

  19. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    LOL , let me guess, error error unable to complie LOL

  20. lokisan
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    some random crap

  21. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    which language do you use? Java, C++? C? C# etc etc

  22. suzi20
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    i used C program with bloodshed dev c++

  23. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    you can learn enough of programming to make a simple text based role playing game in about a month

  24. lokisan
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I don't know. I was forced to do some as part of my degree. C or something.

  25. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I use Java , since it's the only language available to practice here in campus

  26. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    YEY!!! I also used to use Bloodshed

  27. lokisan
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Yeah, you're all nerds...

  28. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    lol =D

  29. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I ain't a nerd, you should see me in real life LOL, you would be surprised

  30. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I know you are kidding, so am I

  31. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    there's a difference between a nerd and a geek, geek = computer more person, nerd = study more person lol

  32. suzi20
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    to make a mathematical program from complicated case, u have to learn linear programming, i think.

  33. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    no need

  34. lokisan
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    so you're saying if i saw you, i *would* think you were a nerd?

  35. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I was so proud of the program I wrote lol, finding the factorial of a number >_<

  36. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    it took me AGES ._.

  37. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    no, you would not, not a chance, everyone is surprised when I tell them I am into computers and geek stuff

  38. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    they think I am a bodybuilder or something

  39. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    kidding, no, in real life you it is quite easy to see I am into TECH

  40. suzi20
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    in the end noone can solve ur algorithm lol

  41. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    lol, in other words , a geek with a pretty smile =D I guess?

  42. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    =D

  43. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I am just trying to confuse you all

  44. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    LOL =D

  45. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    not working here ^_^

  46. lokisan
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Yeah, I'm confused.

  47. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    LOL!

  48. suzi20
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    hahaha

  49. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    then angoo striked one person, he's what do you call that thing, um, socializing thingy?

  50. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    so guys, anyone wants C++ lessons? *eating a bannana*

  51. suzi20
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    BMF u made a HERO confused, well done

  52. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    he has done it before lol

  53. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    loki is drunk ~

  54. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    bananas get you excited LOL

  55. lokisan
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I never want to see C++ or any C again

  56. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I have never even seen C++ or C

  57. suzi20
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    i want to see A always

  58. lokisan
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    If I can't do it with pen and paper or on excel, i get someone to write up a program

  59. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    C++ is very simmilar to java

  60. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    try try try again and again

  61. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    that's what I've heard andy

  62. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    but they say C++ is alot more easier than Java

  63. lokisan
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    my problem is that it's so finicky. so much room for error. one mistake and you can spend hours looking for it.

  64. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    and, no, bananas do NOT get me excited, they are just fruit

  65. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    lol, they get you excited :)

  66. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    nah, java and C++ are exactly of same difficulty

  67. suzi20
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    ahh outta topic

  68. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    they have a very long-named chemical that I don't remember that gives you energy ^_^ same thing with chocolate and barely. I forgot the name hmm wait

  69. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    just that, java is used for one thing, and C++ in other situations

  70. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Oh yeah, Tryptophan! :) that's what it's called

  71. lokisan
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Tryptophan puts you to sleep!

  72. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    banana , choco, and barely = goog for heart = because they contain serotonin.

  73. lokisan
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    it's in turkey

  74. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    lol, it's in bananas, chocolate and barely lol

  75. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I have attended an Organic Chemistry course for fun ^_^

  76. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 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...)

  77. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    but they're using java now

  78. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    who?

  79. suzi20
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    folks, all of u get a job, someone asking about max domain

  80. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    everyone

  81. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I'm not sure of the maximal domain >_<

  82. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    nope, not everyone, java is great for smal programs, C++ is good for complex comercial ones, the multimilion ones

  83. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    They've stopped teaching C++ though

  84. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 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

  85. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    They say that in computer engineering, C++ will be taught and Java will be ignored.

  86. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    anyways, languages are languages, all function the same in the end.

  87. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    all have one place to go, all have same use.

  88. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    stupid computer with some human intelligence

  89. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    obedient to the rules.

  90. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    etc.

  91. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    check this, it has a simple C++ program with two 3D objects spinning aroun, AND a cpp file with the SOURCE CODe

    1 Attachment
  92. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    so finaly you can see how C++ looks and how much code you need to do that simple stuff

  93. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I'll check it later , thanks

  94. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I guess

  95. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    oh, and check this, it is more fun# =D

  96. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    :)

  97. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    will do

  98. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    make sure to examine the code =D LOL

  99. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    the cpp file

  100. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    not in my current mood lol, but I will later.

  101. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    thank you.

  102. nowhereman
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    If you want a mathematical way, you should consider functional programming. e.g. Haskell

  103. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    lol, finally someone has answered the question that was displayed

  104. BecomeMyFan=D
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    ok, I will check out haskell, shouldn't be hard after learning C++

  105. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    if you're good at the previous ones, then the new ones will be easily absorbed by you ^_^

  106. nowhereman
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 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.

  107. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    yeah, algorithms algorithms

  108. sstarica
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I'm off to go soon, later :)

  109. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

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

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.