132,726 Archived Topics
Remove Filter ![]() | |
I'm new at programming and I can't figure this out. Can anyone please help? #include <iostream> #include <fstream> #include <string> using namespace std; bool nocase_compare (char c1, char c2) { return toupper(c1) == toupper(c2); } int main( int argc, char* argv[] ) { ifstream infile; string filename; do { cout … Software Development c++ | |
How would I go about converting a string to an integer? Say someone enters a 4 digit string. Like 1234. Could I use the place of each digit and work with it? Pretty much, I wanna get 1 from the string "1234" and put it in a variable. Then get … Software Development java ![]() | |
Okay so I have an array of Objects.. My goal is to get the output to print every "Song" the user inputs But for some reason only the last song in the array is printing which is confusing me [CODE] import java.util.*; import java.util.Arrays; public class SongRunner1 { public static … Software Development java | |
Hi i've just started to use constructors and I'm having some problems with the following code with data not saving(saving to the correct place) please Help :( [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> typedef struct details // struct for all data { char name[50][50]; char card[50][16]; long sort[50], … Software Development c | |
if been using python's tkinter for awhile to write programs when I caused an issue that I'm not sure what is my code is long even after I gutted it. [CODE]from Tkinter import * import random import operator info_dict = {} info_dict["area"] = 1 info_dict["slime_spot"] = random.randint(1,36) info_dict["slime spotter"] = … | |
Write a program to sort 20 decimal numbers in decreasing order and print the result. i have solution but lengthy. [CODE]decimal[] arr = { 12.3m, 45.2m, 5.4m, 23.44m, 43.21m, 31.34m, 4.3m, 21.3m, 34.2m, 32.1m, 44.2m, 6.4m, 64.3m, 3.4m, 5.32m, 32.345m, 4.34m, 23.4m, 45.234m, 5.31m }; for (int i = 0; … Software Development | |
Hey, So basically I'm using dynamic memory allocation, and I wanted to add in a check for if the [B]new[/B] operator can't complete the request. I've read up that the operator will return a std::bad_alloc, but I've no idea how that helps me. Could I just do?: [CODE]if (new int[999] … Software Development c++ | |
Hi, everyone this is my first post here and let me tell you my problem I have a C# application, i have SQLServer 2005 installed on my computer my database is there and the program works fine the problem I'm facing is that i need to make an installer for … Software Development c c# c++ client-server sql | |
I have been working on this project for a while and need help understanding why I get the results I do. First the display of the after compiling the code: Enter the employee's name: Bob Green Enter the employee's number: 112 Enter the date the employee was hired: 01091989 Enter … Software Development c++ | |
Hi guys, I am trying to write C++ method to return a pointer to the parent of a particular node in binary tree, and for the root that doesn't have a parent should return NULL. Here is my program so far: [CODE]#include <iostream> using namespace std; class Tree { private: … Software Development c++ | |
so i am creating this message field with [CODE]self.text = wx.TextCtrl(panel, pos=(150,22),size=(100,20))[/CODE] and it works, no problem but i'd like that the text gets written from the right and not the left which is a pain... anyone have a slight clue on how to do it ? help appreciated :) Software Development python | |
I need help trying to get the majors "CSAT" and "ISAS" into the Majors/Concentration column and then have the corresponding course numbers with commas. Any Help XML Code [code]<?xml version="1.0"?> <!-- coursinfo.xml, uses three XSLT stlyesheets to create the desired view of the data ITEC 325 - assignment --> <?xml-stylesheet … | |
I am very new to C++ need to draw rectangle "JUST THE BORDER" using for loops, the below code draws three sides but i am not able to draw the right side line please help if anyone can. #include <cstdlib> #include <iostream> #include <string> using namespace std; int main(int argc, … Software Development c++ | |
Hi all professionals, I uesd subprocess module to spawn a new process and then implement the command. The final result is the output via stdout. Here is the code I wrote: [CODE] import subprocess proc = subprocess.Popen('egrep '^HTTP/' *', shell=True, stdout=subprocess.PIPE,) stdout_value = proc.communicate()[0] print 'results:' print stdout_value [/CODE] And … Software Development python | |
Hello, I would like to know if I need to use a regular expression to match the desired substring in order to print out 10 characters of the start codon ATG. My dna sequence is "CATAGAGATA" Thanks for any advice. Software Development perl | |
the file looks like: 11/29/2010 S 2907 1 11/29/2010 S 9673 4 11/30/2010 A 4321 30 11/31/2010 S 9673 12 12/01/2010 N 5789 wind_chimes 13.54 17.83 12/02/2010 S 5140 5 How can I extract out "2907" from file using >>? i think its myfile >> then something. #include <iomanip> #include … Software Development c++ | |
Here's my problem my assignment is to create a tic tac toe game with classes included (public and private) with only a few functions in int main. [CODE] #include <iostream> #include <string> using namespace std; class cgame { private: int iTurn; int turns; int gameWon; int i; public: bool validMove; … Software Development c++ | |
Hello. I'm new in Python and I only want to use basic programing skills. I have this example code: [CODE] list_a = [a, ] * 15 list_b = [b,] s = 5 n = 2 [/CODE] and want to obtain this: [CODE] [b,b,a,a,a,a,a,b,b,b,b,a,a,a,a,a,b,b,b,b,a,a,a,a,a,b,b] [/CODE] basically I want to insert list_b … Software Development python | |
[CODE]#include <iostream> #include<string> using namespace std; class Book { private: string title; double price; public: Book(); void setTitle(string s); void setPrice(double p); string getTitle() const; {return title;} [/CODE] [ICODE]error code C2059(syntax error: '{' ) and C2334(unexpected token preceding '{' skipping apparent function body occur [/ICODE] [CODE]double getPrice() const; {return price;}[/CODE] … Software Development c++ | |
Please help the code compiles but then gives runtime error and I have no Idea why please help with the insert of the book the .h file [CODE]#ifndef BOOK_H #define BOOK_H #include <string> #include "Person.h" using namespace std; struct node { node *left; node *right; Person data; }; class Book … Software Development c++ | |
[CODE] C={} D={} C['21600']=[{'vid':1,'route':[11,12,13,14,15]},{'vid':2,'route':[21,22,23,24,25]}] C['23500']=[{'vid':3,'route':[31,32,33,34,35]},{'vid':4,'route':[41,42,43,44,45]}] #D['21600']=[{'vid':1,'route':[11,12,13]},{'vid':2,'route':[23,24,25]}] #D['23500']=[{'vid':3,'route':[31,32]},{'vid':4,'route':[45]}] D=C for n in D: for n2 in D[n]: if n2['vid']==1: n2['route'].remove(14) n2['route'].remove(15) elif n2['vid']==2: n2['route'].remove(21) n2['route'].remove(22) elif n2['vid']==3: n2['route'].remove(33) n2['route'].remove(34) n2['route'].remove(35) elif n2['vid']==4: n2['route'].remove(41) n2['route'].remove(42) n2['route'].remove(43) n2['route'].remove(44) print 'Printing D ', D for u in D: for u2 in D[u]: print len(u2['route']) … Software Development python | |
So I have the y and e endings down, just need some help with the middle. Basically, I need to double the last letter before adding er if: the last letter is b,d,g,l,m,n,p,r,s or t and the second to last letter is not the same as the last letter. [CODE]def … Software Development python | |
hi, i have to rotate an image. the image is stored in an image[rows][cols] array.. i am trying to rotate it using trignometric functions. i am not sure what happens when i rotate the image, does the address of the pixel vary or the value of the pixel vary. and … | |
// Daryl Sanderson & Ladarius White //Tic Tat Toe //Professor Cook //Programming II // 11 am #include <iostream> using namespace std; int main () { char square1 (' '); char square2 (' '); char square3 (' '); char square4 (' '); char square5 (' '); char square6 (' '); char … Software Development c++ | |
Alright im trying to create a program that allows the user to input numbers into an array and then will take the average of all the numbers within the array but im getting very strange results any help is much appreciated [CODE]#include <stdio.h> #include <stdlib.h> #define SIZE 9 int main(void) … Software Development c mathematics | |
hello someone out there...help me with algorithm to determine range of marks!! here is my code so far [ICODE]#include <iostream> #include <fstream> #include <string> #include <iomanip> struct stumarks { int studentid; int progassn; int lab; int test; int exam; char seperator; double finalmark; } stumarks[9]; using namespace std; int main() … Software Development c++ | |
Hi I am trying to compile and run my prog3.c program, but I am getting the compiler errors below. I have tried to reference the information by doing #include "node0.c" etc., but no luck. Any ideas on how to fix this problem? I attached the files below that I am … Software Development c++ | |
I just dont know where to start on this. Can anyone lend me a hand? 4- Write a Java program to create the following array that hold the salaries of employees: 1550.8 2439.5 1800.75 2890.0 The company wants to give the employees a bonus of 30% of their initial salary, … Software Development java | |
Hi, I'm a newbie to programming in general. I want create two functions to read and write dat from one file to another file. Function read will read dat from file to buffer, and funtion write these data from buffer to another file. These functions work parallel, it means: Function … Software Development c file-system | |
I have this code in here: [CODE]#include <stdio.h> #include <conio.h> #include <string.h> void array_input(int *a) { int i=0,n,p; printf("How many items you wanna input? : "); scanf("%d", &p); for(n = 0; n <= 99; n++) if(*(a+n) != 0) i++; for(i; i<(i+p); i++) { printf("Enter %d number:",i); scanf("%d", &(*(a+i))); } } … Software Development c | |
i have the following array: [CODE] int[,] simpleArray =new int[,]{ {1,1},{1,2},{1,3},{1,4},{1,5},{1,6},{1,7},{1,8},{1,9},{1,10},{1,11} , {2,1}, {2,11}, {3,1}, {3,11}, {4,1}, {4,11}, {5,1}, {5,11}, {6,1}, {6,11}, {7,1}, {7,11}, {8,1}, {8,11}, {9,1}, {9,11}, {10,1}, {10,11}, {11,1},{11,2},{11,3},{11,4},{11,5},{11,6},{11,7},{11,8},{11,9},{11,10},{11,11}, }; for (int i = 0; i < 11; i++) { for (int m = 0; m < 11; … Software Development | |
As a beginner of C++, i cannot handle this project smoothly, please correct my code! Write a class of fraction. Your fraction should provide the methods read(), print() and the friend operator +. The read() method will read from the keyboard the integral part, the numerator and the denominator respectively. … Software Development c++ | |
Hi Guys, I just want to ask you if you have any GOOD and EASY to understand Ms Access Tutorial. Since I am new in VB.Net, I would really want to know how to do that. I wish to have a tutorial how to ADD,EDIT,DELETE,VIEW I hope you can give … Software Development vb.net | |
I'm trying to parse xml file and convert all the unix timestamps in it to datetime... [QUOTE]<Sample> <TimeStamp>1291052077</TimeStamp> blah blah blah blah </Sample> <Sample> <TimeStamp>1291052077</TimeStamp> blah blah blah blah </Sample> </Content>[/QUOTE] [CODE]import fileinput file = raw_input("Enter file: ") file = open(file, "wb+") for line in fileinput.FileInput(file,inplace=1): if "TimeStamp" in line: … Software Development file-system python unix xml | |
need an xslt for a collection control that produces the below: <ul> <li>{quicklink}</li> <li>{quicklink}</li> <li>{quicklink}</li> <li>{quicklink}</li> <li>{quicklink}</li> <li>{quicklink}</li> <li>{quicklink}</li> <li>{quicklink}</li> </ul> <ul> <li>{quicklink}</li> <li>{quicklink}</li> <li>{quicklink}</li> <li>{quicklink}</li> <li>{quicklink}</li> <li>{quicklink}</li> <li>{quicklink}</li> <li>{quicklink}</li> </ul> The key here is to have a count on the items. After the 7th item, it needs to start … Software Development xml | |
hello everyone. so im on my second semester of c++ and am having lot of problems as the class begins to involve more and more pointers(:@). we were assigned a program that created a structure for course grades. it was asked that we dynamically allocated an array for the tests … Software Development c++ | |
hi, so i've been looking for a string matching algorithm that gives me a "rating" based on how close the 2 strings match.. luckily, i googled and read this article: [URL="http://www.catalysoft.com/articles/strikeamatch.html"]how to strike a match[/URL] here's the original java class code [CODE=java] package strike_a_match; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; … | |
btw any tutorials out there on how to create database with vb.net with mssql just to let me get started, i was hoping for a simple db to practice on like id,name. ive made db with php and mysql but vb.net is a bit far from php and mysql though … | |
What are some practical ways to resolve legacy code in an n-tier architecture where all of the code is written in self-referencing web services? So far, much of the code is undocumented, uses old VB6 conventions, and there are very long procedures. What's the best way to approach, let's say, … | |
I have written a function that calculates an area from coordinated stored in vector arrays: [CODE]void areaCalc(int corners, vector<float> x, vector<float> y, float& area) { float sum=0; for (int i=0; i<=(corners-2); i++) { sum+=(((x[i])*(y[(i+1)]))-((x[(i+1)])*(y[i]))); } sum+=(((x[(corners-1)])*(y[0]))-((x[0])*(y[(corners-1)]))); area=0.5*sum; }[/CODE] The problem is that when I compile it I get this warning … Software Development c++ | |
/* I have a problem with my class matran, when I make "(A+B)*(D+E)" it's no result */ /* help me to correct it */ #include<iostream.h> #include<math.h> #include<iomanip.h> using namespace std; class matran { int n,m; double A[20][20]; public: void nhap(); void in(matran); matran operator+(matran); matran operator-(matran); matran operator*(matran); }; //////////////////////////////////////////////////////// … Software Development c++ | |
plz.. help me .. how to arrange the set words in aphabetical order in c.its confusing me Software Development c | |
Hello, First of all, I hope my post isn't breaking any of the forums' rules Here's my code so far [CODE]import java.util.Scanner; /** * * @author user */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner sc = … Software Development java | |
I usually make enumerations separate from classes, but when my CS teacher was teaching us about enums, he put it inside the class, and when it came time to set a variable of the enum outside of the class, he told us to just pass a string to the class … Software Development | |
The program runs but only switches the player once [CODE]#include <iostream> #include <string> #include <cmath> #include <ctime> #include <cstdlib> using namespace std; class TicTacToe{ public: TicTacToe(void);//constructor void playOneGame(void);//member function void switchPlayer(char &);//member function void showBoard(void);// member function void postMove(int, int, char);// member function char determineWinner(void);// member function private: char Board[3][3]; … Software Development c++ | |
Hi Guys, Wanted some help with my code. This should be the OUTPUT. Enter the size of your array: (array size should be 1-100) Enter values of your array: x[0]= (any integer) x[1]= (any integer but not equal to the value of x[0]) x[2]= (any integer but not equal to … Software Development c | |
So my teacher wants us to design a short program to add 2 polynomials, asking the user for the degree and coefficients, and print out the new coefficients. ie: poly1 deg=2 coeff= 3 4 5 poly2 deg=2 coeff= 2 5 6 output would be: 5 9 11 however, sometimes one … Software Development python | |
Hi Guys I am a Computer Science student at University and am looking for some ideas on a project that I have to complete. I have to come up with an hypothetical Software engineering problem in Java , I have to create a bad way of solving it and then … Software Development engineering java web-design | |
[B]Hey[/B] I need to store data in a database. I actually don't really need to get data from it. I created a local database in VS2010. With some tables, I added the database as a new data source. Now I'm stuck. I don't know how to insert data to it. … Software Development | |
hi, I am doing an instant chat system using java client and server architecture. currently im implementing the server side of it. my question is: Should i design a gui for the server side as well? if yes what kind of functionality should I include? thanks Software Development client-server gui java |
The End.