C++ Definition and 803 Threads
-
M
Comp Sci Calculating GPA with Loops in C++
Homework Statement I'm to write a program that calculates GPA using loops to allow numerous inputs and using Error checking to be sure that inputs are valid. I'm having trouble figuring out how to make my loop repeat if a the input is invalid. And I'm also having a little trouble with the...- MostlyHarmless
- Thread
- C++ Loops
- Replies: 6
- Forum: Engineering and Comp Sci Homework Help
-
J
C/C++ Jamin2112 attempts C++ solutions
Okay, in this thread I'm going to attempt some problems and I would appreciate it if the C++ purists could offer feedback. I Googled to get some ideas for problems. Here's a preview: Eliminate whitespace from a string Remove duplicate characters from a string (e.g. "AAA BBB" -> "A B")...- Jamin2112
- Thread
- C++
- Replies: 37
- Forum: Programming and Computer Science
-
M
Comp Sci Simple input output program C++
I have a homework assignment that requires me to write a program in c++ to calculate GPA. The assignment wants then input of the grade to be in terms of just A B C, etc.. I'm just having trouble assigning a number value to the user input ie when the user inputs an A for their grade, I need the...- MostlyHarmless
- Thread
- C++ Input Output Program
- Replies: 11
- Forum: Engineering and Comp Sci Homework Help
-
J
C/C++ Critique of C++ code for encoding and decoding text
These are some functions I'm using to encode and decode text. [FONT="Courier New"]bitstring returns a string of bits representing the ascii values of the characters in the string passed to the function. For example, passing in "Hi" changes it to "0100100001101001" since (int)'H'=72=01001000...- Jamin2112
- Thread
- C++ Code
- Replies: 11
- Forum: Programming and Computer Science
-
K
C/C++ How to Port a C++ Project into Android NDK?
Hello All, I know that this post is very old, but I have a similar question. I believe that it is very relevant and there should be copious material on the net, but I have been unable to find it. I am trying to port a C++ project into Android. My project uses NTL, GMP, and OpenSSL. I am...- knowLittle
- Thread
- Android C++ Project
- Replies: 1
- Forum: Programming and Computer Science
-
U
Comp Sci To write a C++ program to find the factorial of a number
Homework Statement To write a C++ program to find the factorial of the number input 'a'. Homework Equations the factorial evaluated is denoted as 'f' i is the counter The Attempt at a Solution Pls check if my program is correct...(here f is the value of factorial and a is the...- Urmi Roy
- Thread
- C++ Factorial Program
- Replies: 15
- Forum: Engineering and Comp Sci Homework Help
-
C
C/C++ Why am I getting a Permission denied error when compiling my c++ code?
Hi, I'm having a serious trouble when I compile my code : #include <iostream> using namespace std; int main() { string nom("x"); cout << "Vous avez quel age ?"; cin >> nom; cout << "Vous avez-vous donc" << nom << "ans?" ; return 0 ; } Here's the resume ; I click on compile&run...- chemistry1
- Thread
- C++
- Replies: 16
- Forum: Programming and Computer Science
-
2
Stick with C++ or learn something different?
Hi. I am finishing my last year in High School and I have a question about programming. For a year or two I had been taught Free Pascal but the last year (grade 12) we have been taught some C++. My C++ knowledge is not as wide as it could or probably should be but I am familiar with the basics...- 2sin54
- Thread
- C++
- Replies: 2
- Forum: STEM Academic Advising
-
C/C++ Solving C++ Array Issue in Matrix Program
Hello all, I'm not really a programmer at all, but I learned c++ for a while so I can do basic stuff. Having just finished my linear algebra class I suddenly had an urge to write myself a simple matrix solver. I knew it wouldn't be easy (especially because of my lack of skill) but I was...- Vorde
- Thread
- Array C++ Weird
- Replies: 15
- Forum: Programming and Computer Science
-
U
C/C++ Karnaugh Map C++ Simplification: 4 Var Output w/o Don't Care Terms
I need to make a karnaugh map for 4 variables(there is no need to involve don't care terms) which gives the output as the simplified function. There's no need to literally display the map itself I only need an algorithm that takes the input as min terms and displays the simplified output. Anyone...- uknowwho
- Thread
- C++
- Replies: 20
- Forum: Programming and Computer Science
-
E
C/C++ How to Pass a 2D Array in C and C++ for Numerical Computing
Hi I have this small doubt. i am not good in C . i like to bring i,j,pi values to subroutine and bring back Asi to main program. how to write ! Plz help.. #include <stdlib.h> #include <math.h> double A_operate(int i,int j) void main() { double Ai, pi[10][10],r[10][10]; int i,j,n,m; n=6...- eswarm21
- Thread
- 2d Array C++
- Replies: 16
- Forum: Programming and Computer Science
-
N
C/C++ How can I parallelize my C++ code to utilize multiple cores?
Hi I have written an extensive simulation in C++ and when I run it on my quad-core machine, only a single core is used (on Windows). This is because my code is not parallelized. I'm not familiar in any way with code running in parallel, except in Matlab where is happens almost...- Niles
- Thread
- C++ Code
- Replies: 2
- Forum: Programming and Computer Science
-
S
Comp Sci Help with C++ Strings: Create a Class Function to Return a String
I want to know, how to make a CLASS FUNCTION to return a STRING. For example, taken that all variables are declared correctly. string personType::get() const { return firstName + " " + lastName; }- SEGA
- Thread
- C++ Strings
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
A
C/C++ How to Handle an Infinite Loop in C/C++ Code?
Hello there! I typed this code and saved it as a .c file #include<stdio.h> #include<stdlib.h> #include<conio.h> int main() { int a; while(1) { if (kbhit()) { system("cls"); printf("%d...- Akshay_Anti
- Thread
- C++ C++ programming Code Programming
- Replies: 5
- Forum: Programming and Computer Science
-
T
C/C++ Help with Probabilities & C++ Programming
I am not sure how to assign probabilities to variables do you think you guys will be able to help me?- Tenshou
- Thread
- C++
- Replies: 9
- Forum: Programming and Computer Science
-
J
What are the Best Books for Learning C++ on Your Own?
I am currently in high school and doing a lot of self study. I plan on going into physics in university and I was thinking about learning code, or at least becoming familiar with it. I have decided on C++ and I was wondering what are the best books for learning it on one's own. I don't know if...- Jow
- Thread
- Books C++
- Replies: 12
- Forum: Science and Math Textbooks
-
T
Comp Sci Sorting array into ascending order in C++
Homework Statement a. Define an array with a maximum of 20 integers values, and fill the array with numbers input from the keyboard or assigned by the program. Then write a function named split() that reads the array and places all zeros or positive...- tri5
- Thread
- Array C++ Sorting
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
S
C/C++ What is the significance of this C++ code and what does it do?
Hey guys. I just want to see if I am indeed "seeing" the significance of the code that is to follow. I will follow it with a brief explanation of what I thought the code did. Thanks in advance. const int N = 15; bool table[N]; int i = 0; while (i < N) { table[i] = true...- sandy.bridge
- Thread
- C++ Code
- Replies: 3
- Forum: Programming and Computer Science
-
C/C++ How Can I Implement Big Int Functionality in C++ for Project Euler Problems?
Hi, I'm working my way through the project euler problems in c++ and I've got to one where you have to sum 100 numbers that are each 50 digits long to find the first 10 digits of the sum. Obviously I could solve it by summing each of the figits in turn then work with them to deal with...- trollcast
- Thread
- C++ Writing
- Replies: 9
- Forum: Programming and Computer Science
-
S
C/C++ Boolean array to identify prime numbers - C++
Hey guys, just looking for an explanation for the following algorithm. It is in my textbook, and there isn't really an explanation. I don't really see how the algorithm works, but I will add what I do know, and hopefully one of you can help. Thanks. //this initial declarations produces an...- sandy.bridge
- Thread
- Array C++ Numbers Prime Prime numbers
- Replies: 3
- Forum: Programming and Computer Science
-
B
Comp Sci Understanding C++ Linked List Code: Node Structure and Pointers Explained
Homework Statement Hello, just having a bit of trouble understanding this bit of code: typedef int Item; struct Node { Item data; Node* next; }; typedef Node* NodePtr NodePtr hdlist = NULL; Homework Equations None. The Attempt at a Solution I understand that...- bd411
- Thread
- C++ List
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
The C++ Programming Language by Bjarne Stroustrup
Author: Bjarne Stroustrup Title: The C++ Programming Language Amazon Link: https://www.amazon.com/dp/0201700735/?tag=pfamazon01-20 Prerequisities: Contents:- I like Serena
- Thread
- C++ C++ programming Language Programming
- Replies: 1
- Forum: Science and Math Textbooks
-
Numerical Recipes in C++ by Press e.a.
Author: William H. Press, Saul A. Teukolsky, William T. Vetterling, Brian P. Flannery Title: Numerical Recipes in C++: The Art of Scientific Computing Amazon Link: https://www.amazon.com/dp/0521431085/?tag=pfamazon01-20 Prerequisities: Contents:- I like Serena
- Thread
- C++ Numerical
- Replies: 2
- Forum: Science and Math Textbooks
-
A
C/C++ C++ Problem with accessing elements of a character
Hey guys, I'm having trouble with sampling data from a force/torque sensor. I'm using Serial Com to receive the readings from the sensor, which is stored in a character of with 45 individual elements. What I'm trying to do is to pick out pieces of these data and store them separately. I'm...- AppleBite
- Thread
- C++ Elements
- Replies: 7
- Forum: Programming and Computer Science
-
W
Comp Sci Scoring Blackjack in C++: Handling Aces in a Card Game Program
Homework Statement I am writing a program in c++ where it inputs card values from the user and stores it in a char type variable. valid inputs are numbers 1-9, t,k,q,j for ten, kind, queen, jack respectively and a for ace. after inputting all the values the program goes like this if (!(card1...- wahaj
- Thread
- C++
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help
-
W
Comp Sci Changing a double value to an integer value in c++
Homework Statement I'm making a program which will convert mph to minutes and seconds per mile. For example my program will take 6.5 mph and convert it to 9 minutes and 13.8 seconds per mile. But being new to programming I don't know how to convert a double value to an int value (I believe its...- wahaj
- Thread
- C++ Integer Value
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
W
Comp Sci Allowing the user to re run a program in c++
Homework Statement I am making mini programs where there some calculations going on and when all that is done my program is to ask the user if he wants to repeat the calculations or not. If he does then the program is to restart and if he doesn't then he can close the window by pressing the...- wahaj
- Thread
- C++ Program
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
A
C/C++ Two Body problem with RK4 in C++
I want to output an excel file with the results of the trajectories of a two body problem, with initial position and velocity. But my program is not compiling. Any suggestions/problems that you can see? #include <iostream> #include <vector> #include <fstream> using namespace std...- atsquishy
- Thread
- Body C++ Rk4 Two body problem
- Replies: 13
- Forum: Programming and Computer Science
-
M
C/C++ Jumping straight into C++ without programming knowledge
Hello, I was looking at an Introduction to C++ class I might be taking next semester Description: This course is an introduction to the basic principles of programming using C++ as the development tool. Topics include the structure and design of algorithms, input/output, branching...- member 392791
- Thread
- C++ Knowledge Programming
- Replies: 26
- Forum: Programming and Computer Science
-
W
Comp Sci Calculating Distance in C++: Troubleshooting Exponent Error
Homework Statement can some one tell me what I am doing wrong in this program. I am getting a error C2296: '^' : illegal, left operand has type 'double' error at line 10 where I do my distance calculations. I am using Microsoft Visual Studios 2008. Homework Equations The program...- wahaj
- Thread
- C++
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help
-
Comp Sci How to Use a While Loop with Arrays in C++?
Homework Statement Homework Equations The Attempt at a Solution #include <iostream> #include <cstdlib> using namespace std; using std::cout; int main() { int sum=0; int Array[] = {1,2,3,4,42,5,6}; // int Array[] = {42,1,2,3}; // int Array[] = {12,-10,42,10}; // int...- Biosyn
- Thread
- Arrays C++ Loop
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help
-
P
C/C++ Microsoft Visual Studio C++ error
Hello, I'm new to Microsoft Visual Studio and new to the C++ program. I just installed the program and I'm trying to write my first program. First error that I get is: ========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ========== Why is my project out-of-date? Second...- PaulaS
- Thread
- C++ Error Visual
- Replies: 10
- Forum: Programming and Computer Science
-
Comp Sci Master For Loops and If Statements with C++ Homework Help | GetCode.me
Homework Statement Hello, the problem is in this video. It is displayed near the end starting from 6:19 onward. It's titled "Extra Credit" Homework Equations For Loops and If Statements? The Attempt at a Solution Here is my attempt at the problem: http://www.getcode.me/3sr0mzy7rz1cgrfu- Biosyn
- Thread
- C++ Loop
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
Z
C++ or verilog or random process ?
C++ or verilog or random process ?? I'm currently in 3rd year of my undergrad in Electronics & Communication engg. For my 6th semester, I'm required to take 1 elective from the following- -Data Structures with C++ -Random Process -Digital System Design using Verilog -Analog & Mixed mode VLSI...- zaman999
- Thread
- C++ Process Random Random process
- Replies: 2
- Forum: STEM Academic Advising
-
C
C/C++ C++ modelling of axial turbocharger
HI, i am a student taking final year project in my university, my project title was C++ modelling of axial turbocharger, it was a counter-rotating turbocharger, can anyone help me to get some useful information to complete my project? thanks- chowchekkee
- Thread
- Axial C++ Modelling Turbocharger
- Replies: 15
- Forum: Programming and Computer Science
-
U
C/C++ Why is C++ so much harder than Java?
I'm into my second year now at uni and after learning Java for the past year, the course is now introducing us to C++. We're still doing java but now C++ aswell. I don't know if I'm the only one but C++ is sooooo much harder than java, today after just our second lesson we're being introduced...- uperkurk
- Thread
- C++
- Replies: 26
- Forum: Programming and Computer Science
-
A
Help! C++ Struggles: My First Programming Class
I am taking C++ this semester, and am not really good at it. It is my first programming class, and I kind of stink, though I am trying. I don't think I'm going to get a great grade, and it will bring down my average. I was thinking of dropping it, but then had a look at the class averages...most...- andryd9
- Thread
- C++ Class Programming
- Replies: 15
- Forum: STEM Academic Advising
-
N
Comp Sci Find primes using sieve of erasthothenes by way of bit arrays in C++
Hey. I have to create a program in C++ to calculate the number of prime numbers up to a specified number. I also have to print out the first and last 5, but I'll cross that bridge when I come to it. I can do this fine with integers, but we have to do it where each slot in an array represents...- necromanzer52
- Thread
- Arrays Bit C++ Primes
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
N
Comp Sci Finding circle zero-points with C++
Hi everyone! My primary question is below the problem. My problem: Circles The standard form of an equation for a circle is (x − h)2 + (y − k)2 = r2 where (h,k) represents the center of the circle and r is the radius. The y-value of the equation becomes zero at the point of intersection with...- noblepants
- Thread
- C++ Circle
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
O
C/C++ How to make my program switch commands at certain intervals/bounds in c++
I have a new problem where I have 2 formulas, and I need to tell my program that at certain intervals/parameters/bounds it needs to do one of the formulas and at other intervals it needs to do another one. To be more descriptive When ever my time=0 to time=(T/2) it should do formula 1, and...- odinx
- Thread
- C++ Program Switch
- Replies: 3
- Forum: Programming and Computer Science
-
O
C/C++ How to Solve Bisection C++ Problem for Calculating Volume
#include <iostream> #include <cstdlib> #include <cmath> using std::cout; using std::endl; using std::cin; int main() { double h,v,w,z,y; cout << "Enter the width, W: "; cin >> w; if (w<0) { cout << "Error: The Width must be strictly positive." << endl; return EXIT_FAILURE; }...- odinx
- Thread
- C++
- Replies: 10
- Forum: Programming and Computer Science
-
S
Comp Sci Solve Basic C++ Coding Challenges with Easy Steps
Basic C++ Coding? Assume that name and age have been declared suitably for storing names (like "Abdullah", "Alexandra" and "Zoe") and ages respectively. Write some code that reads in a name and an age and then prints the message "The age of NAME is AGE." where NAME and AGE are replaced by the...- SMA_01
- Thread
- C++ Coding
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
S
Comp Sci Understanding Newton's Method in C++
Homework Statement why the loop not looping ? Homework Equations fun1=x^3+4^2-x-1 fun2=3x^2+8x-1 The Attempt at a Solution #include "stdafx.h" #include<iostream> using namespace std; float fun1(float); float fun2(float); void main() { float a; cin>>a; if (fun2(a)>0)...- Sumaya
- Thread
- C++ Method Newton's method
- Replies: 8
- Forum: Engineering and Comp Sci Homework Help
-
S
Comp Sci Bisection Method for Finding Roots of x^3+4x^2-x-1 in C++
Homework Statement find the roots ( interval halving ) , I want to know how to make a condition statement that when fun3 be less than 0.001 and then loop will stop and i get the root .(here in my code i don't know why the loop doesn't work as it should .. Homework Equations the...- Sumaya
- Thread
- Bisection method C++ Method
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
E
C/C++ Storing Data From C++ Program to a file.
I am using a verlet algorithm in c++ to model the motion of a satellite, and want to output position and velocity data from each timestep so that I can then read it into MATLAB and plot graphs to see how well my model matches the 'real life' graphs. so far I have at the end of each iteration...- engineer_ja
- Thread
- C++ Data File Program
- Replies: 3
- Forum: Programming and Computer Science
-
J
Comp Sci Calculating Probabilities in C++
Homework Statement Working on a program that will calculate the results of a shootout between 3 people, each of whom have a different level of accuracy (one hits his mark 1/3 of the time, one hits his mark 1/2 of the time, one hits his mark 1/1 of the time). Homework Equations...- jhudson1
- Thread
- C++ Probabilities
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
K
C/C++ Debugging C++ Code to Read CSV File
I am trying to read from a csv file, the file looks like below: 1,2,3 4,5,6 7,8,9 0 I used getline(Input_file,size,',') but the problem with this is that it seems to see the numbers not separated by commas as one string., for the code below i was expecting the following output: 1...- khotsofalang
- Thread
- C++ Csv File Reading
- Replies: 2
- Forum: Programming and Computer Science
-
B
C/C++ What are some simple and free resources for a C++ compiler?
It's been years since I last programmed in C++ and I want to brush up on it over the next couple weeks. Problem is I have no idea what's out there that I could use for programming/debugging C++ programs; the compiler I used before came on a CD with the textbook, but now I'm completely on my own...- Bohrok
- Thread
- C++ Compiler
- Replies: 2
- Forum: Programming and Computer Science
-
K
Comp Sci Problem with getline in C++ programming
Homework Statement I am solving a problem in which I am reading numbers from cells in a csv file, I used getline to get strings from the csv file then converted the string to an integer... but the getline seemingly discards the last cell in the csv file Homework Equations this my C++...- khotsofalang
- Thread
- C++ C++ programming Programming
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
C/C++ Passing a VBA array to a C++ dll - Example Needed
Hi all, In the book "Financial Applications Using Excel add-in Development in C/C++" 2nd edition by Steve Dalton in Section 3.7.2 Passing arrays and ranges from Excel to VBA to C/C++ and in that section a description of how this can be done is given. No example of how to do this is given and...- CFDFEAGURU
- Thread
- Array C++ Example
- Replies: 3
- Forum: Programming and Computer Science