49,761 Topics
| |
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 | |
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 … | |
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*> … | |
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 … | |
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 … | |
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; … | |
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++ | |
how can i make swapping for 2 variables in more than 2 ways ?? | |
**Bold Text Here** | |
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 … | |
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 … | |
#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; … | |
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 … | |
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: … | |
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 … | |
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() { … | |
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. … | |
# 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) … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
can someone give me some hint on how to use a array structure in a fuction?? Thank you | |
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() << … | |
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> | |
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 … |
The End.