132,726 Archived Topics
Remove Filter ![]() | |
'''check addition''' from random import randint def checkAddition( a, b ): ans = int(raw_input("What is %d + %d ? " % (a,b))) if ans == a + b: return True else: return False def main(): x = randint(1,100) y = randint(1,100) if checkAddition(x,y): print "Correct" else: print "Incorrect" main()[B] [I]This … Software Development python | |
![]() | In my previous post I asked the forum to help me make a race with an existing program I had made. I figured out a way to do this but now I got an error and I cannot solve it. If you need any additional information just ask ^_^ Software Development java |
i want to assign a integer of 100 digit length to a object. like class hugeint { /// }; void main() { hugeint a,b,c; a=10000000000000000000000000000000....100; b=20; c=a+b; } can any buddy suggest me any simple idea to achieve this.. Software Development c++ | |
I was wondering if it was possible to use pygments with wxPython? I want to use it on the text_ctrl widget. If it is not possible on that widget but is possible on an other please tell me... Software Development python | |
Hello, all! I have a (hopefully) quick question: I have an array of 128 ASCII characters called blockData[] that I am trying to convert into a string. [code] for (int i = 0; i < 128; i++){ blockStuff = inFile.read(); blockData[i] = blockStuff; if (blockData[i] != 0){ String aChar = … Software Development java | |
hi, i'm working on windows application and sql serverCE database i write this code: [CODE] private void enregistrerBtn_Click(object sender, EventArgs e) { if (!exist) { SqlCeConnection conn = new SqlCeConnection(); conn.ConnectionString = @" Data source= |DataDirectory|\Database1.sdf"; try { conn.Open(); } catch (Exception ex) { MessageBox.Show(" connexion failure"); } finally { … Software Development open-source | |
Hi, If I want to pass values of one array to another array, is this the proper code implementation. any alternative or suggestions Thanks. . . . for ( i=0; i<9; i++) for (j =0; j<9; j++){ receive[i][j]=transmit[i][j]; } . . . Software Development c | |
Hey guys! I have my code wrote and when I run it, the code gets all the way to this point [code] //Delete Account 333411 cout << "Here you will delete the account 333411: \n\n"; AccountVector.erase (AccountVector.begin()+2); //Print the details of the vector for (int i = 0; i < … | |
i am new to Java and programming i just joined faculty of computer science and i am doing good but i think that all what i had until now isn't enough for my curiosity what should i do to master Java and become a Java expert and increase my programming … Software Development java | |
ok so what i am trying to do is create a random int and save it into an arraylist and sum up the contents of the array list. then ask the user if they would like to roll again. any point in the right direction would be appreciated. so far … Software Development java | |
public class MyDeque { private int maxsize; private int [] queArray; private int front; private int rear; private int nItems; public MyDeque (int s) { maxsize = s; queArray= new int[maxsize]; front=0; rear=-1; nItems=0; } public void insertRear(int j) { if (rear==maxsize-1) rear=-1; queArray[++rear]=j; nItems++; } public void inserFront (int … Software Development java | |
hi. 2 all anyone can tell what is the wrong with this code? the result of this program is : cos(60)=-0.952413 sin(60)=-0.304811 [code]#include <iostream.h> #include <math.h> main() { float x,y,z; y=cos(60); z=sin(60); cout<<"cos(60)="<<y<<endl; cout<<"sin(60)="<<z<<endl; }[/code] cheers Software Development c++ | |
i have to creat a program that verifes a valid user id before printing out the new email address. here are my errors: [CODE]c:\users\rena0514\documents\visual studio 2005\projects\user_id\user_id\verification.cpp(50) : error C2664: 'strncpy' : cannot convert parameter 2 from 'std::string' to 'const char *' 1> No user-defined-conversion operator available that can perform this … Software Development c++ email visual-studio | |
Hi I've been told that for the next term i must do a programming project of my own choice. Any ideas on how I can impress? Software Development java ![]() | |
[code]#include <iostream> using namespace std; #include <iomanip> #include <string> int main() { string name; string number; double bonusContributed; const int FW = 10; double const ticketPrice = 5; int ticketsSold; double revenuePercentage; double moneyDistributed; double revenueGenerated, adminDeduction, balanceRaised; cout << "How many tickets were sold? "; cin >> ticketsSold; cin.ignore(); … Software Development c++ | |
[CODE]char **makeString ( const int numOfArrays, const int sizeOfEachArray ) { /* Function to create an array of strings: ( Array of pointers to strings ) */ /* Local variables */ int i, j; //int numOfArrays = 6; /*char stringsToCopy[6][12] = {"Hello", "Good-Bye!", "Greetings", "Pointers", "Arrays", "Programming"}; */ char **stringArray … Software Development c | |
I wrote a simple echo program, which reads standard input character-by-character and then prints it to standard output character-by-character. [code] #include <stdio.h> int main() { int c; while ((c = getchar()) != EOF) { putchar(c); } return 0; } [/code] I was expecting it to break out of the while … Software Development c | |
I'm very new to C++, my midterm is requiring me to read from a txt file I created line by line. Each line has different subject code that requires some calculations. My understanding was that you open your file and read in the first line in the file, thats the … Software Development c++ data-structure file-system | |
Here's the program I wrote not using a procedure: [CODE] .data target BYTE "aabccdeef", 0 freqTable BYTE 256 DUP(0) space BYTE " ", 0 .code main PROC mov edi, OFFSET target mov esi, OFFSET freqTable mov ecx, LENGTHOF target mov eax, 0 L1: mov al, [edi] movzx eax, al mov … Software Development assembly | |
Hello, I am getting a linking error, and I'm not sure what its referring to. Here is the error 1>Main.obj : error LNK2019: unresolved external symbol "public: void __thiscall BinaryHeap,class std::allocator > >,class Comp,class std::allocator > > >::insert(class Item,class std::allocator > > const &)" (?insert@?$BinaryHeap@V?$Item@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@@V?$Comp@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@@@@QAEXABV?$Item@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@@@Z) referenced in function "public: void … Software Development c++ | |
I am trying to print out the number of occurences for each alphabetic chracter in a file that our instructor provided us with. The values range from 1 to 999. I'm trying to print out "count[...] : " followed by the character. So far my counts are correct. However, at … Software Development c | |
![]() | I just started this program a few hours ago, and I am running into an error that I do not understand. I tried finding an answer on Google as well. First off, this is the bare bones of a code right now. I have not started any of the sub-functions … Software Development c data-structure ![]() |
I've written a little method that returns the index of the maximum of 3 numbers (0, 1 or 2): [CODE] public static int Max3Index(float val1, float val2, float val3) { int index = val1 > val2 ? 0 : 1; if (index == 0) { index = val1 > val3 … Software Development | |
Hi guys, I have a weird issue here. I'm writing an automated backup program that, well, performs automated backups of set folders to a set location. It has a GUI and a Windows service. The service has a timer (system.timer) that checks every 10 seconds whether a backup needs to … Software Development gui | |
[CODE]#include <iostream.h> #include <fstream.h> #include <stdlib.h> #include <string> using namespace std; //const int MAX_SIZE = 10; //char determine_grade(int smarks); class student{ public: student(); //constructor ~student(); //destructor //char grade; //set values void set_mark(int); void set_id(string); void print_students_records(student, int); //get values int get_mark(); string get_id(); private: int mark; string id; }; //void … | |
Hi There, i am using the shell function to execute a program that will zip 10 big data files. so my code is something like this: for n = 1 to 10 t=shell(zip data(n)) 'not the real code ' somewhere here, i need a code to test if the data(n) … Software Development visual-basic | |
I cannot figure this out. Can anyone see what is causing the problem? This is the error I get when I try to compile with the GNU compiler: sortQS.h: In function âvoid sort(UList<U>&) [with U = int]â: test.cpp:13: instantiated from here sortQS.h:16: error: ârecQSâ was not declared in this scope … Software Development c++ | |
does someone know a code in c that will send a complete ASCII file in 128 byte packets to another file? So The sender takes the ASCII file as input and sends a 128 byte packet on the data queue | |
i have been working on this code [code=syntax] '''Calculate the cost of fuel for a road trip''' def main(): distance = float(raw_input("Enter distance in kilometres: ")) litresPer100K = float(raw_input("Enter economy (ltr/100km): ")) pricePerLitre = float(raw_input("Enter fuel price per litre ($): ")) cost = distance / 100 * litresPer100K * pricePerLitre … Software Development python | |
Hey!! I gotten the hang of C programming, logic design n all.. But am having real trouble understanding C++ concepts... My sems are up in a month! Any suggestions on how do i get it done before that??? | |
Hi Ijust started learning c# windows forms and when i set soe data open a new form and get the data into the label the label dissappears.can some one help me please [code] private string greeting; public string Greeting { get { return greeting; } set { greeting = value; … Software Development c# | |
Does the array fine but when it does the function it wont work, if anyone can help that would be great! [CODE]#include <iostream> using namespace std; void reverse(int a[10], int size) { for (int j=0; j<size/2; j++) { int temp = a[j]; a[j] = a[size-j-1]; a[size-j-1] = temp; } return; … Software Development c++ | |
Okay so I have been trying to get this program to work for a long time. Basically it reads a text file then populates a structure that is designed to point to the four locations around that object: up, down, left and right. I believe I have the program figured … Software Development algorithm c++ data-structure microsoft-access queue | |
Hey, I have a really big file on my computer, this file only got words in it. And because the file is really big, I sure there are repeted words in there. Is there a way of deleting every single repeated word, leaving at least one? Every single word is … Software Development python | |
Hey guys I am trying to work on some linked list stuff and I have my code put together but I wanted to post it on here and just check to make sure I am going in the right direction. Here is what I am trying to do: Create a … Software Development algorithm c++ linked-list | |
| |
How would one use Python as a PHP alternative? If there a hello world example somewhere? | |
Hi everyone, I am trying to save ip addresses and mac addresses of a node in a structure.I dont know how to assign values.Please help. [CODE] #include <stdio.h> #include<iostream> #define nodes 15 using namespace std; struct nodes_struct { char ip[19]; char mac[19]; } ; int main() { char ip[19],mac[19]; nodes_struct … Software Development c++ | |
hi i m mateen frm india i have a problem with my java compiler i want to know how to set the path of compiler and how to execute the program i have already installed the java software someone answer to my question and help me out Software Development java | |
[B]System:[/B] Vista What I want to do is to catch the mouse release event, which I have researched for but nothing useful came up. I found out the way to catch the pressed event: [CODE] #include <windows.h> #include <iostream> int main() { // Grab a handle to the console inputbuffer … Software Development c++ pc-peripheral windows-vista | |
Hi, just hoping someone can shed some light on the best way to read from a text file. I wish to create a program that will grab out specific words/numbers when chosen. I need to be able to extract data from different fields but also be able to determine if … Software Development python | |
Hello I am trying to use a MySQL database and connect to it using a Desktop App. I need to have it embedded and I am using netbeans and I am connected to the database I am also in the admin console for glassfish. I tried setting it up once … Software Development java | |
i am having this problem related to function implementation. my program is about sending an unread sms string to a bluetooth module and after sending the strings of sms messages it will mark the unread messages as read then move to a sms notification function that will notify me is … | |
Hi, I'm trying to do something pretty straightforward (I think) but it's not working for me for some reason. Basically trying to create an object with an ArrayList as a attribute but i keep getting numerous errors saying '<identifier> expected', '; expected'. My code is as follows: [CODE]import java.util.ArrayList; public … Software Development java | |
Hello, the code I am posting sorts a pivot table but there can be only one statistic per row e.g Mean or Count. I often have multiple statistics per row e.g Mean, Mode etc... . I often have to generate multiple, long, pivot tables and to sort them manually is … Software Development python | |
Hi all, Im having a little trouble. I have to write a program that will input a string of positive integers terminated by a negative integer and then sort it.I have done the sorting part and it works fine.But the part that the string continues to get integers unless a … Software Development c++ | |
Hello, If I wanted to pass the two arrays below into a function and multiply them and return the two dimensional array how would I go about doing that? If anyone can give me an example I'll go with that. Thanks! [CODE]Public Class frmTotalDailySales Dim ItemCost() As Decimal = {12D, … Software Development vb.net | |
I have this question and might look stupid indeed, but bear with me. I have files in this hierrachy ProjectFolder/Panel/panel.h ProjectFolder/Panel/panel.cpp [B]AND[/B] projectFolder/Search/search.h projectFolder/Search/search.cpp I want to include search.h in panel.h I have tried many thing including [CODE=C++]#include "./search/search.h" #include "../search/search.h"[/CODE] but I have failed. Any suggestion on how to … Software Development c++ | |
Hi im trying to run "ipconfig /all" in vb this is the code i have but the window closes down after it has completed the command is there away to keep the window active until the user wants to close it? [CODE]Dim Command As String Command = "ipconfig /all" Shell("cmd … Software Development vb.net | |
Hi. I have this kind of common problem, but cant find a solution for it after many google searches. What i want is this: [CODE] ArrayList items = new ArrayList(); items.add(item1); //the item object contains several properties items.add(item2); items.add(item3); foreach (item i in items) { Create and edit a new … Software Development |
The End.