49,757 Topics

Member Avatar for
Member Avatar for Njay19

#include <iostream> using namespace std; int main() { const int n = 20; int Array[n] = { 3, 5, 2, 9, 6, 12, 16, 11, 18, 4, 14, 8, 1, 15, 17, 7, 19, 13, 20, 10 }; cout << "Not sorted: \n"; for (int i = 0; i < …

Member Avatar for Njay19
0
137
Member Avatar for Kenneth_3

I am in my first semester of computer program and this my third project. I am taking this class online so I do not have the in-class benefit of working with others. I have completed all of the code and the program works the way I believe it should. I …

Member Avatar for Schol-R-LEA
0
245
Member Avatar for Simil

Guys can anyone please explain to me the working of this function { "randamise()" }.

Member Avatar for misi
0
224
Member Avatar for Thomas_25

Hi all, can i store multiple data items inside a doubly linked list? is this valid? struct node { int marks; int regno; struct node *next; struct node *prev; }*start; If this is valid, how can i assign values to the individual data items? next->marks=5; next->regno=3456; will this work?

Member Avatar for Thomas_25
0
405
Member Avatar for Thomas_25

Hi all, I need help understanding a C++ problem. This is an assignment question. Create a base class ‘Account’ and two derived classes ‘Savings’ and‘Checking’. The ‘Savings’ and ‘Checkings’ information should be connected to each other using variable CREDITRATING. Transactions in any of those derived classes should be able to …

Member Avatar for Thomas_25
0
132
Member Avatar for Kenneth_3

Hello, I am writting a code for class and I am having a hard time inserting my variables into my "cout". I know how to do it the long way but I know it has to be easier. Right know this is the portions I am working on: void displaySlpInt …

Member Avatar for Kenneth_3
0
240
Member Avatar for RKVP

Hello. I need help with my assignment urgently. This is my assignment question and the follwoing is my code. It compiles but it doesnt give me the right output. 1. Run length encoding. Example: if the input is “AAABBCCCDEEFFA” the output will be “A3B2C3DE2F2A” 1. Input takes the form of …

Member Avatar for rubberman
0
654
Member Avatar for selam kassu
Member Avatar for deceptikon
-1
122
Member Avatar for rose_2

say we have array[6] .. i want to ask user to enter 6 values to the array and if there is any repeated value the program will cout them .. which operation that i can use ? i thought about switch statement or if else condition and i have to …

Member Avatar for Schol-R-LEA
0
158
Member Avatar for gencc

who can help me on solvin this problem in c++ by not using math.h only a function; problem:x^n

Member Avatar for Schol-R-LEA
-1
124
Member Avatar for Dragos_1

#include <iostream> #include <fstream> #include <cstring> using namespace std; int va[20][2],i,j,iesire,intrare,st[21],as,ev,k=2,timp,mint=10000,d=0,t=0; float distanta,mind=10000; char comune[65][25]; struct intr { int t; float d; }v[65][65]; void init(int k,int st[21]) { st[k]=0; } void succesor(int k,int &as,int st[21]) { if(st[k]<65&&k<20) { st[k]++; as=1; } else { as=0; } } void valid(int k,int &ev,intr …

Member Avatar for Schol-R-LEA
0
748
Member Avatar for geolotry

Hi all I have been struggling with this program for quite awhile. I can't seem to get the PRINTFREE and PRINTMATCH commands to work right. I seen a similar problem on here but I am still grasping at straws. Any help would be greatly appreciated. Here is the scenario for …

Member Avatar for Christopher_11
0
331
Member Avatar for Saeed_3

consider a vector R whose coordinates xyz are given by R1,R2 AND R3.the length of the vector R is calculated as R len=squareroot of R1Squared+R2squared+R3squared.write a c++ program to prompt the user for the vector coordinates values and calculate and display the vector R length.please help me with the code …

Member Avatar for Schol-R-LEA
0
367
Member Avatar for terriblecoder

Hi so I am suppose to write/fix this code up so it produces a monthly bill for a store. This is what I have so far. I know its suppose to have functions but im just doing it first this way because i find it easier.I think theres something wrong …

Member Avatar for Schol-R-LEA
0
289
Member Avatar for Benny Adams

