49,757 Topics

Member Avatar for
Member Avatar for Kenneth_3

I am trying to compile the following code and I keep getting a reference error for my output file through a function. The purpose of the program is to read a file, sort through arrays, and output into a certain form. I am sure it is something small, but I …

Member Avatar for Kenneth_3
0
164
Member Avatar for Amoula_1

Hi I need a program that open a file.txt and read the content .. please help, i think the function is FileRead but i don't know how to uses it , please THank you

Member Avatar for Moschops
0
59
Member Avatar for CSprogA

basicly my project is making a shopping list which allow the user to: - type 1 to add a new shopping list - type 2 to add an item on existing shopping list - type 3 to check certain items in a certain list as bought - type 4 to …

Member Avatar for Schol-R-LEA
0
9K
Member Avatar for markdean1989

Hi, my question is very simple. Like the title says; How to declare an object? I have this declaration in my program; Class_name Object_name; and it is giving me an error, saying "Expected a ';' before "Object_name" And this is driving me nuts because putting a ';' before the object …

Member Avatar for deceptikon
0
375
Member Avatar for Erica_2

So i am back again, working with arrays this time. I can get it to run in the main but i am not sure how to make this code into a void function . #include <iostream> #include <iomanip> #include <string> using namespace std; int main () { // Declare variables …

Member Avatar for Erica_2
0
586
Member Avatar for complete

I have a silverlight app that uses TextBox XAML controls. In the c++ code-behind, IXRTextBoxPtr types are associated with these textboxes using "FindName" like this: FindName(L"ColNum3", &m_pColNum3); (where ColNum3 corresponds with the XAML CODE like this: ) Then, the code assigns the pointer like this: std::wstring wsTransfer; // gets the …

Member Avatar for complete
0
866
Member Avatar for markdean1989

I have an issue with the random generator. I use the code; myNumber = rand() % 100; //for numbers 1 - 100; My problem is, the numbers getting generated have a pattern. Such that the first output is 33, 43, 62, 29, 0, 8 ... Why is this so? I …

Member Avatar for rubberman
0
633
Member Avatar for eng.basil

write aprogram in c++ using for loop to calculate the max number and min number and make the avg >>in output screen?

Member Avatar for ddanbe
-1
80
Member Avatar for Abdul_32

i have this two dimensional array float grades size [30] [10]; my question is how to address a number for example 2 in the first row first column?

Member Avatar for ddanbe
0
64
Member Avatar for Fernando_7

Hey guys I need a push in the right direction im confused on how to iterate through this string "feeenhpoorilumayngtumseatsdmepotositnsfrlerruepsrennurdaorantiedbeunrtioradarahe" frontwords and backwards a push in the right would be pleasent if anyone can help

Member Avatar for Petcheco
0
105
Member Avatar for cypherscouter13

