coding

  1. Sunwoo Bae

    Comp Sci Python Assertion Error Help

    I would like to make output only read: Traceback (most recent call last): AssertionError ... without giving the File "<input>", line 1, in <module>
  2. Monsterboy

    Comp Sci Counting valleys problem

    // Complete the countingValleys function below. // The code is in javaScript function countingValleys(n, s) { let currentLevel = [] // an array of numbers that indicate the number of units of altitude above or below sea level regarding each step let altitude = 0 // the...
  3. antoniacarol

    Python Python Coding-While Loops

    Please help! I am trying to create a Python program for an assignment that will convert Celsius to Fahrenheit and vice versa depending on the input from the user. The numeric conversion portion of the code is working, however, if the user inputs "exit" the while loop is supposed to terminate...
  4. P

    Understanding the Miller code

    Hello, I have some questions about the Miller Code. So I googled something and found some helpful pictures. See, for example, Figure 1: My first question on picture 1 is, why is 0 set to high in the first signal (I marked this with a red question mark)? With the second signal in the first...
  5. Sunwoo Bae

    Comp Sci Python: printing every other input using a for loop

    I want my output to read only the integers. Here's my attempt: number = int(input()) for i in range(2, number+1, 2): print(input())
  6. J

    Comp Sci C++ program to read an input file with multiple headers

    Homework Statement Write a program that can read an input file with a simple header. The Attempt at a Solution #include <iostream> #include <fstream> using namespace std; int main() { ifstream inFile; inFile.open("Data"); //Check for error if (inFile.fail()) {...
  7. C

    Finding the minimum number of boxes to pack products

    Homework Statement This was a coding challenge, and I've already completed it. But I feel there must be a better solution to my approach at the moment. Especially maybe there's a mathematical approach. You have 3 sizes of boxes, small, medium, large: small: holds 3 items medium: holds 5 items...
  8. G

    Chemistry 35yo combustion chemistry PhD, free time and still no plan

    Hi there, TL/DR - I have a community college job with a sufficient salary. Should I be happy with that + freetime or should I try to get a job which really uses my PhD? If I go with happy freetime option, are any of the projects I propose interesting AND feasible? If I am too lazy to follow...
  9. R

    Comp Sci Velocity Verlet applied to solar system with C++

    Homework Statement Hello, I am attempting to use the velocity Verlet algorithm of integration applied to the solar system in c++. My goal is be able to use the outputted position components in a plot to see if the trajectory of my object is elliptical/parabolic/hyperbolic resulting from the...
  10. P

    Physics Transitioning from teaching to Data science

    Hi all! First of all I am sorry about (grammatical ,etc) mistakes that I maybe do but english is not my first language. I am physics teacher in Greece holding a B.Sc. in Physics and a M.Sc. in Physics teaching. After 3 years of professional teaching I would like to start working in another...
  11. ramzerimar

    Engineering MechE working with software?

    I'm at the third year of my MechE course, and in those three years I've developed a keen interest in software/coding. I still like my degree, things like fluid dynamics/aerodynamics fascinate me, but more and more I see myself working with software and coding. One of the things that I like about...
  12. The_Inventor

    C/++/# Creating a simple password program in C++

    So I'm trying to teach myself C++ programming and I'm having trouble writing a password program. Essentially I want to program to ask the user to input a password, and then compare that input with the correct password. If the user input matches the password I want the program to output a message...
  13. doktorwho

    C/++/# How to dynamically allocate an array of strings

    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...
  14. jedishrfu

    Insights The Joy of Processing - Comments

    jedishrfu submitted a new PF Insights post The Joy of Processing Continue reading the Original PF Insights Post.
  15. doktorwho

    Help with my C code

    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...
  16. doktorwho

    C/++/# TeamTreeHouse, to enroll or not to enroll

    For a beginner in programming with some prior experience and the one eager to get started in c would you recommend?
  17. S

    Comp Sci Python ATM script using OOP

    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...
  18. I

    Genes coding for cells?

    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...
  19. G

    Studying How to Learn Programming?

    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...
  20. ramzerimar

    Engineering Do Control and Automation Engineers ever code?

    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...
  21. B

    How to code the expression with least roundoff error

    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...
  22. Domenico94

    Machine learning or algorithm design

    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...
  23. pie

    I don't get the purpose of programming

    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...
  24. J

    Fortran Fortran 90 Error Please help

    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...
  25. Alexi-dono

    Python [python] How can I get my OS to pick this up as entropy?

    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)...
  26. I

    MATLAB Line following Matlab Code. How to Start?

    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...
  27. G

    Implementing strcpy without <string.h>

    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...
Top