Search results for query: *

  1. toforfiltum

    Program to display letter combinations on phone keypad

    I've finally come up with a working solution using loops! The idea behind my code is like a binary counter. Here it is: #include <stdio.h> #include <stdlib.h> #include <string.h> void recurse( char str[], char caller, char *array[] ); int main () { char *array[8] = { "ABC", "DEF", "GHI"...
  2. toforfiltum

    Program to display letter combinations on phone keypad

    Yes, but how would this work if the user can input unlimited numbers? It is here precisely that I'm stuck. I can't be writing so many nested loops...
  3. toforfiltum

    Program to display letter combinations on phone keypad

    Aha! No. When this problem was given, we were supposed to solve it using just normal loops. Problem is I can't seem to figure that out. When I started thinking on how to use loops, I first started with a while loop to run through all the cases of the alphabets associated with the last number...
  4. toforfiltum

    Program to display letter combinations on phone keypad

    I have run it on gdb and I received some kind of error telling me that program can't access memory and also some segmentation faults. But thanks for alerting me about modifying caller...I realized that there are some huge errors now in my code needed to be corrected. Thanks.
  5. toforfiltum

    Program to display letter combinations on phone keypad

    Homework Statement On a phone keypad, many of the numbers have letters associated with them. For instance, the letters A, B, and C are associated with the number 2. Write a program that accepts a number as input and prints all of the possible letter combinations associated with that number. For...
  6. toforfiltum

    Engineering Simplifying switching circuit literals

    I'm sorry, although I now understand the distinction, I still can't get the right answer I'm not too sure if I know what the question asks, but it states that the final form needs to be simplified to 9 switching elements. And no, I don't have the answer. Does a switching element correspond to...
  7. toforfiltum

    Engineering Simplifying switching circuit literals

    I would count the number of terms in a SOP form. Would that be right? So I think I may be wrong, 9 circuit elements means just 9 switches?
  8. toforfiltum

    Engineering Simplifying switching circuit literals

    Homework Statement The problem is given in the picture attached. It is a network of switches. Homework Equations The Attempt at a Solution I managed to simplify the expression to this: ## (S + x'(w+y) + xvz)(x'+y)(v+z') ## but I just can't find a way to simplify it to 9 literals. I've...
  9. toforfiltum

    A C program to determine the most common birthday

    Homework Statement Write a program that opens a file of the users choice that contains a list of birthdays. Extract from this file two things: (1) the date with the most common birthday (all of them) and (2) the month with the most people born. We will not test for a tie in either of these...
  10. toforfiltum

    Simple C program involving arrays which cannot execute

    So would it be something like %100s? And also, if I were to do this with fgets instead, I should put 99 to account for the null character, right? Wow, I didn't know that there could be so many bytes in just a few letters! The double x and int i gets printed after the string. Is this something...
  11. toforfiltum

    Simple C program involving arrays which cannot execute

    Won't there be a null character right after"uesday"?
  12. toforfiltum

    Simple C program involving arrays which cannot execute

    Sorry for the late reply! I have been busy, but I really appreciate yours and Mark44's help! It seems I've made the question to be more complicated than it needs to be. Here is my much improved (hopefully!) version of the code: #include <stdio.h> #include <string.h> int main (void) { char...
  13. toforfiltum

    Simple C program involving arrays which cannot execute

    I haven't yet learned dynamic memory management, but I'll get back to it later after fixing a bug in my program. I have managed to make it work somewhat, but not exactly right, and also using much more lines of code than you said was necessary. I'm not sure if the question meant just constantly...
  14. toforfiltum

    Simple C program involving arrays which cannot execute

    Thanks! Just to be sure, scanf stores the newline character, but fgets doesn't, right?
  15. toforfiltum

    Simple C program involving arrays which cannot execute

    Thanks so much for your help! However, I'm not sure if I could see any difference between both. Both reads from stdin, and stores it in the character array my_string.
  16. toforfiltum

    Simple C program involving arrays which cannot execute

    I've modified my code again, and it still isn't working. I don't know why. Here is my edited code: #include <stdio.h> int main () { char input_word [100] = {'\0'}, temp [100]= {'\0'}, command [10] = {'\0'}, stop [4] = {"STOP"}; int n = 0, match = 0; printf("Enter a word: ")...
  17. toforfiltum

    Simple C program involving arrays which cannot execute

    Ok, so I've modified the code with your suggestions. Now, I'm wondering when am I able to use strcmp and so functions? Are they only able to be used with char * ? If so, how do I compare an array of commands that the user entered with the word STOP? My modified code ( which still does not work...
  18. toforfiltum

    Simple C program involving arrays which cannot execute

    < Mentor Note -- thread moved to HH from the technical Computer forum, so no HH Template is shown > I have a homework problem which requires me to convert a word a user entered to Pig Latin by moving the first letter of the word to the end and adding an ay to it. For example, Tuesday becomes...
  19. toforfiltum

    Program to find combination of letters associated with phone

    That's precisely the problem I had with my idea, I could not store those expressions because while writing the program, I do not know beforehand how many unique numbers the user would enter, thus I can't create a variable to store it. Do I make sense? I hope I do.
  20. toforfiltum

    Program to find combination of letters associated with phone

    So here is the question: On a phone keypad, many of the numbers have letters associated with them. For instance, the letters A, B, and C are associated with the number 2. Write a program that accepts a number as input and prints all of the possible letter combinations associated with that...
  21. toforfiltum

    Calculating work done using line integrals

    Yes, I think I've got it. ##F## is ##50 \frac {x'(t)}{\left\|x'(t)\right\|}##
  22. toforfiltum

    Calculating work done using line integrals

    Homework Statement Sisyphus is pushing a boulder up a 100-ft tall spiral staircase surrounding a cylindrical castle tower. a) Suppose Sisyphus's path is described parametrically as $$x(t)=(5\cos3t, 5\sin3t, 10t)$$, $$\space 0\leq t\leq10$$. If he exerts a force with constant magnitude of 50 Ib...
  23. toforfiltum

    Programs Help me decide between EE and ME

    Thanks for your advice. So now, I don't have any experience with programming, but I have a curiosity about how all the hardware in electronic gadgets work. Since I don't see myself as someone who can sit in front of a computer and code all day, I decided that electrical engineering would be the...
  24. toforfiltum

    Programs Help me decide between EE and ME

    Thanks for your thoughts!
  25. toforfiltum

    Programs Help me decide between EE and ME

    Hey everyone, so it's nearing the end of fall semester now, and it's time for me to register for classes next spring. The problem is that I still don't really know what to major in, and I have to decide soon. Both majors have different sets of prerequisites to take before being able to be...
  26. toforfiltum

    Evaluating Cartesian integral in polar coordinates

    Thanks! if it weren't correct, it would be too much pressure for me. 10 minutes! :wink: Anyway, thanks so much for your time, and good night!
  27. toforfiltum

    Evaluating Cartesian integral in polar coordinates

    Ah, I see. Is it ##0 \leq r \leq \frac{3}{cos\theta}##?
  28. toforfiltum

    Evaluating Cartesian integral in polar coordinates

    I honestly do not know. In the ##xy## plane, the region is bounded by the line ##y=x##, the ##x## axis and the line ##x=3##. What does moving it in the ##r## direction mean? If I do so, for ##\theta=0##, I get ##0 \leq r \leq 3##, but for ##\theta=\frac{\pi}{4}##, I get ##0 \leq r \leq 3...
  29. toforfiltum

    Evaluating Cartesian integral in polar coordinates

    Are both upper and lower ones incorrect? I don't know any other way to find the limits for ##r##. Any hints? Or since value of ##x## is constant, are the bounds in Cartesian coordinates something like ##3 \leq \sqrt{9+y^2} \leq 3\sqrt2##?
  30. toforfiltum

    Evaluating Cartesian integral in polar coordinates

    Ah, thank you! I did check the question again in the book, and I did not misread it.
  31. toforfiltum

    Evaluating Cartesian integral in polar coordinates

    Homework Statement Transform given integral in Cartesian coordinates to one in polar coordinates and evaluate polar integral. ##\int_{0}^3 \int_{0}^x \frac {dydx}{\sqrt(x^2+y^2)}## Homework Equations The Attempt at a Solution I drew out the region in the ##xy## plane and I know that ##0...
  32. toforfiltum

    Find center of mass of planar quadrilateral

    How do I find the center of mass of the half piece?
  33. toforfiltum

    Find center of mass of planar quadrilateral

    Homework Statement Consider the planar quadrilateral with vertices (0, 0), (2, 0), (1, 1) and (0, 1). Suppose that it has constant density. What is its center of mass? Homework Equations The Attempt at a Solution Since it has constant density, could I assume that the center of mass would be...
  34. toforfiltum

    Finding transformation T such that T(D*)=D

    Homework Statement If ##D^*## is the parallelogram whose vertices are ##(0,0)##,##(-1,3)##, ##(1,2)##, and ##(0,5)## and D is the parallelogram whose vertices are ##(0,0)##, ##(3,2)##,##(1,-1)## and ##(4,1)##, find a transformation ##T## such that ##T(D^*)=D##. Homework Equations The Attempt...
  35. toforfiltum

    Integrating triple integral over region W

    @LCKurtz Oh, it's fine. I've got the correct answer now, though only after a painfully long process. :smile: Thanks!
  36. toforfiltum

    Integrating triple integral over region W

    Ok, thanks for providing the correct answer for me to check. However, I got a wrong answer. What I would like to know is if the process of calculating the integral in rectangular coordinates really long? Because mine certainly is. I'm just wondering if I'm doing it correctly.
  37. toforfiltum

    Integrating triple integral over region W

    But I think I'm supposed to be calculating it using rectangular coordinates, because this question is in the section before the change of variables topic.
  38. toforfiltum

    Integrating triple integral over region W

    Yes, the rectangular integral is really horrible. It involved a lot of ##cos^4 \theta## terms.
  39. toforfiltum

    Integrating triple integral over region W

    Homework Statement $$f(x,y,z)=y$$ ; W is the region bounded by the plane ##x+y+z=2##, the cylinder ##x^2 +z^2=1##, and ##y=0##. Homework Equations The Attempt at a Solution Since there is a plane of ##y=0##, I decided that my inner integral will be ##y=0## and ##y=2-x-z##. But after this I...
  40. toforfiltum

    Find ratio between dimensions of can w/ largest capacity

    Whew! I can't follow what you wrote, but thanks anyway. I don't even understand why the Lagrangian is ##L=V-uA##
  41. toforfiltum

    Find ratio between dimensions of can w/ largest capacity

    Haha, what you said above was definitely mumbo-jumbo to me. But what do you mean by the tangent plane of the constraint? Is it taking the Hessian of the gradient of the equation of constraint? So, in the case of this question, I do not need to show that the value I get is indeed largest, is it...
  42. toforfiltum

    Find ratio between dimensions of can w/ largest capacity

    Now I have another problem. How do I show that the dimensions I get are those that are of largest capacity? So let me write out my steps again. $$V(r,h)= \pi r^2h$$ $$A(r,h)= 2 \pi r^2 +2 \pi rh$$ $$\nabla V(r,h)=[2 \pi rh, \pi r^2]$$ $$\nabla A(r,h)=[4 \pi r + 2 \pi h, 2 \pi r]$$ $$2 \pi rh=c(4...
  43. toforfiltum

    Find ratio between dimensions of can w/ largest capacity

    Yes, I learned the method you suggested right before learning Lagrange multipliers.
  44. toforfiltum

    Find ratio between dimensions of can w/ largest capacity

    @fresh_42 @Let'sthink Ah, I see now. I didn't think that the can would have a bottom since there is a fixed sheet of metal. I figured that wrapping the sheet around to form a cylinder would leave the bases empty. Thanks so much!:smile:
  45. toforfiltum

    Find ratio between dimensions of can w/ largest capacity

    Homework Statement A cylindrical metal can is to be manufactured from a fixed amount of sheet metal. Use the method of Lagrange multipliers to determine the ratio between the dimensions of the can with the largest capacity. Homework Equations The Attempt at a Solution $$V(r,h)=\pi r^2h$$ $$2...
  46. toforfiltum

    Describe curve to reduce field intensity in fastest time

    Homework Statement Igor, the inchworm, is crawling along graph paper in a magnetic field. The intensity of the field at the point ##(x,y)## is given by ##M(x,y)=3x^2+y^2+5000##. If Igor is at the point ##(8,6)##, describe the curve along which he should travel if he wishes to reduce the field...
  47. toforfiltum

    Newton's method to approximate critical point

    Ah, I think I've got it. Here are my first steps: Let ##g(x,y)=(4y \cos(xy)+3x^2, 4x\cos(xy)+3y^2)##. The 2 functions there are the partial derivatives ##F_x## and ##F_y## respectively. By taking derivative of the function, I can get an invertible 2x2 matrix. And from here I can proceed to use...
  48. toforfiltum

    Newton's method to approximate critical point

    Yes I've read them but I still have no idea on how the links you gave me can be applied to this problem. Sorry. But I will show you what I have tried so far. I made the partial derivatives of ##x## and ##y## as the new functions I need to evaluate using Newton's method. I reason that by getting...
  49. toforfiltum

    Newton's method to approximate critical point

    But I just don't get it. Newton's method is used to get the root of an equation, whereas this is to get a critical point where the derivative is zero. Can the above form apply here?
Back
Top