51,592 Topics
![]() | |
write a program whichask the user to enter the positive integer. then the program to display whether the user to enter the number is prime number or not. (prime number is the number which is divisible by one and the number itself) | |
How would I fill a two-dimensional array up with numbers. map_height = 9 map_width = 8 I have this code: [code] for (i=0; i<map_height; i++) { for (p=0; p<map_width; p++) { room_numbers[i][p] = w; w++; } } [/code] But when I try to print it out it comes up with … | |
I am not sure if the title of my thread indicates where the problem is, but that is what I think it is. [code] void convertFormat(vector<string>& files, map<string,int>& tickerMap, vector<int>& numRecords ) { string txt = ".txt"; string filePathNameString; for ( int k =0 ; k < (int)files.size(); k++) { … | |
:) Hello experts, Im taking a C++ class and i was asked to Write a program that uses a structure named MovieData to store the following information about a movie: Title Director Year Released Running Time (in minutes) I've come down to making it compile, but, when it couts the … | |
Im doing a school project. have to do dllimport as the SiUtil.dll is written in C++. But im not sure the coding below is correct as there is error. Please advise needed. [url]http://www.silabs.com/Support%20Documents/TechnicalDocs/an117.pdf[/url] Thanks a million. [CODE]using System; using System.Collections.Generic; using System.Windows.Forms; using System.Runtime.InteropServices; namespace ProgrammingInterface { static class Program … | |
i everybody, I am required to find out if the following is a standard practice to create a subclass. Take for instance, I have to create a class library (ClLib) with 2 classes using Visual Studio: Class1.cs & Class2.cs. Next, I open up the .CSPROJ file of ClLib and modify … | |
Hi, I'm having problem with my linked list. The program I'm making should read in positive and negative numbers and put them into two separate lists. The numbers should be in rising order in the list. example: input: 3 5 1 -6 -2 -1 printing out the lists: pos: 1 … | |
i'm so sory because i made mistake when asking about this before.. so here i'll make correction in this post.... actually what i want to ask is why my cin.fail() code do not works?? i want this program to ask the user back the same question if the user enter … | |
hello all working on a class project in C++ using eclipse and g++ stuck a zip of the project as an attachment but here is the basics [CODE]#include <iostream> #include "Complex.h" #include "FileHandling.h" using namespace std; int main(int argc, char **argv) { FileHandling file();// opens the file and gets the … | |
Hello to all code gurus! First of, I wouldn't lie, i am not a professional programmer.....I am more of the opposite. I was given a program to write during a 4 day C++ programmers boot camp that I signed up for (which ended friday actually). By profession am a graphic … | |
Hello all, I need to create a function call to calculate the average...Can anyone help with that?? I'm not sure how to create a function in my code to calculate the average. My code currently terminates after I enter the 50 inputs and does not compute and read the average. … | |
i have writen the program but i cant seem to print result. the program builds a stack of numbers, then it adds,subs,mult, or divides all the numbers. for example 4 numbers are put in 1,2,3,4 it will ask what you wanna do . the answer should be 10 but instead … | |
I don't know if anybody here programs in C++ for the AS/400, specifically the Personal Communicator (PCOMM)... I have been able to successfully write programs in Visual Basic for Applications with Excel but I am having a hard time with C++. When I try to compile one of the sample … | |
Hey, I'm trying to do some compression on an ascii saved file, and running into problems. The original file starts off as such: [CODE]7+'Y 2+'J0-B)#0 [/CODE] I can read this in, and I get it as: [CODE]6 1 55 32 32 41 85 80 120 5 2 33 85 81 … | |
[code] #include "stdafx.h" #include <iostream> #include <iomanip> using namespace std; //------------------------prototypes---------------------------------- void ReadData(int &x, int &y, int &z); float FindMaxMin(int x, int y, int z, float &max, float &min); float ComputeAve(float x, float y, float z); void ShowAll(float x, float y, float z, float average, float max, float min); //-------------------------------------------------------------------- … | |
Please help, I can not answer on the project please help me Project Facility | |
I have a quick question. I use getline to read from a file and put the line in a string s I call cout<<s and the output is this: "HELLO, PLEASE \n "ENTER" A NUMBER \n" why are the \n ignored and treated as strings? thanks | |
i am having trouble with testing to see if aData is equal to exit i have tried a few diffrent things the only thing i have relized is that the compiler say that aData is a multi character constant any help is greatly appreciated [CODE]while (exit != 1) { char … | |
using functions write a program that captures details of a customer at a bank, account number, opening balance.The program should also include a function that allows a client to deposit money to account , withdraw money,calculate balance & query balance. | |
I am trying to write a program to find nearest prime to a number to its left...using for loop i just don't seem to get it right [CODE] #include<iostream.h> #include<conio.h> void main() { clrscr(); int n1,flag=0; cout<<"Enter The Number"<<endl; cin>>n1; for(int i=n1;i>0;i--) { for(int j=2;j<(i/2);j++) { if(i%j==0) { flag=0; } … | |
I started with debuging so I now debug all programs I can to understand the full work off microprocessor. I know basic ASM level so no problem here. look what i wana ask [CODE] --- c:\users\zippo\documents\visual studio 2008\projects\debug\debug\main.cpp -- #include <iostream> using namespace std; int main() { 00031370 push ebp … | |
Hello. I have created a simple program which generates 3 random numbers, puts them in a text file, reads them, and then does 3 small calculations, results are put in another text file. Program is working correctly on my PC, however there is a catch. I need to submit it … | |
write a program that will multiply two dimentional arrays as follow: 1. The program should prompt the user for the dimention of the first array (row x coloum). 2. The program should get the values of the first array one by one. (e.g. program should display "enter value of a[1][1]= … | |
![]() | #include<stdio.h> #include<conio.h> main() { window(10,55,22,77); textbackground(RED); clrscr(); } is this correct?? i run it but it didn't display anything. my prof. have an example bout this he said that the #'s inside the parentheses are the sizes of the box, (x1,y1,x2,y2) x1 is the top line of the box, y1 … |
Hello all, I'm getting an error telling me "'}' is expected at the end of input" but '}' is there. Any help with these issues? Here's what I have so far: [CODE]#include <iostream> using namespace std ; void displayTitle () { cout << "Active Duty Navy Personnel Program" << endl … | |
Hello all, I have been trying to use swtich cases in conditions but it won't work what I mean is like this; [COLOR="Red"]do{ cout<<"Enter a valid number"; cin>>number; switch(number) { case 0: bla bla break; case 1: bla bla break; case default: cout<<"re-enter"; } }while(defalut);[/COLOR] if that can never happen … | |
Hi, I am writing a simple graphics engine using homegeneous coordinates (fourVector) and the corresponding 4matrices (fourMatrix). fourVector.cpp: [CODE]fourVector::fourVector(float x, float y, float z, float w): x(x),y(y),z(z),w(w){ };[/CODE] fourMatrix.h [CODE] class fourMatrix{ public: fourVector i,j,k,l; ... }[/CODE] fourMatrix.cpp: [CODE]fourMatrix::fourMatrix():i(fourVector(1,0,0,0)),j(fourVector(0,1,0,0)),k(fourVector(0,0,1,0)),l(fourVector(0,0,0,1)){} fourMatrix::fourMatrix(fourVector &i, fourVector &j, fourVector &k, fourVector &l): i(i),j(j),k(k),l(l){ } ... … | |
hi....i am writing a code which reads the contents of file....it has first name, lastname and phone number.....now i want ot read all the first names into one array second into another and phone numbers into third array....i tried but i could read only line by line.....please help out...my code … | |
Write a C++ program that asks the user to enter the length, width, and depth of a swimming pool using getValues( ). calculate the cubic volume using calcCubic( ). Print the result using printCubic( ). | |
I just know I'm doing something stupid. The part of my assignment I'm working on is to prompt the user to enter the name of a stock, earnings per share, and price to earning ratio, and then display it after everything is entered. What it's doing now is asking for … ![]() | |
sir iam a begineer student and i want to study about c.in turbo c compilers with starting.plz tech me about the function return and pass though function. ![]() | |
I know this is using C. But if i was using the stdlib.h to use C in C++, can i somehow save the output into a variable. That way i can save the value for later use. something like... int a = 15; int b = 7; int hexValue = … | |
I don't understand. Nobody in the US uses this crappy compiler with it's non-standard libraries. No one in the Western World seems to use this. even in second world countries in central and south america, they don't use this. so how is it that Borland seems to have a complete … | |
hii, I am getting "Error Creating bitmap!" in EVC++ 4.0 on Window CE 5.0. I don't where this error came from. I am using CreateCompatibleBitmap and BitBlt for drawing the screen. I have checked all Error codes , but no luck. Description of Error : It’s the SNAP window with … | |
Why people write such cryptic code I will never understand... Can someone explain what is going on in the following: [code] double color = {1,2,3}; double *ptr; // ... assign ptr .... *ptr = *color++; ptr++; [/code] So this line [icode] *ptr = *color++; [/icode] sets the value of the … | |
I wrote the following function that takes a string with spaces and replaces the space with an underscore ( _ ). The function works, but I believe there is a less novice way of doing it. Anyone have any suggestions? BTW, this is written in Linux and compiled with G++. … | |
Hello guys, I'm brushing back up on C++ it's been a long semester of Assembly Language. Anywho, I am writing a program that keeps track of my grades and can average them up if I need and do many other things. I'm using a switch statement as my menu select. … | |
Here's what i have. Not sure what it is doing exactly. You pack a account object and then you write it to the buffer right? So shouldn't it print after i write it? Main #include <iostream> #include <iomanip> #include "account.h" #include "Lentext.h" #include "Deltext.h" using namespace std; int main() { … | |
Hey all, I have this for loop and it keeps printing a '}' at the end of my alphabet and I can't figure out why. Please help me figure out how to get rid of it! :) Thanks! - EngneerNitemare [CODE]// PREPROCESSOR DIRECTIVES #include <iostream> using namespace std ; // … | |
Hi, I have a similar problem. I need to read and store information from a file such as: in int count=7; //count int float end = 7.5 ; //end out float myout =0; //my out I need to store type(e.g. in or out), variable type (e.g. int), variable name (e.g. … | |
Hi i'm new to C++ and have made a grading system application. The application works, but I would prefer to use one variable for student name instead of two seperate variables, but when I try to do this it skips to the next line of code when I run the … | |
amenu driven program using link list data structure,which keeps track of student record of auniversity. the system should maintain at least the following information about student. name year id number DEPARTEMENT age CGPA | |
Hopefully this title makes some sense, i wasn't really sure what to put. Hi i need some help with this assignment. Unfortunately, I'm not sure what I've done is anywhere close to what it needs to be. I need to read a list of customer data from a text file … | |
Hi We have dd command in Unix to make an image of the entire hard disk or a partition of it (bit copy not just a file copy). I would like to know how to do the same in C++. Thanks in advance.... | |
heya, i am working on this program wonderig anyone can help me finish it . i put in most of the //info on whats suppose to happen but am having trouble figuring out actually how to. [CODE] *Program Description: This program is designed to insert numbers into * an array … | |
Trying to replace '\n' or its decimal equivalent of 10 after it has a decimal value added with its original value of '\n' or 10. This way the newline character won't appear in the ciphertext as some other visible character. [code=c] while (!plainText.eof()){ string plainLine = ""; getline(plainText, plainLine); int … | |
This is the last questions I have about arrays. I have no idea of where to go with any of them except writing the header of the functions with the parameters. Again this is just questions from a study guide for my final exam so I am not asking you … | |
This is another question from my study guide for my final exam. If you all could please give me some help. Write a value returning function called "found" with parameters of a float array a float item and a integer length, that searches the array for any value greater than … | |
Hey Everyone, I have developed a program to help me geocode approximately 100,000 addresses from Google. After doing some i/o to bring all the names into a vector in C++, I have now 100,000 distinct addresses that I must pull up, retrieve the code from google's server via csv output, … | |
hey i am trying to write a program that allows two users to play tic tac toe....right now i am doing the program in pieces i have accomplished setting up the two dimensional array. i am having a problem changing the * thats in a section of array to an … |
The End.