49,761 Topics

Member Avatar for
Member Avatar for Fredy_2

#include<iostream> #include<ctime> #include<iomanip> using namespace std; int totcount(int,int,int); //function prototype void sandtype(int&,int&,int&); //function prototype void profitandcost(double&, double& ,int ,int ,int ,int ,int ,int ,double, double); //function prototype //function main begins program execution int main () { int sandwichtype, deliverytime;// declare variables int grandtotalinlbp, grandtotalinusd; int sandwichcost1, sandwichcost2, sandwichcost3; int sandwichretailprice1, …

Member Avatar for Fredy_2
0
118
Member Avatar for Alveena_1

.1 Develop a complete C/C++ program which will sort the input array of integer having a maximum of 10 elements in “Descending Order”. (15 Marks) Your program should give a menu to the user after reading the input. The menu must be following: Press 1 to sort using merge sort …

Member Avatar for ddanbe
-2
253
Member Avatar for munchlaxxx

Any ideas of how I can have a calendar for all 12 months print for any year? The user inputs the year and the day of the week for January 1st of that year. (Sunday = 0, Monday = 1, etc.) *Important*: I cannot use cases. (That's what I've mostly …

Member Avatar for 0igo
0
17K
Member Avatar for Baalla

hello there i'm having a list iterator not incrementable problem i have a adjacency matrix "adj(2d vectors)" + i have a char vector in name color and i have a int glist i'm having a problem with the following function for(list<int>::iterator it = glist.begin(); it != glist.end(); it++) { int …

Member Avatar for Moschops
0
352
Member Avatar for Asira18

#include <iostream> #include <conio.h> #include <string> #include <windows.h> using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { char bname[97],number[34],code[22], name[10],bcate[10],pass,book,author,ID,school,course ; char type, address[5],x,department,quantity,choice,date[10],aname[20],btitle[50], bcode[9] ; int getch(); int num1,num2,num3,num4,num5,num6,num7,num8,op,a, ph[20],num,i=0; int …

Member Avatar for tinstaafl
0
266
Member Avatar for nitin1

Hi, I am learning Git system these days. I have made a new folder in ubuntu and in terminal did this: 1. git init 2. then made a file testfile1.txt 3. then made a branch using "git branch newbranch" 4. then checkout to this branch. 5. then, made a new …

Member Avatar for sepp2k
0
205
Member Avatar for Dusan_1

Write a program that modifies a given sentence by the last word to the beginning of sentences.To consider that words are separated by exactly one with blank sign.A sentence in the form of string set by the user.Show modified string.

Member Avatar for Schol-R-LEA
0
259
Member Avatar for markdean1989

Why is it that whenever I use the getline function I get an error during execution. To clarify... I have this code; cout<<"Enter your string: "; getline(cin, myString); //line 1 cout<<"Enter your name: "; getline(cin, myName); //line 2 cout<<"Age: "; cin>>age; //line 3 output: ____________________________ Enter your string: gfgfkjhjkhgg Enter …

Member Avatar for David W
0
2K
Member Avatar for cannon_1

I have a code that can be compiled fine on the server but not on my mac machines. The following code is designed to split the reading text according to the string delimiter. But when trying to compile this on my mac, I have issues. void split_is(const std::string &s, string …

Member Avatar for rubberman
0
806
Member Avatar for basit_3

hello guys i have to make a simple game project , i not know game programming , any body help me where to start game programming

Member Avatar for Schol-R-LEA
0
226
Member Avatar for nicky nelson

Write a program that displays length of each name stored in a 2D character array. You may assume that 10 names are being stored in the 2D character array at a given time and the length of the name may not exceed 30 charatcers.

Member Avatar for David W
0
192
Member Avatar for basit_3

guys i making a programme in this i have to merge two arrays into one new array but this code does not run at run time ,compiler does not chow any error int k[100][100]; for (int i=0;i<n;n++) { k[i][i]=k[array_1[i]][array_2[i]]; } for (int i=0;i<n;i++) { cout<<k[i][i]; } here array_1 is my …

Member Avatar for ddanbe
0
191
Member Avatar for Baalla

hello i have an adjancy matrix for example [0] 0,44, ( 0 : node / 0,44 it neighbors) [1] 1,3,12, [2] 2,33,40, i need to remove all of the neighbors from a list and push them in another one i wanna start from adj[specific number].begin to adj[specific number].end to remove …

Member Avatar for rubberman
0
271
Member Avatar for basit_3
Member Avatar for liyanaddsce

Hello!!! I am a beginner to C++ and linked list and searching algorithm really made me confused. There are 26 errors (which caused by pointer ofc). Can anyone give me idea how to fix these errors??? #include<string> #include<cstdlib> #include<iostream> #include<malloc.h> #include<fstream> #include<time.h> #include<conio.h> using namespace std; #define SIZE 10 class …

Member Avatar for Moschops
0
263
Member Avatar for Asira18

Please can someone help me write a simple password program for my program which prints out in stars(*).Thank you.

Member Avatar for David W
0
366
Member Avatar for aymenchouikh

Hello i'm using visual studio 2010 express. I'm beginner. I'm searching how to design a button and to program it ? Thanks for any help

Member Avatar for ddanbe
0
373
Member Avatar for TObannion

So, I'm working on an assignment. It involves a read-in text file and the program itself. When I run it I get what my teacher would call "garbage" in the output. Here is the info from the .txt: Mike 1200 John 350 Jen 1500 Tara 700 Michelle 2000 Kevin 500 …

Member Avatar for TObannion
0
259
Member Avatar for LONGWAY

I have to do this with "for" and "while" loop in c++ but no idea how print all numbers between 10000 and 100 which are devisible with 5 and 9 but not with 2 any help suggestion advice or anything is needed urgently this is too complicated for me heelp

Member Avatar for Schol-R-LEA
0
137
Member Avatar for Febin_1

I thought learning programming would be easier if the source codes where available..but the real fact is, it more confusing..the tar files consist of bunch of folders which still remains useless to me..i found no way to edit these source files...but only the make command to compile the software..whats the …

Member Avatar for basit_3
0
71
Member Avatar for Syed Ammar

I have a project to create a simple polling system but my program is not working properly. The result the program is giving is not proper and dont know where the problem lies. can u guys help me out with this. U can see the function i've created to calculate …

Member Avatar for rubberman
0
231
Member Avatar for Sameer_4

static ssize_t write_server(int sd, const void *buf, size_t len, struct sockaddr_storage *to) { ssize_t nb; for (;;) { nb = sendto(sd, buf, len, 0, (struct sockaddr*) to, sizeof(to)); --> return -1

Member Avatar for L7Sqr
0
98
Member Avatar for ivan3510

Hi! This is just an easy example of class inheritance. But, why does Sphere(Circle& K):Circle(K){} work? What does Circle(K) mean? Thanks! #include<iostream> #define PI 3.14159 using namespace std; class Circle { protected: float r; public: Circle(){} Circle(float r):r(r){} float circumference() {return 2*r*PI;} float area() {return r*r*PI;} }; class Sphere: public …

Member Avatar for basit_3
0
158
Member Avatar for tentrabyte

write a file: #include<iostream> using namespace std; int main() { FILE *fp; fp=fopen("e:\\myfiles\\sample.txt","w"); //Check permission if you can write a file if(!fp) { cout << "cannot open file.\n"; system("pause"); exit(1); } //prints the character ASCII from 65 to 90 (A-Z) to a file for(int i=65; i<91; i++) fputc(i,fp); fclose(fp); return …

Member Avatar for mridul.ahuja
0
210
Member Avatar for SCass2010

Hi everyone, I seem to be having a bit of a weird problem with sockaddr / sockaddr_in structs... I want to manually assign the value of an IP address to the sockaddr_in struct, and I've been using memcpy memcpy (&(mIp4sa->sin_addr.s_addr), "127.0.0.1", INET_ADDRSTRLEN); But when I go to print out the …

Member Avatar for Sameer_4
0
2K
Member Avatar for Baalla

hello my problem this time is i have an multidimensional vector and the example of adj vector is showen in the attached picture and i wanna know the size of each one i mean in i=0 the size is 2 i declare a new vector degree to put in it …

Member Avatar for Baalla
0
203
Member Avatar for Baalla

i'm having a problem in reading a file i tried my code in code blocks/eclipse c++/netbeans c++ and even visual studio c++ 2010 each time it exits with (-1) while i'm puting the file in the right place for reading i don't know where is the mistake can you please …

Member Avatar for Baalla
0
257
Member Avatar for pdk123

Hi, I have the following map : listOfPolicyRuleInfo CPCRF::m_mlistOfCliConfiguredPolicyRules; where typedef map<string, PolicyRuleInfo> listOfPolicyRuleInfo; where PolicyRuleInfo is a struct struct PolicyRuleInfo{ BearerQoSInfo stBearerQoS; TFTInfo stTFTInfo; PolicyRuleInfo(){}; PolicyRuleInfo( BearerQoSInfo const& qos, TFTInfo const& tft) : stBearerQoS(qos), stTFTInfo(tft) { } }; listOfPolicyRuleInfo m_mlistOfCliConfiguredPolicyRules = boost::assign::map_list_of("PolicyRule_Fred", PolicyRuleInfo( BearerQoSInfo(9), TFTInfo())) ("PolicyRule_Voice_C", PolicyRuleInfo( BearerQoSInfo(5), TFTInfo())) …

Member Avatar for DeanMSands3
0
498
Member Avatar for kiail

Okay, so I have a program that lets a user input information about dvds...it's a dvd library basically. I'm having a bit of trouble with nice output. I have data members for part of the info and vectors for the others. The output should show a movie title,length, year, actor/actresses, …

Member Avatar for tinstaafl
0
421
Member Avatar for sang ku te buoi

What difference between TCHAR* t1 = new TCHAR[5]; wcscpy(t1,L"Happy"); T.push_back(t1); and TCHAR t2[] = L"Day!"; T.push_back(t2);

Member Avatar for rubberman
0
104

The End.