ok so in this program, if three valid sides are given it displays the area of a triangle otherwise it will ask the user to re enter sides.
#include <iostream>
#include <cmath>
using namespace std;
int main(){
double a,b,c=0;
double s,A=0;
cin>>a>>b>>c;
cout<<"Enter three sides: "<<a<<"...
Hey! :o
I have to write a RAM program to accept all inputs of the form $1^n 2^{n^2} 0$.
The instructions of the RAM machine are the following:
I have done the following:
Read x from input
d=0, s=0
while x!=0
if x-1=0
d=d+1
else
s=s+1
Read x from...
Program should compute the power x^2
#include<iostream>
int main() {
double x;
int n;
double pow=1;
cout<<"Please enter x:";
cin>>x;
cout<<"Please enter n:";
cin>>n;
LOOP FOR X^N
pow=pow*x
cout<<"The result is: "<<pow<<endl;
return 0;
}
as you can see, there is no math library included and i...
Hey! :o
Write a RAM program of uniform-cost time complexity $O(\log n)$ to compute $n^n$.Prove that your program is correct.
(Under the uniform cost criterion each RAM instruction requires one unit of time.)
So that the time complexity is $O(\log n)$ the size of the problem should get divided...
Hey! :o
I am asked to write a RAM (Random Access Machines) program to compute $n!$ given input $n$.
Could you give me some hints how I could do that?? (Wondering)
Homework Statement
Write a C program to read values for times from the input file times.txt; compute sin(5*pi*t) for each time t given in times.txt; output comma separated values of t, sin(5*pi*t) into an output file named output.csv; and compile the program using a makefile. Hand in a copy of...
Hi everyone, so I was relooking into the external EEPROM problem I had earlier for the Arduino, and am thinking that I am missing even just a basic understanding of it. So I'm using this https://www.sparkfun.com/products/525 EEPROM which should have 256kbits of space.
I am hoping to save 4...
I am shocked that there are only a few schools which got their graduate engineering program accredited by ABET.
FYI, I used this website: http://main.abet.org/aps/Accreditedprogramsearch.aspx
For undergraduate programs, there are quite a few schools which have ABET accreditation.
For...
I will be graduating with a BA in physics and BS in Electrical Engineering in May. I want an optics PhD. I attended an info session on Sandia National Labs at my university, and the recruiters made me think about a PhD program through a national lab. If someone has experience with the National...
Hi :)
I need to program several nested 'for' loops which differs only in index of their variables inside.
So I need to convert this:
for i1 = 1000:-d:0
for i2 = (1000-(d*i1):-d:0
...
for in = (1000-(d*in-1):-d:0
some function containing all index variables like:
b=(i1*A( :,2), i2*A( :,3), ...
Recently, I have came across an interesting game that can be played fairly easily between two people. Here is how it is played: Both you and your opponent pick a four digit integer with no digit repetition. Then, you perform specific "guesses" so as to determine what their number is. A guess is...
Definitely looking to pursue graduate level theoretical physics in Quantum Mechanics.
Which undergrad program would be best? Mathematical Physics, General Physics, or Astrophysics?
Hi all, I have been curious about this for a while. I know that some schools do not accept a bachelors in engineering technology for into a Master's Program of Engineering. I was wondering if anybody could tell me if there are schools that do?
Thanks
Hi there
A while back I updated Ubuntu to version 14.04. Before this, I could connect to the machine through TightVNC from my Windows 8.1 laptop.
However after the upgrade things didn't run smoothly. It is now a known bug that usual VNC software can't connect to Ubuntu 14.04 because it uses...
I am trying to figure out why my program gives wrong results or not execute for big values. I am trying to compute how long before a bank account is depleted if it has an interest and 500 is withdrawn from it monthly. If I use 100000, it gives a value of 526years, which I think is wrong. And if...
Don't know where else in Phyiscs Forums or on the internet in general to ask this, and if it's inappropriate here, I apologize. My question is: is there an open source library or resource that I can access from a C++ program to perform symbolic computation on the level of something like Maple...
Hello,
what PCB Design program do you prefer? What's the reason for your choice?
I am freshman to PCB design and working on PADS from Mentor Graphics. But I have to admit it seems me a little bit unintuitive and I am unhappy with non-perfectly fitting transmission lines and prolonged editing...
... Continued from part 14.
The Sands of Duna
Part 15: Coming in fast
Collinsmark is not affiliated with Squad nor Kerbal Space Program
We are coming in fast. Really, really fast.
Might was well fold up the solar arrays. There's areobraking in the near future.
[Figure 122...
The Sands of Duna
<Intermission (1/2)>
An intermission of math.
Skip this post (and the next) if you are not interested in the math. But since you are reading this on Physics Forums after all, there's a good chance you are interested. If so, read on. :smile:
Collinsmark is not affiliated...
I remember someone telling me that it's impossible to create a program that determines whether a given program runs forever, and that this requires a rigorous and long proof. Well, I was thinking about that today and the proof should be trivial -- shouldn't it?
Proof. Let P be the set of all...
Hello, I am wanting to write a math/physics book or possibly a PDF online book and I'm wondering if anyone knows of any programs that exists for making pictures and drawing diagrams.
I not just looking for something to make x-y graphs or 3-D graphs, I'm looking for something that designed...
Hi people,
This is the first time I am writing a letter to a professor about my enrollment into their MS program. i have already completed a draft with my cgpa, current thesis, research interest etc.
Now do I write the whole detail in the body of the email or i make a doc file and attach it...
... Continued from Part 4.
The Sands of Duna
Part 5: On your mark, get set, ...
Now that we're in a low, roughly circular, Kerbin orbit, we need to find the position within that orbit that we will choose for are upcoming periapsis. We need to find the place in that orbit that we will...
... Continued from part 3.
The Sands of Duna
Part 4: We have ignition
The author of this post (and story), collinsmark, is not affiliated with Squad nor Kerbal Space Program.
We've waited long enough. So let's get this ship out the launch pad.
Kerbals chosen for this mission are
Melmon...
I forget where I saw this I think it was the Halo series with the Cortana AI but basically a program used a human brain for processing information and running itself. Would it be possible to have a program running on a human brain? Would the principle be similer to IBMs' TrueNorth chip...
So, I started trying to learn how to code a few weeks ago. I'm trying to currently learn HTML + CSS right now through Code Academy, but I am having trouble actually understanding the material and the purpose of some of the functions. I was hoping to get this product off of Amazon...
The Sands of Duna
Part 1: Introduction
So let's go to Duna! (Duna is Kerbal Space Program's [KSP's] analogue of Mars.) Here are some mission requirements that I set out for myself:
Mission requirements:
Bring two or three Kerbals to the surface of Duna and bring back all sorts of...
Homework Statement
In the previous few modules you studied the problem of minimizing ##\| Ax -b \|_{2}## by choice of ##x##. So
far you've done this in Matlab using either the backslash operator or the command pinv. Now
that you've been exposed to linear programming, you have the tools to solve...
The reason:
I live in a small waterside town and we are very concerned over our water table. The problem is that we don't have a lot,if any, research or organized data to back up important decisions. The problem is that no one is informed on what they're talking about, many regulations...
Homework Statement
Suppose you are given the following affine minimization problem.
\begin{align*} \underset{x \in \mathbb{R}^3} \min \hspace{0.1 in}&c^Tx+3c^Tc \\ &\text{subject to} \hspace{0.1 in} Ax \leq b \end{align*}
Which of the following is an equivalent linear minimization problem...
Homework Statement
To preface, I believe this question is equally applicable to either the math or engineering homework forum, but I am having more trouble with the math part than the actual programming. I can't do any programming (with the understanding that linear programming doesn't...
Hello,
Can anyone describe what its like going to University of Maryland college park and majoring in physics? Is it true that the teachers there only care about research and don't care about helping you? Also, are the class sizes 150 people (which means you can't get any personalized help)...
... Continued from part fifteen.
To the Mun!
Part sixteen: Home, sweet home
[Figure 234: Service module separation (1/2)]
[Figure 235: Service module separation (2/2)]
[Figure 236: Reentry (1/2)]
[Figure 237: Reentry (2/2)]
[Figure 238]
[Figure 239]...
Hi guys,
I was wondering whether atypical preparation is needed for admission to a mathematical physics program? i.e. Do you need to take Real Analysis, Topology, and other "rigorous" mathematics even if you are only a physics undergrad, or will such mathematics be taught from the ground up...
When I was a (very lonely) child, I used to play endlessly with this predator-prey simulation game:
http://www.leinweb.com/snackbar/wator/
(You may have trouble getting this applet to run based on java updates, other security settings and what not).
There is more information about it here...
I am 2nd year student transferring into computer engineering at a university in NC. I saw on the US News rankings that their engineering program was at the bottom of the rankings but still ranked nonetheless.
Their facilities are up-to-date. What exactly makes an engineering program good or...
Hi,
I got admit to RIT's http://www.rit.edu/programs/applied-and-computational-mathematics.(I am an international student).
The course Structure is as follows :
(with options either in : Discrete Math/ Dynamical systems/ scientific Computing)
First Year
MATH-611 Numerical Analysis 3...
The Little Rocket That Could
[Figure 1. Check this out.]
This post illustrates an example of KSP rocket design. The following are the rocket's design goals:
Get three kerbals and a bunch of science items to the Mun, in an Apollo style mission: such that two kerbals (and science) land on the...
This is my code:
double of = 0;
double from = 0;
double to = 0;
double ans = 0;
private void button1_Click(object sender, EventArgs e)
{
Table.Items.Clear();
if (double.TryParse(Of.Text, out of) == true &&...
Hello! As a new past time I wanted to learn some coding. A friend of mine wrote a program and explained it from A to Z to me, it took like 2 hours.
I wanted to play a bit with the program by modifying it.
Here's the code:
#include <stdlib.h>
#include <iostream>
#include <time.h>
using...
Efficient launch into orbit.
Designing a small, simple, efficient and stable launch vehicle to get into Kerbin's orbit can be done pretty easily. But in order to avoid building oversized, overcomplicated, drag prone behemoths (like the one I was using in the first post of this thread), one...
Homework Statement
Need a free program to plot expressions in polar coordinates. For example, I want to plot the equipotentials for an expression in polar coordinates of the potential for a dipole charge, 4q and -q separated by a distance L.
Homework Equations
V=kq(4/r1 - 1/r), where r12...
"How hard can rocket science be anyway?"
Kerbal Space Program is a sandbox type computer game that leans heavily on concepts of physics (don't let that scare you though, you don't need a calculator nor a book of equations to play it. It's ultimately very intuitive).
Given the physics nature of...
It's mainly designed for those who want to teach at a junior college or whatever. I plan to stay in oil and gas, and I'm going to take:
I'm not concerned about analysis, because I did well in undergrad and have a strong interest in it. However, I took Cal III in 2008, so I'm a bit rusty in it...
You people should open your eyes for the possible tsunami of new ideas coming from this meeting.
Here's the deal:
http://www.pctp.princeton.edu/pctp/Simplicity2014/Simplicity2014.html
And the program:
http://www.pctp.princeton.edu/pctp/Simplicity2014/Program-Simplicity-web.pdf
Here's what I have so far:
std::string CalculusWizard::derivative(std::string& fx, const char & x, unsigned & n = 1)
{
if (n == 0)
{
return fx;
}
else if (n > 1)
{
while (n-- > 1)
fx = derivative(fx, x);
}
// If here, find and return the derivative of fx ...