43,549 Solved Topics
Remove Filter ![]() | |
1. [code] #include<stdio.h> int main() { int function(int); int t=function(1); printf("\tt=%d",t); t=function(2); printf("\tt=%d",t); t=function(3); printf("\tt=%d",t); return 0; } int function (int a) { int t; t = a<<2 + a; return t; } [/code] the output is t=8 t=32 t=96 i am not able to figure out why this is … Software Development c | |
I have a clarification, with my project I added a dataset ,is having dataset [xsd] file name- DataSet1 and datatable table name -datatable1, also it's having the fields "id,item" with my form I have coding Dim ds As New DataSet1 Dim t As DataTable = ds.Tables.Add("datatable2") t.Columns.Add("id", Type.GetType("System.Int32")) t.Columns.Add("Item", Type.GetType("System.String")) … | |
Hello, I've written couple of overloaded operators in my file containing Set declarations. I want to use these operators within the declaration file. However it seems it isn't used. Instead it uses the standard operators. e.g. i have two overloaded operators say <= and == [code=cpp] bool Set::operator<=(const Set& b) … Software Development c++ | |
Hey guys, I was wondering, with this code: main.cpp [code=cpp] #include <iostream> using namespace std; class car { public: car (float speed) : speed(speed) {} car () : speed(0) {} void cruise(float speed) { this->speed = speed; cout << "New speed: " << getSpeed() << endl; } void brake(float power) … Software Development c++ ![]() | |
hi guys, i have a pocket pc application where i scan some barcodes, i want to stop scanning when i open a new form. do you have any ideas how to stop it? Software Development | |
i was wondering if it would be possible to use a timer in pascal. like for instance you have 10 seconds to answer a question. iv been thinking and i cant figure out how to do it. does anyone know how? Software Development pascal | |
hi guys,, i've this homework that i have to submit tomorrow.. and unluckily I didn't know how to do it.. it says : Write a program that outputs "Al Eid Song" words.. "The five days of Al Eid" Use a [B]switch statement [/B]to display the following output for the 5 … Software Development c++ | |
All questions involve this portion of a program: [CODE] if (y>x and y<z)or(y<x and y>z): print("You have entered Condition 1") elif not(x!=y and y!=z): print ("You have entered Condition 2") else: print ("You have entered Condition 3")[/CODE] 1. If x = 10 and y = 10, what is the value … Software Development python | |
Im having a problem with the while loop in my code, if I change what X2 is being compared to to anything other than 0 it doesnt hit the while loop, I am hoping its just some weird mistake. Thanks in advance for any help. [CODE] X2 = 0.5; while … Software Development c++ | |
[CODE]public abstract class CircleShape { public double radius; public CircleShape(){} public CircleShape(double radius) { this.radius=radius; } public void setradius(double radius){ this.radius=radius; } public String toString() { return "radius"+ radius; } abstract String getDisplayText(); } [/CODE] [CODE]public class circle extends CircleShape{ private double area; public double area() { return radius*radius*3.14; } … Software Development java | |
Hello all, I'm trying to make a simple text box with SDL, I have loosely based it off of [URL="http://lazyfoo.net/SDL_tutorials/lesson23/index.php"]The Lazy Foo Tutorial on sting input[/URL], but this code doesn't seem to work... [CODE]if(event.type==SDL_MOUSEBUTTONDOWN){ if(isIn(event.button.x,event.button.y)){ hasFocus=true; } else { hasFocus=false; } } if(event.type==SDL_KEYDOWN){ if(hasFocus){ if(event.key.keysym.sym!=SDLK_BACKSPACE){ str+=(char)(event.key.keysym.unicode); } else { if(str.length()!=0){ … Software Development c++ | |
ok iam working on a password protection for my program but i have a problem..... if the user set wrong password the program do this Wrong password!! The program will be terminated in 5 seconds but i want sec, (which is my seconds) at every second - 1 5-4-3-2-1 without … | |
Is there any way to mix visual c++ with normal c++? like can i enable mixed code? i want to get rid of this error: 1>tab.h(32) : error C4368: cannot define 'p' as a member of managed 'Monitor4vc::tab': mixed types are not supported | |
Hello, This is my first time using forum to ask around for some assistance. I will make it briefly. [code] void main() { char *StringPtr; //pointer of char char String[26]; //array of chars strcpy(String, "abcdefghijklmnopqrstuvxyz"); if((StringPtr = new char[26]) == NULL) cerr << "\n\a allocation failed" << endl; else cout … Software Development c++ | |
hi. I have a jlist on a frame. I want to add items dynamically in the list. So, I am using DefaultListModel..Here's my code: [CODE]public class AdminFrame extends javax.swing.JFrame { private Statement S; private ResultSet R; DefaultListModel model = new DefaultListModel(); JList Employee_list = new JList(model); /** Creates new form … Software Development java java-swing | |
Dear friends I have a conversion from ascii to binary while when i use my input which is like this : 16078 16283 0.3708 16078 16837 0.4514 16078 17820 0.4038 16078 17906 0.3695 16283 16837 0.3905 16283 17820 0.4343 16283 17906 0.3262 16837 17820 0.5291 16837 17906 0.6245 17820 17906 … | |
Hello! I'm having the following problem: My application uses an SQL sever, and I entered the connectionstring in a .settings object. It warned me, that it's a security risk, etc. When I publsih my app, two files would be deployed, an .exe and a .config file, which contains all of … Software Development | |
Hello, this is my first time in participating in this forum and also this is the first time that I've used Java for my entire life. The objective behind my problem was: "Create an Animal Interface that has two methods: eat and move. All these methods do not have any … Software Development java java-swing | |
hello im having problem trying to get this to do what i want it to do. after the program asks if the user has had any work up to date, i want it to ask for specification if the answer is yes, or go to a next question if no. … Software Development c++ | |
im trying to write a program to see if two lists are equal im really kinda lost at the moment, i havent gotten the compare function yet but i think that should be pretty easy, but im having some errors which u can see. [code=C] #include <stdio.h> #include <stdlib.h> typedef … Software Development c | |
I'm trying to compare two variables that is being inputed by the user but then it wont function [code] if (txt_pay.getItem() < txt_amount.getItem()) { jOptionPane1.showMessageDialog(this, "please enter the right amount"); } [/code] what could be wrong? the error says [quote] operator < cannot be applied to java.lang.string [/quote] another one … Software Development java | |
hi, i have just written a simple hello world java program in my linux server, installed jdk ... and tried to compile and run it and it gave me some errors. please details below: [root@localhost javaFiles]# cat HelloWorld.java [code] import java.util.*; import java.io.*; public class HelloWorld { public static void … Software Development java | |
I have a very simple one line function and i want to replace it with macro, but macro doesn't seem to work. Function: [CODE=C]int stack_empty(stack ** this_stack) { return *this_stack == NULL; }[/CODE] Macro i am trying to use: [CODE=C]#define stack_empty(x) (*x == NULL)[/CODE] Anybody knows what i am doing … Software Development c | |
Hi, I have been exploring doing some GUI programming with the wxWidgets toolkit as i am used to that from programming wxPython in python. I am doing the tutorials from zetcode and i am very mystified. (i think i spelt that wrong). This is the url [url]http://zetcode.com/tutorials/wxwidgetstutorial/menustoolbars/[/url] Its the first … | |
Hi everyone, I have been working with Matlab but now I have to develop a couple of programs in Python. So I am new to Python. Could anyone tell me the python equivalent of [B]eval [/B]command of Matlab. Actually I have to open a set of say 100 files to … Software Development python | |
Hi, I have a scenario wherein I need to give access of a system to the hosts of a subnet. For that I need to verify if the incoming request is from the IP which falls within the subnet. Is there some way to do that automatically using c# functionality. Software Development | |
Im really confused, I had this recursive add function working but my teacher wants us to be able to use ++ instead of + 1... anyone know why im getting a segmentation fault on this, i feel like this is a really dumb mistake. [code=C] int add( int n, int … Software Development c | |
I have two Windows forms. Form1 has a button which, when clicked on, opens up Form2 (which looks like a drop down/combobox type of control). Form2 is a grid of buttons that look like a telephone keypad. When one of these buttons is clicked on, Form2 closes and the text … Software Development | |
I am using OpenGL and i am trying to get this simple program to work, here is my code; [code=c++]void DrawScene ( void ) { glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glMatrixMode ( GL_MODELVIEW ); glLoadIdentity ( ); //Triangle glPushMatrix ( ); glTranslatef ( -1.0f, 1.0f, 0.0f ); glBegin ( … | |
I am trying to: [B]Implement an iterative Python function which returns the sum of the first n integers[/B] so far i have this: [code] i = 0 total = 0 def sum(n): while i <> n: total = total + 1; i = i + 1; return total [/code] then … Software Development python | |
What are and how do I use vectors ? I have read some tutorials on them but I don't understand fully how they work. Software Development c++ | |
Hello, I developed an application in VC++ an now I want to compile it using GNU++ to be run on a ubuntu server (where I am actually trying tocompile it). After some syntax/usage corrections I get an error which I totally don't understand (and I don't have it in VC++, … | |
i am facing several problems.... first one is: how do i typedef a structure i've seen many ways to do it but im not quite sure which one is the right one. this is what i think how it goes (but dont know why it goes that way) [code=C] typedef … Software Development c | |
Hello I have created a sucsessful prime number finder however I wish to retrive the start number from a file the last line shows how I tried to do this however it failed any solutions ? [code=C++]/* By Kelechi Nze My first prime project*/ #include <windows.h> #include <iostream> #include <fstream> … Software Development c++ | |
Please tell me what do you think of the written code below, is it easy to follow? Does the code tells you what it does, or you have struggled realizing whats going on? and so on. Feel free to give suggestions, tips, advices and criticize! This will help me and … Software Development c++ | |
Hi, I have a client application that communicates with other server modules residing on other machines. In client application, I need to know the IP address of the machine it is running on, so that it would communicate its IP to the server module(which could be separated from client by … Software Development client-server | |
Going through one of my old .c file I have a line as follows: scanf("%i", &tside); I would like to convert it c++ code. Can someone show me how to do that? Sincerely, greg022549 Software Development c++ | |
Can some suggest a good way to cleanup the HTML that is output when a perl script is run using the CGI module? I tried to install HTML::Tidy, but couldn't as i was missing libtidy. And I don't want to go through 700 lines of code and putting up loads … | |
1. Simple calculator - nothing fancy [code]/**program description: * * simple calculator written for beginners. * This program asks user to enter an arithmetic * expression that contains two numbers and one * operator. User will be given the result of the * calculation. Operators allowed to be used * … Software Development c++ | |
Hi mates :) how are you? I hope everything is all-right.. ;) I have a small question, it is my HW to be honest here is the question: "Write a method that calculates the following equation: f(x) = 1 if x = 0,1 √ f(x-1) + √ f(x-2) if x … Software Development java | |
this simple cout statement and i do not know why. the outputs are mixed up and i get some random numbers i didnt even input.please help [code=cplusplus] #include <iostream> #include <string> using namespace std; int main() { string Pname, CEmployer; int age; cout<<"Patients Name:"<<endl; getline (cin, Pname); cout<<"Age:"<<endl; cin>>age; cout<<"Current … Software Development c++ | |
Hi, I am only beginning C#, so bear with me. I have been given this program to write. This is the question: Write a C# application called WRITENUM that inputs a number between 0 and 2,000,000,000 inclusive and outputs that number in textual form, as we would say it or … Software Development | |
my task is to sort the input numbers from lowest to highest but i just cant make it work... i've tried different ways and I know there's a problem in my code. hope you can help me out. thanks! [code] #include <iostream.h> struct trial { int age; } getcount[5]; void … Software Development c++ | |
Hello everyone, I'm rather new at C# and programming in general, I have some experience with Java, PERL, and Python but I wouldn't consider myself an expert on any of them. I'm using C# because it is very similar to Java and it seems to be even easier to make … | |
Hello there, I've a homework assignment from a while ago that asks [B]"Implement a recursive Python function which returns the sum of the first n integers"[/B] Now i just dont know exactly what it's asking and how to get started. Recursive functions, right (my thoughts so far is it'll look … Software Development python | |
I have an application I'm building that requires the use of array.binarysearch() to find strings from a combobox in an array and return the index value of the selection. Ie. the user selects a name from the combobox. I now need to use the name they chose and search an … Software Development | |
need help on this question: Write a lexer to read in decimal numbers. If your input is the following string: “12345.9876” what do you have to do to each character in the string to generate your float? How are the numbers before the decimal point different to the numbers after … Software Development python | |
Hey, I'm a high school student who is fairly programming and I was curious as to how to input a single character without entered an End of Data marker (e.g. newline character/Enter) [CODE] #include <stdio.h> #include <stdlib.h> #include <ctype.h> int main () { char ch; switch (toupper(getchar())) { case 'A': … Software Development c |
The End.