49,761 Topics
| |
So the task is relatively simple; create a program that will generate a random number, and then prompt the user to input a number. If the is lower or greater than the generated number, a message will display whether you're lower or higher than the number. The program also records … | |
can someone help me, my code won't compile. #include <iostream> #include <string> using namespace std; int main() { int hi, lo, mid; bool found; char status, reply; do { cout << "Think of a number between 0 and 1000" << endl; cout << " Write it down, I will guess … | |
I would like to see how the solution 3.16 looks after it's all done. I've tried to run my program, but it won't run. Can someone please forward what it should look like before I run the program. I must be missing something...? | |
I'm in an introductory CS course and our task is to build the best ideal boggle board (one that would get you the most points). We are allowed to use arrays, c-strings, and reference parameters (no structs/pointers since we are just starting to learn about those). Step one: I built … | |
c++ program that uses the class bookType and tests various operations on the objects of the class bookType. Declare an array of 50 components of type bookType. Some of the operations that you perform are to search for a book by its title, search by ISBN and update the number … | |
Hi Daniweb, I've have an assignment which is to modified the cpp script for ns2 simulation. I need to modify it so that the size is multiply by 2 over 10 interval and change back to the original size after 10 interval. I've changed the code in the modified field, … | |
I need a program that will ask 16 true or false questions. The game needs to keep going until the user either answers 8 questions correctly or 8 inncorectly. A message should inform the user wether they won or lost and ask if they would like to play again, at … | |
I am doing Project Euler Problem 3, but I seem to get stuck. I have written some code that makes sense (at least to me) but keeps printing the answer to 137. This is the problem: The prime factors of 13195 are 5, 7, 13 and 29. What is the … | |
Hi, I have been coding for a number of years but cut my teeth with mud (multi-user dungeon) merc code. I have never coded a gui program before only console based applications. I have a program that I am trying to write in gui and have sort of gotten the … | |
#include <iostream> #include <cmath> #include <string> #include <fstream> #include <windows.h> using namespace std; struct Grade{ int getA; int getB; int getC; int getD; int getF; float marks[100]; }; void init( Grade* student ){ student->getA=0; student->getB=0; student->getC=0; student->getD=0; student->getF=0; for( int i=0; i < 100 ; i++) student->marks[i]=NULL; } int readFile( … | |
Hello, I am new at c++ and need some help. The project we were given is to write a program that asks the user to think of a number between 1 and 100, then attempts to guess the number. The program should make an initial guess of 50. The program … | |
Hi I am trying to run the post fix and pre fix operation in C++. The code which I tried is given below. #include <iostream> using namespace std; int main() { int a =0; cout << ++a + ++a + ++a << endl; // 7 a =0; cout << ++a … | |
Hello all, This is my first time posting in this forum. I searched and found a similar post from years ago, but was unable to find an answer. I'm hoping some of you may be able to help me. I've been assigned a problem in which 20 integers must be … | |
**Dudearoo** *Useing Code::Blocks* How do i Parse??? Can you guys Teach me how to parse a Config File? i Do have the Boost Librarys Installed so if any of you have a way to do Parsing with it then thats ok, I will be able to Follow :) Here is … | |
Has anybody ever installed libjpeg for windows. I have a MingW compiler, MSYS if needed and the instructions are leading me nowhere. It seems to require an understanding of one thousand obsolete systems to get anywhere. Must I have MSYS installed? Can I install using the windows CMD Prompt? Is … | |
hi all, In the book "Programming Languages-Pragmatics" second edition by Michael l. Scott and Morgan Kaufmann, there is a sentence while explaining about copy constructor: "In recognition of this intent, a single-argument constructor in C++ is called a copy constructor." This is about the constructor of the form foo::foo(const foo& … | |
I have found a LOT of info on searching the screen for a pixel color, but none of it even remotely definitive (as far as i can tell, because i'm rather noobish) I understand programming on a fundemental level, but I'm new to C++ I'm hoping to figure out how … | |
Hey everyone need some help again with finding the min and max from a text file. its my college lab assignment. here is my code till now. #include <iostream> #include <fstream> using namespace std; int main() { ofstream fout; fout.open("Text.txt"); ifstream fin; fin.open("Lab6.txt"); float c; int count = 0; float … | |
Hi people, I am making a little experiment to see something. I wished to inherit "string" class and add a function to child class. Function should take a char as parameter and return bool depending on is there such a character in our string or not. I have started off … | |
Hey everyone I am New here.... need some help with my coding for my college HW assignment.... I need to make a rock paper scissor game. I can think of the game in my brain on how I am gona code it but when I try to program it doesnt … | |
Anyone who know what is the code that i have to write in to get the answer ????? with the formula : 1+2!/((x-2))-3!/((x-3))+4!/((x-4)) - ... n!/((x-n)) ------------------------------------------------------------------------------------------------- #include<iostream> using namespace std; int fact (int no) { int total; for (int i=0; i<=no; i++) { if(i ==0) total = 1; else … | |
with the formula : Result = 1+2!/((x-2))-3!/((x-3))+4!/((x-4) )- n!/((x-n)) i want the output as : Please key in x value: 8 Please key in n value: 5 result = 1 +2!/6-3!/5+4!/4-5!/3 = -33.8667 ------------------------------------------------------------------------ i have done the code , still cannot get the output , can anyone help me … | |
Hello, I am fairly inexperienced with coding and have been having trouble with a program I am trying to write. The problem is that when reading from a text file the program will only read some of the file not all of it. Any help would be greatly appreciated. Here … | |
can someone give me a hint on how I can fix this function: void computeOrder(int& spoolOrderAmount, int& spoolStockAmount, double shippingHandling = 10.00) the third parameter is supposed to be a default argument. this is the error: **default argument given for parameter 3 of 'void computeOrder(int&, int&, double)' [-fpermissive]** | |
in tree it acomdates only 260 characters i want to show 300 character pls tell how to do? | |
I've got the following project, which does what is described in the comments, however, when I use VC++ to compile it, it does not run properly, it crashes after I type in the document name. I'm wondering if I could get help on making it run properly. Any and all … | |
Hello, I have a problem about counting consequtive characters, here my code char query[] = "tttthe oneZZZZZ trully loveeee"; void cntfreq(char A[]) { int j; int k=0; j = 1; while (A[j] != '\0') { if (A[j-1] == A[j]) { ++k; cout<<k<<"\t"<<A[j]<<endl; } else k = 0; ++j; } } … | |
Hi, i have a question about using new/delete classes. This is a simle outline of the code: class a { blah blah blah class b { blah blah blah class c { blah blah blah }; }; }; int main (){ a newA; a::b newC; a::b::c newC; //to call fucntions … | |
I am trying to work on this assignment I have and I am pretty lost and do not know what to do. Any help would be greatly appreciated. This is the assignment: Add two methods (functions) to ex34. /* General Info: Write a copy constructor. Use the copy constructor in … |
The End.