I was supposed to write a program that has a while loop in which two people, person1 and person2 input a string. The program runs the loop until one of the people inputs "it's over". At that time the program should exit and print out the correspodance between these two people while they were in...
Homework Statement
I am fairly new to C programming. I need to write a code that creates an array of max 300 numbers, ask the user to input the numbers and then print that array.
Homework Equations
3. The Attempt at a Solution [/B]
Here is my code
#include <stdio.h>
void main() {
int...
Huffman coding (e.g. A -> 010) is fast but approximates probabilities with powers of 1/2, while e.g. symbol of probability 0.99 carries only ~0.014 bits of information. This inaccuracy was repaired by arithmetic coding, but it is an order magnitude slower (more costly).
Above compromise has been...
hello everyone,
I am a new member of this forum I found really good topics and good community that helps with many scientific fields. So I have this long text-based user interface for banking system written in python functions , but needs to be written using object oriented programming. I had...
I can't understand how this code was able to swap or get this output:
Based off of the following code what is the output of the main function?
void Swap(int& x, int y){
int temp = x;
x = y;
y = temp;
return;
}
int main(){
int a =12;
int b = 3;
Swap( b...
Hi Everyone,
I'm coding an circuit in arduino that reads a sensor to gauge a motors RPM.
I have the arduino reading the speed and blinking an LED. Now I need some way of taking that data
reading it for say half a second, perform calculations to double the count (to make it per minute)
send the...
I'll start off by saying that this isn't really a question about how to code, but about how you code personally. If there's a more appropriate forum for me to post in just let me know!
A little exposition: I'm an illustration/ISTA major doing a project for a class that requires interviewing...
Hows it going MHB. This is my first post and probably will not be my last. I am not going to come here just asking for answers, but to look for help in my coding adventure. I am currently enrolled into a entry level coding course that kind of just jumps right into things and does give some help...
i wanted to know how to become computer king of world if we have coding talent
like making cool apps,software,making technical software machines like robotics.
can we become computer king by challenging bill gates
like what they did to world
we can do in 1 day
not by copying but following...
I am prompted to: Assign the size of vector sensorReadings to currentSize.
Assigning is the double equal sign (==) but i get an extremely long error
i am given this much code:
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> sensorReadings(4);
int...
#mark contains personal comments and thoughts
# BTW this assignment was a beginner exercise at codeacademy intended to test the usage of if-structures
# I was wondering about whether or not if-structure was going to work, or if I needed a loop-structure becauses I wanted to interrogate the...
My understanding is that genes code for proteins that then do a certain function.
Apart from mitosis in an organism, I heard that cells (in forms of stem cells) are also produced and released into the body. I guess these would be all the floating around the body cells? Or the nerve cells that...
Simple geometry can compute the height of an object from the object's shadow length and shadow angle using the formula: tan(angleElevation) = treeHeight / shadowLength. Given the shadow length and angle of elevation, compute the tree height.
What I have so far:
import java.util.Scanner...
I am creating a website and wish to include a new integral sign that has an infinity sign over it but aligned with the same tilt angle as the integral. I'm using Mathjax to render the math code. I can code this in Latex outside an HTML file and it works perfectly but does require the graphicx...
I am a sophomore and I want to learn coding before I start college. I don't have much money and I need to know what resources I could use to learn a language. I have tried free online sites and apps but the abstract nature of the teaching and the lack of "real" coding makes me lose interest...
So I am completely new to coding. I told my advisor that I wanted to work with him despite my lack of experience so I can get some experience. He said yes, and in fact he is a very nice and helpful advisor. He does think I need to work faster, and I felt that way too but I don't know how to.
I...
hi,
I'm an electrical engineering student and have studied c programming. Everything I was doing however was just to familiarize myself with c and the language, therefore just executable programs that could create a database, or make an array or data to programs that aided me like a resistor...
From what I've seen, most engineers - outside software engineers - work with Matlab and spreadsheets like Excel. I don't know how to code in Matlab yet, so I'm not sure about how different it is from traditional programming languages like C/C++.
I'm more interested in Control Engineers - and...
The expression to code is: (z complex, m some positive integer)
z^m ( ln(z/(z-1)) - sum( 1/(k z^k), {k=1,m} ) )
The way I code is (in fortran) (in case z<2)
Z_1=1.0_q/Z
ZV1=LOG(Z/(Z-1))
ZK=1.0_q
DO K=1,M; ZK=ZK*Z_1
ZV1=ZV1-ZK/K
ENDDO
ZV1=ZV1/ZK
But it gives quite big error...
Hello, so I'm going into my second year of engineering and everything is swell. I plan to choose the systems option when it comes to that time. There's only one thing that has been giving me trouble, and it is the introductory c++ course, I cannot, for the life of me, code. I can't really stand...
Hi,
I have been wanting to do this for a while but not too sure how to go about it. I have the following geometric algebra
\lbrace\mathbf{e}_{i}\rbrace_{i=0}^{3} which satisfy the following relations: \mathbf{e}_{i}\mathbf{e}_{j}=-\mathbf{e}_{j}\mathbf{e}_{i} and...
The following incomplete program should compute a student's total course percentage based on scores on three items of different weights (%s):
20% Homeworks (out of 80 points)
30% Midterm exam (out of 40 points)
50% Final exam (out of 70 points)
Suggested (incremental) steps to finish the...
I have been doing research on entropy encoding for some time.. I found some interesting relationships between Arithmetic coding and other methods such as Huffman Coding. I made an article to explain them and am presenting here for review:
http://siara.cc/arithmetic_coding_new_approach/
I have...
I'm learning about source coding, and many of the books/resources I've read give examples of the source Xn being defined as a sequence of iid random variables. How about when the sequence is independent but belong to 2 distinct distributions (e.g. Px when Xi is odd, and Px' when Xi is even)...
I've been working an internship over the summer, and I ran into a very humorous coding error. Everyone at the office got a kick out of it, and I thought some forum members might laugh at it as well:
So painful!
It was not very funny fixing it though.
HI everyone. I was just wondering about a career in the IT (I study communication systems engineering, but I'm rather interested in coding, rather than Internet and communcation systems- related stuff). I wanted to ask you, given the advances that technology is making, which skills would be...
So I see all of this talk about how you everyone should know how to program, etc. However, I don't get the purpose of it. I have seen people saying that you know how to program so you can tell the computer what to do. But even then what is the benefit of that? Others said that with programming...
Hello, I've decided that I want to learn physics coding and such. But I have absolutely no coding experience whatsoever, what should I learn? I was told I should learn Maple/Matlab/Mathematica, do I start straight with these? If so, which one should I start with? Or should I start with something...
Hey guys, I'm pretty new and desperate. I been trying to compile this program for a while and keep jumping from error to error.
Currently I have the following error:
Error: Rank mismatch in argument 't' at (1) (scalar and rank-1)
I have checked that my arrays are correctly. I have checked that...
Homework Statement
Design a component that uses a 4-to-1 multiplexer to choose between one
of four different operations
to get the result from. Each of the operations and the multiplexer
should be behavioral design in their
own modules / files to be used in the overall component design as...
So I am going to be making some keys; and I want to make them more random... So I made this:
#I know that the code is pretty crude, but it works.
#P.S. it is an infinite loop, run at your own risk
import random
from random import randint
import string
import time
x=1
n=randint(5,90)...
Hello all. I've recently started on the path to coding/programming in preparation for my future (double) major, if all goes well.
However, as someone with virtually no coding/programming experience, I was wondering if some of you wiser people could give me any recommendations as to websites I...
So we're using NXT 2.0 and MATLAB to program a robot to follow a white line through a maze.
I'm using a light sensor, color sensor and an ultrasonic sensor in the process. Any programming/Coding ideas of how i should start?
This is the maze...
Hi everyone. I ran into a problem while trying to code the string function, strcpy, without the use of <string.h>. The function, strcpy, which I have to make myself is exactly the same as the strcpy in <string.h>.The question in my homework is:
Implement the my_strcpy(s1,s2) function that...
Homework Statement
does anyone know why C24 (the extended Golay Code) doesn't have any words of weight 20? I know that it only has words of weight 0,8,12,16, & 24, but why is 20 skipped here?
Homework Equations
I am asked to deduce this from the fact after I have shown that the code does...
Greetings in the name of Jah-gonaut, ladies and gents. I have a question. Is there a strictly algebraic way of coding the notion "whole number value of", specifically for an irrational number?
I know that one way of coding the notion "absolute value of" some number is taking the square root...
[Superdense coding](http://en.wikipedia.org/wiki/Superdense_coding) is a way to send 2 classical bits by sending only 1 qubit and 'consuming' a previously shared entangled qubit. (Normally you could only send 1 classical bit per qubit.)
My question is: why doesn't this work (or does it?) for...
I was forced into learning Java. I feel reasonably fluent in C++, so the main problem is with the differences between the way languages are designed.
There are no global variables in Java. However, I need one - or at least some equivalent. I have something like a database object that I want...
Lovely people of the forum,
If you take a look at http://www.lexilikes.com, you will see that the pictures in the main column (the post column) are quite small and what I'm trying to do is make the column wider so that I can fit larger, HD quality photos (if I put them in now they just get...
Hi all,
I am a graduate student of Nuclear Engineering studying fuel and cladding performance during different conditions in the reactor. I have access to FRAPTRAN/FRAPCON codes from frapcon.labworks.org.
Being a newbie, I am quite unfamiliar as to how it all works. So is it ok if I...
I am a math major, with several years of experience in the I.T. field. Mostly networking, technical support, server administration, etc. I have limited professional programming experience, though I can learn languages fairly quickly.
I took a class in cryptography and coding theory as...
I'm trying to make a neural network in python, but I'm having a lot of trouble. Specifically after I have the network set up, what weights to initially assign to each neuron's inputs, the threshold, and evolving the networks to do what you want.
Here is my neuron class.
class Neuron...
This is a more a question about rules/regulations than actual EE, but I figured this was still the best sub-forum.
We are about to start renovating a house, and we will have to change a few things in the central heating system.
One problem is that we somehow need to get a cable from the wiring...
Homework Statement
I have to design an experiment with 3 factors. One factor has to be quantitative with at least 3 levels. One Qualitative with at least 3 levels. And the last one can be either quant/qual with at least 2 levels.
My question is in regards to coding the variables. For example...