What is Programming: Definition and 1000 Discussions
Computer programming is the process of designing and building an executable computer program to accomplish a specific computing result or to perform a specific task. Programming involves tasks such as: analysis, generating algorithms, profiling algorithms' accuracy and resource consumption, and the implementation of algorithms in a chosen programming language (commonly referred to as coding). The source code of a program is written in one or more languages that are intelligible to programmers, rather than machine code, which is directly executed by the central processing unit. The purpose of programming is to find a sequence of instructions that will automate the performance of a task (which can be as complex as an operating system) on a computer, often for solving a given problem. Proficient programming thus often requires expertise in several different subjects, including knowledge of the application domain, specialized algorithms, and formal logic.
Tasks accompanying and related to programming include: testing, debugging, source code maintenance, implementation of build systems, and management of derived artifacts, such as the machine code of computer programs. These might be considered part of the programming process, but often the term software development is used for this larger process with the term programming, implementation, or coding reserved for the actual writing of code. Software engineering combines engineering techniques with software development practices. Reverse engineering is a related process used by designers, analysts and programmers to understand and re-create/re-implement.
At work I am writing a somewhat complex piece of software, and inside it at some point I have to solve the following problem:
I have several "streams", each of which has equally spaced points according to a proportionality factor 'a', i.e. X=a*n. Each stream has a different 'a'.
As an example...
Homework Statement
Homework Equations
Recursion, graphs, DFS
The Attempt at a Solution
To try to solve this algorithm, I first need to find all the basic cycles in the Graph G. When I have these cycles, I can simply pick the smallest edge in each of them and add them to the set F, while...
I'm now at the second year of my MechE course. Until now, I've taken basic classes in physics, calculus, linear algebra and basic computer programming. I choose to undergraduate in Mechanical Engineering because I'm aware that it is a good and broad degree and it's a field that I like also.
It...
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...
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...
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...
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...
Hello! (Wave)Suppose that we have $M$ production stations $A_1, \dots, A_M$ of a product and $N$ destination stations $B_1, \dots, B_N$ of the product.
We suppose that $x_{ij}$ units of the product are transferred from $A_i$ to $B_j$ where $i=1, \dots, M, j=1, \dots, N$. The cost of...
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$$
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...
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...
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.
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...
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...
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...
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?
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...
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?
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...
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...
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...
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...
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?"
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 ?
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...
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
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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\\...
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...
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
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)$$...
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 extremely...
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{...
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...
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...
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...