I have the following code int main() { compute(); return 0; } void compute() { double Ptr; vector <double> Vector; for (int u=0; u<N; u++) { computeFor(u, Vector, Ptr); Vector.push_back(EnergyPtr); } } void computeFor(int i, vector<double> &List, int u, vector<double> &Vector, double &Ptr) { int Num = List.size(); int pos[2][Num]; …

Member Avatar for rubberman
0
320
Member Avatar for hadisur_rahman

*****Describe the output in step by step with details>>>> #include<iostream> using namespace std; class A { int x,y; public: A(){x=10;y=10;} A(int a,int b){x=b;y=a;} ~A() {cout<<"X="<<x<<","; cout<<"Y="<<y<<endl; } }; int main() { cout<<"Start main\n"; A point1(50,20); A point2; A point3(40,30); cout<<"End Main\n"; return 0; }

Member Avatar for rubberman
0
159
Member Avatar for Ana_4

Create a program that calculates and displays the average price stored in the file. Display the average with a dollar sign and two decimal places.

Member Avatar for rubberman
-3
68
Member Avatar for Asira18

Hi guys am writing a program for a restuarnt and its about their menu. am in need of corrections,ideas and anything that will make the program excellent thanks..below is the code. #include <cstdlib> #include <iostream> #include <cstring> using namespace std; int main(int argc, char *argv[]) { int num1,num2,num3,num4,num5,num6; cout<< "WELCOME …

Member Avatar for Asira18
0
226
Member Avatar for tgreiner

I am reading a data set where each data line contains a value that I want to read over and then ignore. So, I create three variables as: int number1, number3; float number2; and read them in. I use the data in number1 and number3, but never use number2 (other …

Member Avatar for rubberman
0
4K
Member Avatar for My_1

I know the following sound a homework problem but it not it a study guild I to study but i am stuck. I really need help. I dont want to fail the test tomorrow The following C code defines Fibonacci function int fib (int n) { if (n == 0) …

Member Avatar for My_1
0
337
Member Avatar for ramonlarodo

What I am trying to do is each thread gets to print out its 5 characters before potentially yielding to another thread. It works but it does not do what I want. THanks for help. for (unsigned i = 0; i < _repCount; ++i) { unique_lock<mutex> lck(mtx); cv.wait(lck, []{return !inUse; …

Member Avatar for Moschops
0
118
Member Avatar for James_44

I can't figure out how to get my functions to work. I have to use void functions but I'm lost. I have to bring data in. An array of numbers. 8 27 33 14 81 146 305 249 412 71 226 4 144 55 97 493 133 265 788 240 …

Member Avatar for tinstaafl
0
205
Member Avatar for hadisur_rahman

#include<iostream> using namespace std; class B { int a; public: int b; void get_ab(); int get_a(); void show_a(); }; class D :public B { int c; public: void mul(); void display(); }; void B::get_ab() { a=5;b=10; } int B::get_a() { return a; } void B::show_a() { cout<<"a="<<a<<"\n"; } void D::mul() …

Member Avatar for Hassan_12
0
251
Member Avatar for m andrew
Member Avatar for Hassan_12
0
246
Member Avatar for Petcheco

Hello, guys. I've wrote the following code #include <iostream> #include <string.h> #include <string> #include <locale> #include <stdio.h> #include <stdlib.h> #include <limits> #include <vector> #include <windows.h> using namespace std; string Numero_de_Matricula = ""; string Nome = ""; int Numero_de_Materias = 0; int Numero_de_Creditos = 0; vector<double> creditos (10); vector<double> Coeficientes(10); double …

Member Avatar for Petcheco
0
131
Member Avatar for snippo

Develop a Shipping Information System to help the management of the company to manage the shipments for all the customers Implementation: Once the user runs the program, the menu shown below should appear: 1. ADD NEW CUSTOMER. 2. ADD NEW DESTINATION. 3. ADD NEW SHIPMENT. 4. EDIT EXISTING SHIPMENT. 5. …

Member Avatar for rubberman
-2
114
Member Avatar for Petcheco

Hello, guys. I wrote the code to a Quadratic Equations Solver and I'd like for you to run the program and read the source code and give me tips on what I can improve, what is good and what is bad, suggestions, etc. . #include <iostream> #include <locale.h> #include <math.h> …

Member Avatar for Petcheco
0
276
Member Avatar for Rafael_4

**this is what it should look like, a while loop that repeatedly reads goals,assists, stops when a negative is entered. at the end it calcuates sum, average. donot know how to calcuate sum or average if i dont know how many times the user will enter.** Enter a number of …

Member Avatar for DavidB
-1
234
Member Avatar for nikki_2

can you pls help me for this , " write a program that will accept 3 row and 1 column integer number compare the value of x,y,z.

Member Avatar for Schol-R-LEA
0
129
Member Avatar for Learner010

Yesterday i completed my exercises on loop , that's why today i've decided to create a tutorial on loop in c++. # Loop # loop allows us to repeat a statement or a group of statements. When we want to repeat a single statement then it is not necessary to …

Member Avatar for Markland
7
687
Member Avatar for Abdul_32

#include <iostream> using namespace std; float read_input() { float x[5],a, b ,c, d ,e ; cout<<"enter 5 numbers:"<<endl; for (int i=0; i<5; i++) { cin>>x[i]; } a=x[0]; b=x[1]; c=x[2]; d=x[3]; e=x[4]; cout<<"a="<<a<<endl; cout<<"b="<<b<<endl; cout<<"c="<<c<<endl; cout<<"d="<<d<<endl; cout<<"e="<<e<<endl; } float calculate_average() { int total=0 ,avg; { total += float read_input( a,b , …

Member Avatar for deceptikon
0
2K
Member Avatar for vjkmr

a + b - c * d If the types of a, b, c, and d are int, long int, float, and double respectively, then the type of the expression is:

Member Avatar for deceptikon
0
92
Member Avatar for it@61@sec

I have generated an image for my VU+ Solo2 after following the instructions on the following URL: http://blog.videgro.net/2013/05/how-to-compile-software-for-vu-plus/. This works OK if I use standard C-code (as in the example in the URL), but when I try to compile C++-code I get errors which seems to originate from using the …

Member Avatar for it@61@sec
0
2K
Member Avatar for tentrabyte

guys i need your help. so this is my strcpy program. i am ask to create a program that will defined function that will do the same strcpy function using pointers only. did i do it right or wrong? please help me #include<iostream> #include<string.h> using namespace std; int main() { …

Member Avatar for Moschops
0
229

The End.