49,761 Topics
| |
#include<iostream.h> #include<conio.h> #include<stdio.h> #include<math.h> main() { system("cls"); int h,w,m; cout<<"Press1,if you are male"<<endl; cout<<"press2,if you are female"<<endl; cin>>m; if(m==1) { cout<<"you are male"<<endl; } if(m==2) { cout<<"you are female"<<endl; } cout<<"Enter your height="; cin>>h; cout<<"Enter your weight="; cin>>w; if(m==1) { if(h<60) { cout<<"you are unfit"; } if(h>=60&&h<65) { if(w<45) cout<<"you … | |
Hi everyone. My name is Zvjezdan Veselinovic and I am a student at Rasmussen College over in New Port Richey, Florida studying Game and Simulation Programming. For my student portfolio, I want to create a "tron-like"/ "snake-like" game called Colors and Explosions. I have so far arrow key movement. That … | |
#include<iostream> using namespace std; int main() { for(int i=0;i<13;i++) { cout<<"*"; if(i==0 || i==12 ||i==9) { for(int j=0;j<10;j++) { if(i==9 && j==0) { cout<<" "; } else cout<<"*"; } } else if(i==10) { cout<<" "; cout<<"*"; for(int j=0;j<7;j++) { cout<<" "; } cout<<"*"; } else if((i==1 || i==2 || i==11)) … | |
How can I calculate CLOCKS_PER_SEC.. It is defined as 1000 in ctime. I don't want it defined. I want to calculate the actual value.. I tried the below code but it seems to be giving me my CPU speed.. on a 2.8 Ghz processor, it prints 2800. On a 2.0 … | |
> *Inline Code Example Here*hi i want to print the diamond as shown bellow,which is generic i mean depend on the user input.the following output is for "5", Heading Here 1 232 34543 4567654 567898765 4567654 34543 232 1 | |
Can anyone tell me whay the following funtion that should be returning true if the year is leap year and false if it is not, is givign me unexpected results? when I entered 1985 I got true? when I entered 2012 I got false. When I entered 2000 I got … | |
So I was asked to write some simple functions that would search through an array of length (s) and tell how many times an (integer, double etc. ) appeared within the array. It's pretty simple because they give you the length of the array. However one of the functions doesn't … | |
I am trying to do a C++ coding. I am trying to do problem in which i have numbers of points. Now i need to find the path that goes through all the points. This is not actually TSP because as per my knowledge in TSP it is possible to … | |
can anyone help me to fix this problem ? i can delete the midder and the tail of the node , the only problem is i cannot delete the head node when i have more than one node. ---------------------------------------------- #include<iostream> #include<string> using namespace std; class linklist { private: struct node{ … | |
i wanna know ina easy way what do we ,mean by inheritance and hybrid inheritance in c++ | |
Hey, I have never programmed before, so everything is very confusing for me. I was given an assignment to change binary to a decimal number. Not very much information was given to me. I am NOT looking for an answer, but I definitely am looking for some help as to … | |
Hi guys, trying to figure out why i can't insert this LinkList i create (TrainA) can't be placed into the Queue. I keep getting the error 'trainA' was not declared within this scope. Any help will be cool thanks! class Link { public: int iData; // data item (key) double … | |
A solution for the "Hartals" problem. Problem description: http://icpcres.ecs.baylor.edu/onlinejudge/external/100/10050.html Author: [Joana Matos Fonseca da Trindade](http://joanatrindade.wikidot.com) #include<stdio.h> int main() { int i,j,k,a,b,h,hd[100000],n,p,pd[150],tc,t,s; while(scanf("%d",&tc)==1) { for(i=0;i<tc;i++) { h=0; s=0; scanf("%d",&n); scanf("%d",&p); for(j=0;j<p;j++) scanf("%d",&pd[j]); for(j=0;j<p;j++) for(k=pd[j];k<=n;k+=pd[j]) if(k%7!=0 && k%7!=6) { h++; hd[h-1]=k; } for(a=1;a<h;a++) for(b=h-1;b>=a;b--) if(hd[b-1]>hd[b]) { t=hd[b-1]; hd[b-1]=hd[b]; hd[b]=t; } for(t=1;t<h;t++) if(hd[t]==hd[t-1]) … | |
can anyone help me to slove the problem ?? i wan to delete a node either form the head , midder or last , then print out all the node . #include<iostream> #include<string> using namespace std; class linklist { private: struct node{ struct student{ string name; int id; string prog; … | |
Right everyone, here's my problem. I have just paid £45 for a book on Qt, have had a nightmere getting it sorted, and finally I can build apps to this extent... I have an app, *test.pro*. I have built it using `qmake test.pro` -> `make` which works. I am using … | |
Im reading a text file and storing the characters in an array. I get a "Unhandled exception at 0x0109985e in Executable.exe: 0xC0000005: Access violation writing location 0xcccccccc." void drawMap(string MapLoc) { int i = 0; int x = 0; int y = 0; char* arrayMap[5225]; ifstream mapReader; mapReader.open(MapLoc); for (i … | |
Hello All, i have a small question regarding casts in C++. 1) Now, dynamic_casts ensure safety with casts. ie. for example: for the below polymorphic class: class Base { public: virtual void foo() {} }; class Derived : public Base { }; int main() { Base *bPtr = new Base; … | |
I have a project and a part of it is related to sha 1 encryption using openMP. Any help would be highly appreciated. | |
consider the following program #include<iostream.h> #include<fstream.h> void main() { int no; ifstream fin; ofstream fout; fout.open("create,dat",ios::app); fout<<"What is your fav. number"; fin>>no; fout<<no; fout.close(); } NOW HERE IS THE PROBLEM WHILE THE PROGRAM IS RUNNING PERFECTLY AND THE NUMBER IS BEING STORED IN A .DAT FILE BUT THE NUMBER IS … | |
I'm asked to write a program in which the user inputs a letter and the program converts it to lower case if it's UPPER and vis versa. I have written this program and it worked: #include<iostream> using namespace std; int main() { char letter; cout<<"Enter any letter"<<endl; cin>>letter; if(letter>=97&&letter<=122) { … | |
Hi I am allocating memory space and adding nodes like this: CSprite* pNewSprite = new CSprite; // Create new sprite pNewSprite->iData = iChoice; // Attach data EnemyList->AddNode(pNewSprite); // Send to AddNode and also in the ::AddNode: void CLinkedList::AddNode(VOID* pData) { CNode* pNewNode = new CNode; // Create the Node pNewNode->pData … | |
Hi I am new to programing and I want to learn some basic tings. I also want to learn to create basic games. Could anyone reccomend a good book or websiteto get me started? Thanks, Robbie | |
hi ! how can i do a one-way-circular linked list function that gives to me** merge 3 lists** such as struct node{ int data; node *flink; node *blink; }; void concatenate(node *&L1,node *L2,node *L3) { ??? } | |
can anyone help me to solve this problem ? i cannot excute this program. ----------------------------------------------------------- #include<iostream> #include<string> using namespace std; class linklist { private: struct node{ struct student{ string name; int id; string prog; double cgpa; }st; node *link; }*head; public: void linklist_1(); void linklist_2(); void insFirstNode (string name, int … | |
Hello all... My project is to parallelize the MD5 program using OpenMP (omp). so please help... This is test.cpp: #include <stdio.h> #include <omp.h> #include <iostream> using namespace std; #include "md5.h" int main(void) { int n; double time1, time2; time1=omp_get_wtime(); cout << "\n The MD5 of 'zzzzzz' is : "; cout … | |
the loop runs infinte for the second ittiration //attempt two to make the student data base the other way // this program runs onlu once and does not hav any data base once u exit #include<iostream> #include<conio.h> using std::cout; using std::endl; using std::cin; int count=0; class student { double m_roll[100],m_class[100]; … | |
I'm trying to be clear about registry, and would hope someone might confirm, or not, that my interpretation is correct. I read [here](http://msdn.microsoft.com/en-gb/library/windows/desktop/ms724072(v=vs.85).aspx) > The parent of each 64-bit registry node is the Image-Specific Node or ISN. The registry redirector transparently directs an application's registry access to the appropriate ISN … | |
In code like int `main(int argc, char **argv)`, I'M trying to understand command line arguments a little better. And what would be the difference between `char ** argv` & `char * arg[]`? Thanks. | |
so i am on my last 2 programs for my programminng course and i only have till monday(3 days) to do both of them here are the guidlines for the first project: 14-1 Write a program that declares an array of ten floating point values. Have the program prompt the … |
The End.