49,761 Topics

Member Avatar for
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
294
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
412
Member Avatar for rose_2

how do i write function that accepts unlimited arguments? i know in java we write it in this way `funcName(int ...)` ..so what's the way to write it in C++

Member Avatar for rose_2
0
132
Member Avatar for rose_2
Member Avatar for rose_2
0
226
Member Avatar for soe win
Member Avatar for pspwxp fan

Hi Daniweb, My project was to create a basic shell. One of the features being if we enter a command and input a path to an executable, CreateProcess is invoked to start the process. This works fine enough for console applications: the process starts, runs, and then terminates, upon which …

Member Avatar for pspwxp fan
0
418
Member Avatar for Choy_1

Hello programmers out there! I have one question that I'm confused about it. Can anyone help me to solve it? Thanks in advance! Question : Write a c++ program that prompts users to enter a number. Have your program accept the number as an integer and display the integer immediately …

Member Avatar for Moschops
0
192
Member Avatar for samer.aboufakher.3

#include<iostream> using namespace std; class product { private: int code; char name[20]; double price; int instock; double soldperyear[12]; public: product(int,char[],double,int); void setproduct(int c , char n[],double p,int i) { setcode(c); setname(n); setprice(p); setinstock(i); } void peryear(int i) { for ( i=1;i<=12;i++) soldperyear[i]=0;} void setcode(int c) { if(c>=2500&&c<=2750) code=c; else code=2500; …

Member Avatar for Moschops
0
199
Member Avatar for nketia

3 Write a C++ expression for the following: a. Decrease A by the square root of the values assigned to B. b. Decrease the value of T by two third of the value assign to S less 8 c. Assign the average of A,B and C less twice the value …

Member Avatar for Schol-R-LEA
0
139
Member Avatar for VengefulToast

Hi, I have made a class and have an overloaded ostream operator method in it... However it tells me: "overloaded 'operator<<' must be a binary operator (has 3 parameters)." Can someone tell me how to fix this? Thank you! I have included some of my code: class Element { private: …

Member Avatar for Schol-R-LEA
0
475
Member Avatar for Syed Ammar

Q:Write a program that reads characters from the user until a * is entered. Your program displays the count of capital case letters, small case letters, vowels (capital or small) and digits. (Problem) when user enter input char more than 1 digit as(gggg*) then {cout<<"\nPlease Enter Input\n";} repeats 4 times …

Member Avatar for rubberman
0
196
Member Avatar for DS9596

When I run it, it prints out but the largest and lowest frequency's don't come out correctly? #include <ctime> #include <iostream> #include <iomanip> #include <array> using namespace std; void DisplayNum(int *x); void DisplayData(int *x); void FindMaxMin(int *x); struct NUM { int n; int freq; }; NUM ALL[10]; int main() { …

Member Avatar for tinstaafl
0
159
Member Avatar for miazara

Write a program that calculates how much a person would earn over a period of time if his or her salary is one ringgit the first day and two ringgit the second day, and continues to double each day. The program should ask the user for the number of days. …

Member Avatar for Schol-R-LEA
0
173
Member Avatar for Rimi_1

# Heading Here # Im Getting declaration syntax error in void func2 (intc, intd), need help fixing it, and im new to this so i have no idea whats going on.. #include <stdio.h> #include <conio.h> void func1 (int a, int b) void func2 (int c, int d) void main (void) …

Member Avatar for Moschops
0
582
Member Avatar for Genessis_1

Hi, I am new to google mock so sorry if you think this is an easy question. I am currently testing codes for a project. There are async calls and i am having a hard time checking the sequence of function calls. I cannot share the codes so I'll just …

0
255
Member Avatar for Mamed

Hello , I've been trying to figure out this code and determine what's causing the miscalculation on it. Everything seems right for calculation , I don't get why there is if else statement for output screen. This is just a practice question for myself. The High Fashion Department Store wants …

Member Avatar for Schol-R-LEA
0
521
Member Avatar for Marvin_2

Develop a program that prompts the user to enter two (2) numbers. The program will display the numbers based on these conditions; if the first number is less than the second number the program will perform a swap operation on these two numbers and display them, otherwise the program will …

Member Avatar for Marvin_2
-1
95
Member Avatar for zrd0808

This is a homework problem; however I just want some direction. I have to write a module graph.cpp that implements djikstra's algorithm. so far i am at the reading in module and am trying to make an array of structures. here is the code. [code=c] // Zachary Dain // CSCI …

Member Avatar for Schol-R-LEA
0
444
Member Avatar for Baba Ki
Member Avatar for iamthwee
-2
110
Member Avatar for Casey890

Okay I have an array but how do I make it descending? I have it able to print out 1, 2, 3 but would rather have it do 1 2 3. code below #include <iostream> //Initalize Iostream using namespace std; void printarray(int arg[], int length) { //Print array function for …

Member Avatar for Casey890
0
153
Member Avatar for AQ

Hey guys ..!! so today I was solving another problem involving a loop in it and i'm not sure exactly how to apply that condition to repeat it unless the terminating condition becomes true. I tried to do it on my own but its not working. can anyone of you …

Member Avatar for NathanOliver
0
248
Member Avatar for akane.mikazuki

This is supposed to be a Rock-Paper-Scissors game. Everything's just going fine until I inserted graphics. What I was supposed to do is to display the figures I've poorly made whenever a choice is made. I can't really explain it so please take a look at my code, thanks (I'm …

Member Avatar for Schol-R-LEA
0
339
Member Avatar for Bendez Thyna

can someone give me some hint on how to use a array structure in a fuction?? Thank you

Member Avatar for NathanOliver
0
107
Member Avatar for Reg74

Here's the question : /* 4. Modify your showTree() function so that it produces the same output as dumpObjectTree() . QObject::A Stack Object QObject::Mike QObject::Greg QObject::Peter QObject::Bobby QObject::Carol QObject::Marcia QObject::Jan QObject::Cindy */ This is what i have thus far ... if(!childlst.isEmpty()) foreach(Person* t,childlst) { cout << "QObject::" << t->parent()->objectName() << …

0
109
Member Avatar for m..abdullah4

I want to do a program of c++ for power or exponent finding and it looks very diffcult.I could not understand it.Plz anyone help in both method By using loops By using <math>

Member Avatar for NathanOliver
0
83
Member Avatar for pww71

Title: The core of the core of the big data solutions -- Map Author: pengwenwei Email: pww71@sina.com Language: c++ Platform: Windows, linux Technology: Perfect hash algorithm Level: Advanced Title: The core of the core of the big data solutions -- Map Author: pengwenwei Email: pww71@sina.com Language: c++ Platform: Windows, linux …

Member Avatar for mike_2000_17
0
255

The End.