67 Topics

Member Avatar for
Member Avatar for Krazykado

I am fairly new to Java programming and I am having problems with creating a program with these requirements: 1. Create a program to simulate the roll of 2 – six sided dice. 2. Test to see if the dice are equal. 3a. If they are equal print “You win! …

Member Avatar for matencio
0
776
Member Avatar for siddiqui_1985

Hi Everyone!! I have a little problem in printing Character Arrays.... i have enclosed my code below. what problem actually i have is that when i type my first name and after first name (space bar) last name.. it prints only my first name. i want to type whole name …

Member Avatar for HASHMI007
0
152
Member Avatar for nidajaffri

Write a program in C/C++/Linux to find the mean and then use that mean for further calculations. Make three threads to perform different task as follows: a) The 1st Thread will find the mean. b) The 2nd Thread will take the mean from the 1st Thread and display the numbers …

Member Avatar for nidajaffri
-1
2K
Member Avatar for Jack Martin

# include <iostream> using namespace std; int main() { cout << "By this program you can know about Whether a number is a or not" ; cout << "Enter a number less than 1000 :- "; int a,b,c,e,f,g,k ; cin >> a; if (a < 1000) b=a/10; k=b+2 ; c=a-(k*10); …

Member Avatar for WaltP
-1
163
Member Avatar for ordinary jam

i'm trying to add two fractions via a function and it works. the problem is that i have to print the fraction in the main( and i have absolutly no idea how to do that) other than that the program works fine. [CODE]#include<stdio.h> #include<conio.h> #include<iostream.h> int frac(int,int,int,int); void main() { …

Member Avatar for mrnutty
1
1K
Member Avatar for danieldane

//include files #include<stdio.h> #include<conio.h> #include<stdlib.h> #include"c:/includes.h" //stores the structures of master and index file #include"c:/function.cpp" //stores all the functions for the file primitive /* The main function input: none output:none calleed by: OS. calls: ADD_RECORD,DELETE_RECORD,MODIFY_RECORD,SEARCH_RECORD,DISPLAY_RECORD */ void main(void) { int choice; int status; int roll_no; char ch; clrscr(); printf("Enter the …

Member Avatar for danieldane
0
174
Member Avatar for jodzjcm

