51,593 Topics
![]() | |
Hi there, I recently recieved some intructions to make a program using a "do while loop". Here is the questions below....by the way i am very new to C++: "Your program begins by randomly assigning the user an amount of money (from $1 - $1000), and then after each round, … | |
I am having trouble coming up with code for removing a node in a binary search tree. This is what I have so far: [CODE] void remove(int n) { node *current=root; node *gptr; while(current != NULL){ if(n<current->key){ gptr=current; current=current->left; }else if(n>current->key){ gptr=current; current=current->right; }else if(n==current->key){ if(gptr->right->key==n){ cout<<"1st ==key = "<<gptr->key<<endl; … | |
I am writing a turtle graphics program and I need help with 2 characters to show when the direction of my turtle is up or down. I am using cout << ">"; cout << ">"; for right and left and right directions. Any help will be greatly appreciated since my … | |
Hi I've been asked to write a program for this figure 1234 2 3 3 2 4321 I have tried writing this,don't know if its correct or not :?: my program is #include <iostream.h> void main() {int n,r,c; cout<<"enter the value of n"<<endl; cin>>n; for(r=1;r<=n;r++) c=r; cout<<c; cout<<endl; for(r=2;r<n;r++) for(c=2;c<=r;c++) … | |
OK PEOPLE I NEED HELP AGAIN........pls dont do my homework..........thats y i havnt given the question this time aroung :) the question im asking is simple : the program asks user to input product id ( a,b,c,d or e) and its quantity sold......it then saves total sale in "int sale" … | |
[IMG]http://img.villagephotos.com/p/2004-8/807060/resultwanted.JPG[/IMG] the picture shows the result i wanna achieve but my program here which i modified: [CODE] #include <iostream> using namespace std; int main() { int k, m; for(k = 1; k <= 10; k++) { for(m = 0; m < k; m++) cout << "*"; cout << endl; } … | |
static void myInit() { PrimitiveType=GL_POLYGON; LineSegments=3; } can someone tell me what static does to the function? | |
i am a beginner, and i have 4 questions but i will only ask 2, 1. i have an assignement that says, write a program that will display one of three user-selected shapes, ('T'=triangle, 'D'=diamond, or 'R'=rectangle and 'X' to terminate). using a switch statement. please help me with the … | |
Greetings: I am taking my first C++ class and am a little stuck. I keep receiving three compiler errors, but I can't seem to figure them out. Can someone please point me in the right direction. The assignment is: Write a C++ program having a recursive function recursiveMinimum that takes … | |
How would I create a method like toString() within the SHA-1 class to convert a message digest to a C++ string, each representing a hexadecimal digit. Also, how could specify whether a file should be read as a text file or binary file? Thanks | |
hey all, what would be the calculations needed for making a simple sprite opject point towards the cursor position? ta | |
Which file supposed to replace the file crtdbg.h in embedded c++? Is it possible that I don't have it in the embedded c++ environment? I'm trying to convert a project that wrote in visual c++ to Embedded visual c++? | |
I'm about to kill myself... This is very elementary stuff, yet I still can't do it. Let me first give you the code and then explain my problem : [CODE] wordListIterator = wordList.begin(); list<string>::iterator wordListNextIterator = wordList.begin(); wordListNextIterator++; while(wordListIterator != wordList.end()) { /* Counting duplicates */ int count = 1; … | |
[CODE] //Program to collect and hold data on CD's #include <iostream> #include <fstream> using std::cout; using std::cin; using std::endl; using std::ifstream; int main() { int QA; cout << "To veiw file press v, to add a new CD press a:\n"; cin.get(QA); if (QA == v) { while (CDs.get(ch)) cout.put(ch); } … | |
i don't know how to get some of the codes. how do u load an array code //C++ Program to demonstrate basic array function operations #include<iostream.h> const int ARRAY_SIZE = 5; void LoadArray(int a[ ], int size); void DisplayFirstToLast(int a[ ], int size); void DisplayLastToFirst(int a[ ], int size); int … | |
How can we print the output of the program(which is in the black environment, dos form)in the c++ visual studio 6 compiler? | |
I'm not sure how to get started with this. Here's the assignment and what i've done so far, but I'm not sure if i'm going the right direction with this. The assignment says to have the user enter input one character at a time. That means one letter or space … | |
Here is my problem. My code consist of two edit boxes: IDC_BOX_1 and IDC_BOX_2. and one button to Execute. The idea is for someone to enter a number in the first edit box, IDC_BOX_1, and after pushing the Execution button, the number in IDC_BOX_1, gets multiplied by two and displayed … | |
Hi, i wanted to overload a + operator to add two objects..i have an error which states "invalid operands `employee *' and `employee *' to binary `operator +'".. i do not know what is wrong with that statement, can anyone pls point out my mistake?? Thanks. the problem lies with … | |
hey i was wondering if someone could help me with this problem. i am so incredibly and utterly confused. here it is... write a simple phone directory program that looks up phone numbers in a file containing a list of names and phone numbers (called input.txt). the user should be … | |
I've written programs for averaging lists of exam grades but throwing in the percent is throwing me for a loop. I don't know how to handle this information. Any help will be greatly appreciated. > //Write a program that asks the user to enter a student's midterm > //and final … | |
Hi, I am very new to this forum and i have a problem with my C assignment. Im using Borland C++ 4.52 and i keep getting an error saying: General Protection Exception 0x241F:0X41C1 NONAME02(1)0X241F:0X41C1 Processor Fault It not the computer its the code at least thats what i figured because … | |
I would like to get all the elements of a string array and I just get the last one followed by a "zero" element. void DrawFonts(int num, int x, int y) { Char Buffer [20]; CString ss; num = 15; //or whatever more than 2 elements itoa( num, Buffer, 10 … | |
the typical question which ask user to display THIS * ** *** **** ***** ****** ******* ******** ********* ********** using a single cout<<"*" & cout " " with the help of [B]for loops ONLY[/B]. :) ive come to this this prgram but can anyone tell me where i am going … | |
I need some help, what would everybody out there recommend for a C++ Compiler. I am thinking about paying $110 for Visual C++ "Standard". Does anybody know if this software is great and what are the best features of it. Other recommendations are also welcome. | |
:D can you please help me in writing a program(c++) for finding factorial of a number using * operator overloading? | |
Hi I'm Josh and I'm new to these forums, and new to c++. I hope that I can get some great hints and help from the community. thank you in advance! I'm trying to create and use a hashtable class that uses a linked list for separate chaining. I've completed … | |
Hi, I'm a new member who is fairly new to C++ and need a little help getting some bugs out of an assigned matrix project. I am running VC++ 6.0 and have no compiler errors. Also, I have managed to run the program successfully for small matrices. My probelm occurs … | |
Hi guys, Just wanted to ask you're opinions about this program I had to write for evening school, the idea is when you enter a phrase wich isn't longer then 80 letters, the programm will count the amount of each letter wich is written :!: It doesn't have to keep … | |
I would really like to learn how to debug my programs. The book I'm using does not have much info on debugging and my instructor hasn't said much on the topic either. I ended up re-writing my source code because of seg fault error. The program works fine now, but … | |
I have a problem which states that good people all have last names that be begin with the letters G through L; all the others are bad. The program must differentiate the good people from the bad. Does neone have any design ideas? output:Name? Farley Farley is a bad person | |
im studying programing fundamentals. I dont know what is the commands and syntax of c language..can u give me some information and tutorials about this c language....coz, i can't find any website about c language, is there any tips on creating basic programs..thnks!!!!! | |
Hello, this is my first post, so i'm sure i'll fumble it a little bit. I'm writing a program that has a switch, a nested if, and an output choice of console or new file on a:. I feel like all my switch and nest is good, but i'm missing … | |
Microsoft Windows XP Home Edition Version 2002 Service Pack 2 Hewlett-Packard Pavilion Intel(R) Celeron(TM) CPU 1300MHz 1.30 GHz, 512 MB of RAM hp pavilion 502n ----------- When I turn on my computer and either let it sit for a while, or I start opening programs - games, Word, my Wireless … | |
1) Read an integer # from the file [I]balance.dat[/I] that represents the balance on your checkbook (Assume integer #'s only) 2)let the user enter an amount to write a check. 3)If there is enough balance to write teh check then display the message ([B]OK to write check[/B]) if the check … | |
I am having a very hard time trying to solve this problem.Here are the instructions to the assignment: Implement a Priority Queue using a heap. The heap should be implemented as a class that has a private member which is an array. The array is statically allocated and the size … | |
this program is supposed to create a box with a horizontal line of the limit that a user inputs from 2-9... for example a limit of 5 would create: 5$$$$ $5$$$ $$5$$ $$$5$ $$$$5 an input of 4 would create: 4$$$ $4$$ $$4$ $$$4 and so on... i cant seem … | |
The program is supposed to pen and read a file with student’s scores for a semester. Display a chart with the average and median scores for each section and each lab. Example: CS 111 this semester has 7 sections and 10 labs. The output will be a chart with 7 … | |
I'm new to C++, and I'm trying to solve a problem to compute an exponent of an integer to a float. The following is the psuedo code: Declare x as a float Declare y as an integer Declare i as an integer Declare result as a float Input x //any … | |
hi guys i ask for help but know one responded, so i figured i will ask again. this is the first problem and why i can't print out a rectangle, triangle and diamond. i need know what am i doing wrong with both of these questions. someone please help me. … | |
hi, all. i have some problems to do array. i am supposed to get the average and sum in given number of array. but, i only got 1 in my all answers. please, tell me what was wrong in my program. thank you. //hw for array #include <iostream> #include <iomanip> … | |
I'm told you are never to old to learn something new but right now I don't believe that. I thought I understood this but the program I wrote just doesn't work any suggestions? Write a program that asks the user to enter the price of an item and the sales … | |
My C drive thinks it is called C:\Documents and Settings\Mike Swindlehurst> can anyone tell me why? | |
Greetings, I have my first assignment for my programming class to do, but first, I will say that I am aware of those people who post entire problems requesting members to do their homework for them. This is not really what my post is about. I'm having a little problem … | |
hi guys, I want to create a class called DoubleSubScriptedArray.this array should be able to take maybe a 3 by 5 array or 1 by 3.My program is giving me a problem when i try to overload the stream-insertion and stream-extraction operator.Below is my program pliz help me to get … | |
[code]#include<iostream.h> #include<stdlib.h> const int MAXCHARS = 500; char st_line[MAXCHARS]; char ch_option; int i_va; int i_ve; int i_vi; int i_vo; int i_vu; int i_word; int i_count = 1; int i_number = 0; int i_vowel = 0; char ch_char; void getdata(); void vowels(); void words(); void putdata(); int main() { do{ getdata(); … | |
Alright, mine's a long one. The error I keep on getting is bin_search local funtion defs are illegal. Think there is something worng with my binary search. Anyone see what's worng with it? I'm sapose to have it display 1. The number of searches completed 2. The number of successful … | |
Can someone give me a start of my program I have to write a program usig functions that will read in an array of text and using the case statement determine the number of capital and lowercase letters(a, e, i, o, and u's) found in a string of text with … | |
I'm wondering if there's any sort of interpolating function in C. I'm trying to rewrite a MATLAB script in C. I saw the name interp somewhere but i haven't been able to find a full description of the function. thanks | |
i can not figure out a way to let the user save their own file name in the ofstream i tried to do this... string SaveName; std:: ifstream input("finale.txt"); std:: ofstream output(SaveName); and then a prompt asking user for SaveName i know this doesn't work but i dont know what … |
The End.