49,766 Topics
![]() | |
I got stuck :(. Can anyone tell me the **purpose** of this following code please? (Suggest descriptive names for the function and its parameters.) int mystery(int x, int y[], int z) { for (int i = 0; i < z; i++) { if (y[i] == x) return i; } return … | |
Hello everyone and thanks in advance for your help. I am relatively new to programming and I have decided to do a project to solidify what I have learned in school. Here's my problem... I want to create a combobox where, when you make a choice another combobox becomes visible … | |
Why does my checksum not work? I use it on my computer with ATI graphics and it works perfectly fine. When I switch to a computer with Intel graphics, it starts doing random values and they aren't the same. I switch back to my comp, the values are still the … | |
Hi. I have completed a program that plays a Zero Gravity Floating Connect Four. I.E. it can take checkers from the bottom, top, left, or right sides. It works, however, the win conditions do not seem to be working. I am not sure where the problem lies. #include <iostream> using … | |
Could some one point out what's wrong with the classes of this program? #include <iostream> using namespace std; class box { private: int height; int length; int width; public: box();//constructor int surface_area(); int volume(); void set_dim(int ,int, int); }; //implementation box::box(){ int height; int width; int length;} box::int surface_area(){ int … | |
I'm trying to come up with a small block of code that simply takes a character value that is input by the user and then use an "if" statement to determine what is excecuted depending on what is entered. I just started C++ this week and have no prior experience … | |
Hello, I'm just wondering whether or not, it is possible to get the vector Dimensions without them being set? Basically, I'm converting some matlab code and there's a function size(VECTOR) which get's the dimentions of the vector being passed. For example: #include <iostream> #include <vector> using namespace std; int main(int … | |
Hi, i am new on vb.net.i want to link two forms. a button on form 1 when clicked it opens form 2 but not in new windows but it replace form 1 on the same window. | |
Hi all, class A { public: A(); ~A(); } class B { public: B(); ~B(); private: A *a; ->declares a pointer to class A object A a; -> holds the class A object } Whats the difference between the 2 type of declaration of a class A instance? Are there … | |
I am trying to create a program that converts a fahrenheit number to a celsius number, and convert a celsius number to a fahrenheit number. It takes user input and decides which sub-program to run depending on which letter is entered. Once it decides this, it asks for the number … | |
Which is the best compiler for C++ development for latest versions of OS like the 64 bit windows? The DEV C++ compiler is a good option but I find it problematic for file handling. Visual C++ is also a good alternative but I couldnt find any command for compiling and … | |
I'm coding a encryption program where I need to generate random prime. I wrote this code for(i=3; i<10000000; i=i+2 ) { for(j=2; j <= sqrt(i); j++ ) { if(!(i%j)) break; } if (j>sqrt(i)) { cout<<i << " "; } } This tests a number till is square root. Its good … | |
I am currently in school for video game design. I plann to make a mmorpg and although I will be creating the company I plann to do much of the work involved. I have noticed lots of mmorpgs have bots running non stop flooding the game and making gameplay annoying … | |
Hi, Im stuck, Im trying to make a program that asks the user for a decimal number and then it converts it to a binary number. Im assuming I need a "remainder = string % 2" or something along these lines but Im not really sure where to start. anyhelp … | |
Hi guys, as you know we can get a value from array by giving an index: int x[10]; int i; for(i=0; i<10; i++) x[i]=i; print(x[1]); // output is: 1 but how can I change this code to this: int x[10]; int i; x['a']=0; x['b']=1; x['c']=2; . . . x['z']=23; print(x['c']); … | |
hello, i'm writing a code for non-preemptive shortest job first, everything is okay except to select the first process arrived in the queue. here is my code. #include<iostream> using namespace std; struct process{ int processId; int burstTime; int arrivalTime; }; int main(){ int numberOfProcesses; //number of process cout <<"please enter … | |
#include<iostream> #include<math.h> using namespace std; int main() { long int t,n; cin>>t; while(t--) { cout<<"abc"; } return 0; } i am getting run time error for t>10000. how to solve it. range of t>1000000 | |
**i have problem in setting an alarm program, when i write the code to set with the alarm with the system it did not goes through so what should i do to fix the problem. pls i need to fix it if you can send me the code i will … | |
How can I make my program generate random number between two given integers ? I use `srand ( time(NULL) );` `x = rand() % i;` to generate numbers modulo i. But I can't figure out how to generate between two numbers, suppose 1 and 3. | |
You are required to write a program in C that will simulate the game of blackjack between two players. The computer will not be a participant in the game but will only deal the cards to each player and provide them with one or more ‘‘hits’’ ,that is additional cards … | |
write a program to score "paper*rock*scissor"game.each two user type'P',R'or S, AND THE PROGRAM ANNOUNCES THE WINNER AS WELL AS THE BASIS FOR DETERMINING THE WINNER "paper covers rock","rocks break scissor",scisor cuts paper", or "nobody wins"be sure to allow the user to use lower as well as uper case letters. ![]() | |
i have made a queue using STL. the queue contains strings only. how to check for a particular string if it present in queue or not? | |
wriite a program which accept amount as int yotaeger and displaytotal number notes of birr.100,50,10,5 and 1. | |
Shall i create a cgi script with main function command line Argument ? If i can , How can i pass the data to this command line arguments ? And shall i pass Array of data from JavaScript to cgi-script which is created in c++. How many ways are available … | |
I keep getting "None of the 6 overloads could convert all arguments". I only get this problem in visual studio though. When I compile with g++ or codeblocks, it works perfectly fine. The code I'm calling my templates with is: `MemDeSerialize(ListOfItems, SerializedData, size_t(Data[2]));` The definitions: template<typename T> void MemDeSerialize(T& Destination, … | |
Given the trace program below. I basically need to store a 1 or a 0 to the corresponding `a[r[i]]` the problem is I need to be able to keep track of the index of vectors zero and one to check the last index that was used for each vector. For … | |
Does anyone know of a header file for windows with a function that enables the execution of code once every specified number of milliseconds, something that can be used like this: if ( delay(5) ){ // do something every 5 milliseconds } If it's in microseconds is even better. If … | |
Hello, I'm trying to read the header information of a .wav file and I'm kind of stuck. Basically, the header information is located at different offsets in the file. So for example: (0-4) = ChunkID (4-8) = ChunkSize (8-12) = Format .. .. .. .. .. .. From this: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ … | |
Write a program which accept days as integer and display total number of years,months and days in it? ex. If user input as 856 days the output should be 2 years 4 monthes 6 days. | |
1) write a program that reads a positive integer k,and output is propr divisors. ex. k=28,the proper divisor ar 1 2 4 7 14 28. |
The End.