{ char user[]={'\0'}; char* animal_holder[12]={"Ant","Bear","Cat","D… printf("You have to guess what %c%c%c%c stands for.\n",animal_holder[a][0],animal_holde… printf("Enter your guess:"); scanf("%s",user); if(user==*animal_holder) printf("Your choice is %s",user); } What are the errors?

Member Avatar for Narue
0
138
Member Avatar for annitaz

My code for the calculator is: calculator.h [CODE]#ifndef CALCULATOR_H #define CALCULATOR_H #include <QWidget> #include <QGridLayout> #include <QLineEdit> #include <QLabel> #include <QPushButton> #include <QLCDNumber> #include <QString> #include <QMessageBox> #include <QErrorMessage> class Calculator : public QWidget { Q_OBJECT public: //constructor Calculator(); public slots: //function to add the two numbers that the user …

Member Avatar for imolorhe
-1
356
Member Avatar for CloudZELL91

[CODE]#include<string.h> #define MAX 15 #define true 1 #define false 0 /*Structure Decvlaration*/ typedef struct { char data[MAX]; char top; }STK; /*Function Declarations*/ void input(char str[]); void intopre(char str1[],char pre[]); void intopost(char str1[],char post[]); int isoperand(char sym); int prcd(char sym); void push(STK *s1,char elem); int pop(STK *s1); int empty(STK *s2); int …

Member Avatar for Salem
0
137
Member Avatar for turista

Hi i saw a post about this program already. im new to c++ and im lost... completely lost... im not even sure im posting this in the right place. anyways. the program i got is working correctly until i make it an OOP which is what my teacher wants us …

Member Avatar for Chilton
0
244
Member Avatar for toneranger

I'm reading a big csv file into a data structure defined as such: [CODE]struct PriceInfo { double Open; double High; double Low; double Close; unsigned int Volume; unsigned int Time; std::string Date; };[/CODE] So somewhere in my main function, I have this line: // read contents of datafile by overloading …

Member Avatar for danb737
0
577
Member Avatar for angelsakura

Hi, we have this school activity that is rush for tonight. I would really appreciate if somebody will help me. It would really mean a lot to me. So here is the problem that were tasked to us to create a C++ program. Problem: Write a C++ program to perform …

Member Avatar for WaltP
0
2K
Member Avatar for ineedsomehelp:3

[CODE]void printer(char x) { int d, b, z; for(z=x; z>=1; z--) { for(b=z; b<=x-1; b++) printf(" "); for(d=z; d>=1; d--) printf("%d ", d); printf("\n"); } }[/CODE] that's my code which is supposed to print 4 3 2 1 4 3 2 4 3 4 when input is 4. however, it …

Member Avatar for Arbus
0
212
Member Avatar for Mona Ali

its my code pleas tell me y error occur in it. impex.h file [CODE]#ifndef IMPEX1_H #define IMPEX1_H enum shapetype {Point=1,Polyline=3,Polygon=5}; struct pointD { double x; double y; }; struct item { int id; list<pointD>coordinates; shapetype type; }; class impex { public: impex(); void savekml(list<item>); private: }; #endif .cpp file #include<iostream.h> …

Member Avatar for Mona Ali
0
206
Member Avatar for newbee234

Which of the following are valid function prototypes? x one(int a, int b); int thisone(char x); char another(int a, b); double yetanother; void thelastone(); void (function1) void; void function2(void) void function3(n, x, a, b); x void finction4(int n, float, char c); x void function5(int, a, int n); Which of the …

Member Avatar for NathanOliver
0
213
Member Avatar for syria718

[CODE]char main()/*Start of the function main???*/ { char choice1; char choices = 'y'; while(choices == 'y' && choices != 'n'){/*while loop initialization*/ print(); getchar(); scanf("%c",&choice1); printf("%c",choice1); switch(choice1){/*Switch case statement,,,*/ case 'a': case 'A': addContact(); break; case 'f': case 'F': search(contacts); break; case 'v': case 'V': list(); break; case 'e': case …

Member Avatar for Narue
0
272
Member Avatar for Riaz Haider

hey guys... i wanted to know how to make multiple conditions such that each condition has arange of values...i have written the following code but doesnt work help me quick plz. It is aPIC program for monitoring the ADC value and sending to LCD [CODE]if(ADRESL==0x00) {lcddata('O'); DELAY(2); lcddata('F'); DELAY(2); lcddata('F'); …

Member Avatar for Riaz Haider
0
307
Member Avatar for syria718

please help me fix these problem,,,, when i'm running the program it exits emediately [CODE]main()/*Start of the function main???*/ { do{/*do while loop initialization*/ print(); scanf("%c",&choice1); switch(choice1){ case 'A': case 'a': addContact(); break; case 'F': case 'f': search(contacts); break; case 'v': case 'V': list(); break; case 'e': case 'E': edit(contacts); …

Member Avatar for syria718
0
145
Member Avatar for Valiantangel

Hi can someone help in in understanding the following code esp the "?".I cant understand how the output 9:10:5 as obtained. Thank You. The code is as followed: [CODE]#include <iostream> using namespace std; int main() { short hour =9, minute =10, second =5; cout << (hour <10 ? "0":"" )<<hour<<":" …

Member Avatar for Narue
0
163
Member Avatar for rachelir

I have set up the following structs: [CODE]typedef struct lineList { int lineNum; struct lineList* Next; }*Line; typedef struct DictionaryList { char* word; Line lines; struct dictionaryList* Next; }*Dictionary; and then I have defined: Dictionary head = NULL; /*is a pointer to head of dictionary list */ Dictionary node = …

Member Avatar for arkoenig
0
203
Member Avatar for pril

[code]#include <stdio.h> #include <stdlib.h> int main() { int numbers[10] = {12,33,51,1,-1,97,7,23,0,-99}; sort(numbers,10); display(numbers,10); return 0; } void sort(int *numbers, int size) { /* Hop you could help me provide codes to sort the numbers. after calling this function, the numbers array in main should be sorted. hint: use the size …

Member Avatar for Narue
0
162
Member Avatar for learnersunakshi

[CODE]// Program Dictionary // Proogram that uses linked list to maintain a dictionary #include <iostream.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> #include <string.h> #include <ctype.h> class dict { private : struct node { char data[20] ; char m[100] ; int mcount ; struct node * link ; } *dic[22] ; …

Member Avatar for Agni
0
1K
Member Avatar for anithakc

Hi please find this simple program, not sure why realloc is not working and its causing memory leak. But if calloc and malloc is used with little changes it works fine. [CODE]#include "string.h" #include "stdio.h" #include "stdlib.h" char *mystrcat(char*, char*); void main(void){ char str1[] = "quick brown fox"; char str2[] …

Member Avatar for anithakc
0
349
Member Avatar for gujinni

[code]#include <iostream> #include <cassert>//what is the use of this??? #include <algorithm>//how to convert in turbo c++ and what is the use this??? #include <vector>//is this array in turbo c++??? using namespace std; int main() { bool result;// what is the use of this?? string s("abcde"); string s2("aeiou"); vector<char> vector1(s.begin(), s.end());// …

Member Avatar for gujinni
0
369
Member Avatar for sharathg.satya

can any one help me in solving a question posted by friend..... i tried to google but i didnt find the accurate answer for my question.. i wish to 'print 1 to n' without using loops and recursion help me please.. thanks in advance

Member Avatar for bajishareef
0
264
Member Avatar for siddiqui_1985

[code]#include<stdio.h> #include<conio.h> void main() { char gender,Mar_stat; int age; clrscr(); printf("Enter your Marital Status "ma" or "um":\n"); scanf("%c",&Mar_stat); if (Mar_stat == 'ma') { printf("Enter your Gender And Age :\n"); scanf("%c %d",&gender,&age); if (gender=='M' && age >= 30) { printf("You are Insured"); } else { printf("Sorry"); } getch(); } } [/code] …

Member Avatar for bajishareef
0
177
Member Avatar for happyhappyhappy

[code] void generalboard(); void inputuser(int*pt1, int*pt2,int*pt3); void checkwins1d(int*A,int*B, char C[][3][3]); void checkwinsup(int*A,int*B,char C[][3][3]); void checkwins3D(int*A,int*B,char C[][3][3]); void inputcomputer(int*pt1,int*pt2,int*pt3,char A[][3][3]); void score (int a, int b); void displayboard(int a, int b, int c, int i, int j, int k, char board [][3][3]); int main () { int i,j,k,a,b,c,computerscore=0,userscore=0,counter=0; char board[3][3][3]; generalboard(); …

Member Avatar for Arbus
-1
142
Member Avatar for rowley4

I am pretty new to programming. I am trying to write a code that counts the occurrence of a word, lists it and also the number of times it appears in a given text. This is what I have, but I can not get it to print the word once …

Member Avatar for babloo 123
0
467
Member Avatar for mark88211

this is what i have so far, i need to combine 2 c strings, print them backwards and figure out whether they are a palindrome or not. (the for loop is where i stopped, it could be wrong) [CODE]#include<iostream> #include<cstring> using namespace std; int main( ) { char s1[15], s2[8]; …

Member Avatar for bagi.padhu
0
420
Member Avatar for roneh96

I think I may have bitten off more than I can chew with this. I'm writing a program that will figure out the last position standing by continuously counting the positions using prime numbers till only one is left. [url]http://acm.uva.es/p/v100/10015.html[/url] is a link to the original problem. the code I …

Member Avatar for daviddoria
0
134

The End.