Can someone explain polymorphsm to me? Or upload a program that include polymorphm. Need some examples. Thanku

Member Avatar for DaveAmour
0
97
Member Avatar for furalise

Hi again everybody. I know there are some references to this kind of thing around the web but none of them are simple enough for me to understand. In my code below, I am trying to initialize a function pointer with a class member function but I'm not sure I …

Member Avatar for furalise
0
493
Member Avatar for Sana_5
Member Avatar for Talha_6

Write a program in c++ that allows the user to enter amount in dollars and converts its value into PKR and vice versa.

Member Avatar for Schol-R-LEA
-2
637
Member Avatar for cambalinho

why WS_CLIPCHILDREN style don't let the child control been clear? the WS_CLIPCHILDREN style avoid the flickers. but don't let clear the control :( why i can't clear the control(before WM_PAINT message)?

0
70
Member Avatar for Gurjit_1

I know many if us are laughing seeing this question , but if i have taken some floating point value and I want if the result is integer it should have some decimal point answer eg - 1 can be integer number I want 1.0 to appear in my result. …

Member Avatar for DavidB
0
391
Member Avatar for Mayukh_1

**Okay this is my first post and I am quite excited that how it will be recieved by the community. I have a long experience in C++ programming but never been a part of any community hence I believe that as a tyro, my mistakes will be ignored.** This post …

Member Avatar for NathanOliver
0
307
Member Avatar for Basit_2

Which Sub Directory Save Source Code Of A File And How Many Files Are Created After Compilling? Answer Me Plz, With Details.

Member Avatar for misi
0
199
Member Avatar for cblue

I was wondering if anyone can give me an idea on how i can modify this function to check for duplicates, if it contains a duplicate, since duplicates are not aloowed, output a message. Any help would greatly be appreciated. [code]template<class Type> void orderedLinkedListType<Type>::insertNode(const Type& newItem) { nodeType<Type> *current; //pointer …

Member Avatar for drussell024
0
3K
Member Avatar for VengefulToast

Hello, I am wondering how I would access an element on a List? Is it something to do with the iterator? list<Element*> _children; _children.push_back(child); _children.push_back(child); For example, how would I access the "children" of this list? Thank you.

Member Avatar for VengefulToast
0
121
Member Avatar for Mubsahir Ijaz

Write a program that declares an array of 20 doubles and reads the values from the user. Now your program should compute the average of these numbers and then tell for each number whether it is above, below or equal to the average

Member Avatar for misi
0
185
Member Avatar for New Jack

My project is seperated into two files(a head file and a implementation file). But when i run the codes it comes the errors as follows: // my codes are as follows: //first file (first_homework.cpp) // //second file(first_homgwork.h.cpp) ![second_file.png](/attachments/small/4/6ca3bf23448c644fcb97b2f9d86316eb.png "align-left") I will appreciate it if anyone can be capable to give …

Member Avatar for New Jack
0
257
Member Avatar for HuePig

Hi, I have an `unsigned char c[16]` and I need to read 2 char at a time and put those in an index. Heres what I have so far. std::istream& function(std::istream& aIStream){ for (int i = 0; i < fSize; i++) { //this is not working.. // I tried static_cast<char*> …

Member Avatar for マーズ maazu
0
246
Member Avatar for Tycellent

Hey everyone, I'm trying to convert some values to ASCII characters. I understand that this is possible through means of something like this: std::cout << (char)0x31 << std::endl; // prints 1 std::cout << (char)0x4C << std::endl; // prints L However, my problem is that i have char array that contains …

Member Avatar for マーズ maazu
0
292
Member Avatar for AQ

Hey guys i need some help.. Here is my code given below + the question statement.. The problem is simple i just wanted to ask what and how i can use variable to calculate average in array questions.. Problem Statement: "Write a program that declares an array of 25 integers …

Member Avatar for AQ
0
231
Member Avatar for CodeWarrior14

I'm writing a program tha calculates linear regression, one of the values that are generated is the r (linear correlation coefficient) value. However, my algorithm doesnt work. I implemented the r value from the formula located at [Click Here](http://mathbits.com/MathBits/TISection/Statistics2/correlation.htm) Here is my code: long double LinearRegression::calculate_r() { long double r; …

Member Avatar for CodeWarrior14
0
381

The End.