Programming Definition and 1000 Threads
-
R
MHB Intro Programming: Computing Total Cost
A drink costs 2 dollars. A taco costs 3 dollars. Given the number of each, compute total cost and assign to totalCost. Ex: 4 drinks and 6 tacos yields totalCost of 26. import java.util.Scanner; public class ComputingTotalCost { public static void main (String [] args) { int numDrinks...- rawxlimits
- Thread
- Intro Programming
- Replies: 8
- Forum: Programming and Computer Science
-
B
Can I Program a Cell Phone Charger to Optimize Battery Life?
Hi guys I'm not sure if this is the best place to post this but I couldn't find anywhere else. Would it be possible to program a cell phone charger to detect when a phone is at 20% and then it will start charging? But it won't start charging before 20%. Then it will charge it up to 99% and then...- Brandon Moore
- Thread
- Battery Programming
- Replies: 2
- Forum: Electrical Engineering
-
D
How Can You Optimize Thrust for a Safe Mars Lander Descent?
You're in a Mars Lander. The planets gravity pulls you towards it at 3.711 m/s². (So at T(1) with 0 thrust your vertical velocity is -3.711). Your lander has 4 thrust settings: 0 m/s², 1 m/s², 2 m/s², 3 m/s², 4 m/s². Each of these use 0, 1, 2, 3 and 4 units of fuel per second respectively. Your...- DavidSnider
- Thread
- Interesting Programming Puzzle
- Replies: 20
- Forum: Programming and Computer Science
-
26 Year Old Computer Scientist's First Physics Foray
Hello lovers of Physics! It has long been one of my deepest darkest secrets that I have never formally studied physics. I've always felt ashamed of this because to me physics is one of the most elegant areas of human thought and I consider myself a decent thinker. I've decided as a new years...- AndrewRibeiro
- Thread
- programming
- Replies: 1
- Forum: New Member Introductions
-
MHB How do we use dynamic programming?
Hello! (Wave) Could you explain to me how we can use dynamic programming in order to solve a non linear programming problem? What do we do for example if we are given the following problem? $$\max (y_1^3-11 y_1^2+40 y_1+y_2^3-8y_2^2+21 y_2) \\ y_1+y_2 \leq 5.4 \\ y_1, y_2 \geq 0$$- evinda
- Thread
- Dynamic Dynamic programming Programming
- Replies: 15
- Forum: Set Theory, Logic, Probability, Statistics
-
Local web page programming on a Mac
I'm used to Windows. I open notepad or wordpad and type <html> Hello world </html> and save it as a .txt file with an .html extension. How do I do this on a Mac? It seems the free included text editor is called textEdit. But it does not allow me to save as a simple txt file with an .html...- tony873004
- Thread
- Local Mac Programming Web
- Replies: 5
- Forum: Programming and Computer Science
-
Share Your Tricks for Satisfying Laziness in Your Programming
People say the best programmers are 'lazy'. They don't like to waste time and they don't like to do monkey work. 'Lazy' programmers automate things, they use tools in wise ways to get things done easier and faster, they reuse code when appropriate, and they write code that's easy to modify...- Jarvis323
- Thread
- Programming
- Replies: 27
- Forum: Programming and Computer Science
-
Programming HP 50g: Is There an Editor?
Is there a programming editor on the HP 50g (like the TI programming systems)? I have been unable to find any information on this, so any help would be appreciated.- onion3000
- Thread
- calculator programming
- Replies: 2
- Forum: Computing and Technology
-
Teaching Programming Skills via Math Concepts
Got this for Christmas and its quite interesting to read: https://www.amazon.com/dp/0321942043/?tag=pfamazon01-20 The basic premise of the book is to explore the principles of generic programming, optimization and the mathematical concept of abstraction using traditional mathematical...- jedishrfu
- Thread
- Concepts Programming Skills Teaching
- Replies: 1
- Forum: Programming and Computer Science
-
S
Would This be a Good Programming "Physics" Project?
I have recently been doing a lot of programming in python for the past year or so, and consider myself to be okay with the language. I also have some experience with mathematical languages like the Wolfram language and Maple. Other than that, I am willing to learn C, C++, or Java for this...- stefan10
- Thread
- Physics Programming Project
- Replies: 9
- Forum: Programming and Computer Science
-
D
Programs Computer Programming Advice for prospective Physics Majors
Hello Everyone, I am a high school physics teacher seeking to give advice to students of mine that are interested in pursuing a physics major. I would imagine that if they want to do any undergraduate research then they better have some programming experience, because I can not imagine how they...- Diaz Lilahk
- Thread
- Computer Computer programming Physics Programming
- Replies: 1
- Forum: STEM Academic Advising
-
MHB Is This Solution to the Linear Programming Problem Correct?
Hello! (Wave) I want to solve the linear programming problem: $\max (5x_1-4x_2) \\ -x_1+x_2 \geq -6 \\ 3x_1-2x_2 \leq 24 \\ -2x_1+3x_2 \leq 9 \\ x_1, x_2 \geq 0$ I have found that the solution is $\left(0, \frac{6}{5}, \frac{36}{5},0, \frac{99}{5} \right)$.. Am I right?- evinda
- Thread
- Linear Linear programming Programming
- Replies: 2
- Forum: Set Theory, Logic, Probability, Statistics
-
MHB Solving Linear Programming Problems Graphically
The following linear programming problem is given and I want to solve it graphically. $$\max (x-y) \\ x+y \leq 4 \\ 2x-y \geq 2 \\ x,y \geq 0$$ I have drawed the lines : $$(\ell_1) x+y=4 \\ (\ell_2) 2x-y=2 \\ (\ell_3) x=0 \\ (\ell_4) y=0$$ as follows: I have drawed the line $2x-y=0$ taking...- evinda
- Thread
- Linear Linear programming Programming
- Replies: 9
- Forum: Set Theory, Logic, Probability, Statistics
-
Looping problem in C programming
I know about For loops but i don't know how to solve a problem like this: A program in which a user wants to print a number for specific number of times but this is not initialized i mean user inputs it after the program is compiled?- Dave Ritche
- Thread
- C programming Programming
- Replies: 14
- Forum: Programming and Computer Science
-
Fortran Fortran 90/95: Read a Function?
Hello everyone! I've been wondering if it is possible in Fortran to 'read' a function.For instance when I code this: contains function f(x) double precision :: f double precision ::x f=(whatever the function) return end function end program It would be ideal if the program allowed...- NicolasPan
- Thread
- Fortran Function Programming
- Replies: 3
- Forum: Programming and Computer Science
-
Python Using Python to calculate projectile motion with resistance
I'm trying to write a program to calculate the trajectory of a projectile with air resistance. I've made the following function which calculates the position of the particle based on a given launch angle and initial velocity: def traj_fr(angle, v0): #function that computes...- Ryaners
- Thread
- Air resistance Beginner Computational physics Motion Programming Projectile Projectile motion Python Resistance
- Replies: 2
- Forum: Programming and Computer Science
-
What should I do next after completing an introductory programming course?
Hello, So I'm in high school and I wanted to self-study programming. In summer I completed the course Introduction to Computer Science and Programming Using Python on edX . I really liked it. I was wondering what I should do next and from where? Should I learn a different language (C , C++ and...- Mastermind01
- Thread
- Computer science Programming Python Self study
- Replies: 2
- Forum: STEM Academic Advising
-
H
What I need for image processing programming?
I am new to image processing and going serious from now on (as part of my research). I am a Mac user. What program is the best for image processing? What the difference between Xcode and Microsoft Window Visual, which one is better and does OpenCV can works with both of them? What kind of...- hilman
- Thread
- Image Image processing Processing Programming
- Replies: 3
- Forum: Programming and Computer Science
-
C/C++ Should Beginners Learn C Before C++?
Dear PF Forum, I read this link That makes me think, "How, straight with C++, do we teach programming language to someone who never knows progamming language?"- Stephanus
- Thread
- Programming
- Replies: 29
- Forum: Programming and Computer Science
-
Engineering Discerete math and algebra books for programming majors
Hi Im looking for discrete mathematics and algebra books to study. I want to enhance my understanding of algorithms and programming and i like discrete mathematics I'm reading Apostol for this semester's calculus (took a look at spivak too). Any book as good as them that will be useful for me ?- AliGh
- Thread
- Algebra Books Programming
- Replies: 1
- Forum: Science and Math Textbooks
-
D
Comp Sci [JAVA GUI] Counting the trajectory of a projectile not shown
Hello PFers, I'm trying to make a program in java which process user's position, initial velocity of the projectile and the elevation of the projectile and show the trajectory in GUI. The language is in java. The problem is, the trajectory won't show. It is supposed to show the player's...- demensia
- Thread
- Code Counting Gui Java Oop Programming Projectile Trajectory
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
J
Maple How Do You Input Formulas for Surface Area Calculations in Maple?
I can't input this formula, z=(1+x^2)/(1+y^2) This is suppose to represent a function of surface of area with double integrals. I'm struggling inputting the codes into evaluate the equation. It would be convenient if help was given- jweie29nh
- Thread
- Maple Programming
- Replies: 10
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
S
Industrial automation programming
In regards to programmable logic controllers (like http://ab.rockwellautomation.com/Programmable-Controllers or http://www.schneider-electric.com/en/product-category/3900-pac--plc---other-controllers) ladder, function block, and structured text are commonly used programming methods. As far as...- Shano
- Thread
- Automation Industrial Programming
- Replies: 1
- Forum: Programming and Computer Science
-
Comp Sci Error while calculating arc length of curve in Fortran
The program must calculate the length of the curve of ƒ=3.1*x^2-5.3/x between x=1/2 and x=3/2.The legth should be calculated as the sum of n line segments starting with n=1 and ending with n=20. I really can't find why the result I'm getting is wrong.Thanks in advance I am giving you the code...- NicolasPan
- Thread
- Arc Arc length Computer science Curve Error Fortran Length Programming
- Replies: 10
- Forum: Engineering and Comp Sci Homework Help
-
S
Modern programming languages causing cognitive dissonance
Anyone else experience extreme cognitive dissonance when learning modern programming languages? If so, have you visited a pschyiatrist about it? 1) Automatic type deduction. The idea that I can be too lazy to figure out the exact type returned from a function, and put var or auto in its place...- SlurrerOfSpeech
- Thread
- Programming
- Replies: 20
- Forum: Programming and Computer Science
-
Programs Physics degree - careers that involve programming?
What are the chances of working in IT if you have a physics degree?? How much do you have to work individually in order to gain the required programming knowledge?? Are there relevant courses you can take as a physics undergrad?? Do you learn any programming language that is relevant to the IT...- The Eraser
- Thread
- Careers Degree Physics Physics degree Programming
- Replies: 6
- Forum: STEM Academic Advising
-
Comp Sci Help with Fortran: Calculate Cos(x) from Equation
Hello I was assigned the following problem:Make a Fortran program which will be able to read a degree[0-360] checking validity range(not type) and it will be able to calculate and print the cos(x) from the following equation: cos(x)=1-x^2/2! + x^4/4!-x^6/6!+x^8/8!-...,where x is in radiants.As a...- NicolasPan
- Thread
- Computer science Fortran Programming
- Replies: 7
- Forum: Engineering and Comp Sci Homework Help
-
S
I overuse try-catches in my programming
My applications seriously look like public void ExecuteCommand ( ) { // ... try { CompareLastTwo(); } catch ( Exception e ) { Console.WriteLine("Error: {0}", e.Message); } // ... } public void CompareLastTwo ( ) { // ... try...- SlurrerOfSpeech
- Thread
- Programming
- Replies: 20
- Forum: Programming and Computer Science
-
C Programming: Arrays and pointers
Homework Statement So I created two arrays one called departure_time and the other arrival_time and populate each array as follows. I've tried both putting 8 and defining N as 8 int departure_times[N]={480, 538, 679, 767, 840, 945, 1140, 1305}; int arrival_times[N]={616, 712, 811, 900, 968...- SnakeDoc
- Thread
- Arrays C programming Pointers Programming
- Replies: 8
- Forum: Engineering and Comp Sci Homework Help
-
How much programming can you expect to do in the lab?
It may be unique to my situation (or it may not, as I was told that AMO is one of the less computational fields of research in Physics), but for my undergraduate research assistant role, my job is to help the research group set up automated experimental controls. That includes learning: Python...- cryora
- Thread
- Lab Programming
- Replies: 6
- Forum: Computing and Technology
-
Should I Continue Taking Programming Classes?
Hey, guys. I'm in the 11th grade. The current class that I'm taking right now is called "Computer Programming 11" which is an intro to programming. The entire course is spent learning how to use Microsoft Visual Basic which kinda disappointed me because I originally signed up to learn Python...- AceTrainerBlue
- Thread
- Classes Programming
- Replies: 21
- Forum: STEM Academic Advising
-
Comp Sci Why Does My Fortran 95 Code for Calculating a Piecewise Function Fail?
Homework Statement . [/B]Hello all ! I am currently trying to make my fortran95 code run in vain.I would really appreciate it if someone could lend my a hand since I am a starter in programming.So the problem goes like that:Create a program capable of calculating the following function: f(x)=1/x...- NicolasPan
- Thread
- Code Fortran Programming
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
O
Bellman Equation, Dynamic Programming, state vs control
Hi, I am proficient in standard dynamic programming techniques. In the standard textbook reference, the state variable and the control variable are separate entities. However, I have seen examples in economics, in which a single variable, let's say consumption, is both a state variable and a...- onthetopo
- Thread
- Control Dynamic Dynamic programming Programming State
- Replies: 5
- Forum: General Math
-
S
What is the optimal solution for constrained nonlinear programming problems?
Homework Statement 1. Maximise ##x_1^2+(x_2-5)^2## subject to ##x_1 \geq 0, x_2 \geq 0## and ##2x_1+x_2 \leq 4##. 2. Minimise ##x_1^2+(x_2-5)^2## subject to ##x_1 \geq 0, x_2 \geq 0## and ##2x_1+x_2 \leq 4##. 3. Maximise ##2x_2^2-x_1## subject to ##x_1 \geq 0, x_2 \geq 0## and ##x_1^2+x_2^2...- squenshl
- Thread
- Nonlinear Programming
- Replies: 6
- Forum: Calculus and Beyond Homework Help
-
BS in ME, want to learn more programming
Hello everyone, First a little history: I have one more year left after this semester until I finally get my BS in Mechanical Engineering. My GPA is 3.7 right now and I've taken all expect 1 of the hardest classes, I predict that I will be somewhere around 3.8 to 3.9 by the time I graduate. But...- Feodalherren
- Thread
- Programming
- Replies: 5
- Forum: STEM Academic Advising
-
Avionics Programming Learning Materials?
I'm an aspiring aerospace engineer. I know that Ada is a language used in many planes today, but I can't find anything to learn about Ada for avionics--I couldn't find books or tutorials. Do any of you guys have any recommendations on how to go about this? I'm very interested in teaching myself...- RooksAndBooks
- Thread
- Aerospace engineering Airplanes Materials Programming
- Replies: 10
- Forum: STEM Academic Advising
-
A
AI Seed Programming: Questions & Answers for Nick Bostrom's Superintelligence
I read Nick Bostroms book "Superintelligence" but can't seem to find an answer to a question I have. I emailed Nick the following (though I'm sure he gets thousands of emails and will likely never respond): Firstly, thank you for the great read. :) My question is this: Why are you so certain...- Aaron8547
- Thread
- Ai Programming Seed
- Replies: 19
- Forum: Programming and Computer Science
-
MHB What is the Canonical Form of Linear Programming?
Hello! (Wave) A linear programming problem is in canonical form if it's of the following form: $$\pm \max (c_1 x_1+ \dots + c_n x_n) , c_1, \dots, c_n \in \mathbb{R} \\ Ax=b, A \in F^{m \times n}, x=\begin{bmatrix} x_1\\ \dots\\ \dots \\ x_n \end{bmatrix}, b=\begin{bmatrix} b_1\\ \dots\\...- evinda
- Thread
- Canonical form Form Linear Linear programming Programming
- Replies: 5
- Forum: Set Theory, Logic, Probability, Statistics
-
S
Nonlinear Programming and Consumer Preferences
Homework Statement Consider a consumer with wealth ##w## who consumes two goods, which we shall call goods ##1## and ##2.## Let the amount of good ##\mathcal{l}## that the consumer consumes be ##x_{\mathcal{l}}## and the price of good ##\mathcal{l}## be ##p_{\mathcal{l}}##. Suppose that the...- squenshl
- Thread
- Nonlinear Programming
- Replies: 4
- Forum: Calculus and Beyond Homework Help
-
N
Java Understanding basics of computer programming
I am having some issues understanding the fundamentals of Java and OOP. In simplest terms possible with an example can you explain to me what an Object, Class and Method are? I am confused on what these actually are. Thank you- Niaboc67
- Thread
- Basics Computer Computer programming Java Oop Programming
- Replies: 17
- Forum: Programming and Computer Science
-
MHB What is the maximum of the given function in the closed square $D$?
Hello! (Wave) We consider the function $f(x_1,x_2)=x_1+x_2$ and the (closed) square $D$ with edges $(0,0), (1,0), (1,1), (0,1)$. Check if $f$ has a maximum in $D$ and if so, find the points of $D$ at which this maximum is achieved.$$\max_{(x_1,x_2) \in D} (x_1+x_2)$$...- evinda
- Thread
- Linear Linear programming Programming
- Replies: 8
- Forum: General Math
-
H
Help with spatial resolution conversion programming (bmp image)
[FONT=Arial]Hello guys. I want to ask something about simple spatial resolution manipulating just by using c language. I have done my programming below, it managed to be compiled but for some reasons the program stucked in the middle when I try to run it. Really hope you guys can help. I am...- hilman
- Thread
- Image Programming Resolution
- Replies: 5
- Forum: Programming and Computer Science
-
N
Comp Sci Java Error: "Type Mismatch" Explained
I am programming in Eclipse and I keep seeing the error " Type mismatch: cannot convert from int to String", not only in the example I am going to provide but other programs. I've just started programming in Java. Could someone explain to me what this error exactly means? publicclassPracOne{...- Niaboc67
- Thread
- Error Java Programming
- Replies: 6
- Forum: Engineering and Comp Sci Homework Help
-
A
C Programming - First assignment not sure how to approach
Homework Statement Hi, I am currently in a C programming course and i have no background knowledge of programming whatsoever. The professor in my course isn't very good at explaining so I'm a bit lost here. (Please keep in mind, I am NOT asking anyone to do this for me. I would like to know a...- Arnoldjavs3
- Thread
- Approach Assignment C programming Programming
- Replies: 10
- Forum: Engineering and Comp Sci Homework Help
-
D
Java Java Programming Boolean if-else statement
Looking for some assistance with this. I've been messing with this for hours and can't seem to get it right. Some assistance would be greatly appreciated. What I have below is not correct. Material in green cannot be changed. Thanks!Print "Balloon" if isBalloon is true and isRed is false. Print...- dellmac
- Thread
- Java Programming
- Replies: 2
- Forum: Programming and Computer Science
-
Python Piet programming (python programming language )
Where or how can I get Piet programming to to work on windows 10 I don't care how, only that I can program in Piet offline and NOT a trial. I have gone around the block and come so close to getting it, and then, something doesn't add up. The closest I have come to getting it to work is here...- Steven Ellet
- Thread
- Language Programming
- Replies: 18
- Forum: Programming and Computer Science
-
A
Need Help Pursuing Career in Robotics
Hello Everyone, I posted in Physics Forums back in 2011 trying to figure out what undergraduate Major to choose based off my interests. I had received very positive feedback then and am seeking more advice now that I am further along in my career. I am a recent undergrad graduate with a major...- Alma
- Thread
- Career Computer engineering Electrical engineering Electronics Electronics engineering Mechanical engineering Programming Robotics Robotics engineering
- Replies: 8
- Forum: STEM Career Guidance
-
Programming languages in atmospheric physics
I do know this is very vague and maybe a little bit dumb. But are there languages that are ,generally,used much more than others in atmospheric physics?Excluding meteorology. I put this thread in Academic Guidance because this question is translated to "What computer languages should I focus on...- LittleMrsMonkey
- Thread
- Atmospheric Atmospheric physics Physics Programming
- Replies: 2
- Forum: STEM Academic Advising
-
Android programming language to ios programming language?
I mean something like a translator ( a convertor , if you prefer ) for another platform , windows for example , to translate the codes of an android program that is written in java language to the ios language which is Xcode . That way , lots of apps that are unavailable for android or ios ...- Prof.gaming
- Thread
- Android Language Programming
- Replies: 11
- Forum: Programming and Computer Science
-
R
How should I go about learning electronics/computer hardware
Hi, I have been interested in electronics and computer hardware for some time now. I'm will be going to school for engineering/programming; however, until then, I would like to engage in a few side projects to gain some concrete experiences within this domain. Specifically, I kind of want to get...- Robit1769
- Thread
- Electronics Hardware Programming Robotics
- Replies: 2
- Forum: Electrical Engineering