43,549 Solved Topics
Remove Filter ![]() | |
Hi all, Ok, so I obviously have an issue with how I'm thinking about accessor methods. In the following code, why are the printed out values equal? MyClass.h: [code] #ifndef MYCLASS_H_ #define MYCLASS_H_ using namespace std; class MyClass { friend ostream &operator<< (ostream &stream,MyClass const &rhs); public: MyClass(); MyClass(int); MyClass(MyClass&); … | |
I am new to java and many of the nuances to this language. For my class assignment we need to finish our methods which I have already done and do not want any help with. What I need help with is reading the data from the file with in "main". … Software Development file-system java | |
Hi All, I've got a problem with the python class. I want to create a list of object of type obj() and link them such that the next of one object is the next in its place order. I tried this construction [code] class obj: ------def __init__(self,cargo=None,next=None): ---------------self.next = next … Software Development linked-list python | |
Somebody help me build this program, its sort of challenging...Instructions say to store player's name, number and points scored by each player...Program should keep an array of 12 of these structures, each element is for a different player ona team...program should ask user to enter the data above for each … Software Development c++ data-structure | |
How do you call a method from the main() from a module to print base class attributes. Objects are contained in a list. Module [CODE] def show_employee(self): print 'Employee Name: ', self.__employee_name print 'Employee Number: ', self.__employee_number [/CODE] Software Development python | |
Ok so I want to create some code which can generate a random number from a 1. Music file 2. A microphone PLEASE is their anyway i can do this Software Development c++ | |
I have many projects in a software. Although some files and classes are shared within these projects, there are classes used by most of these projects. How do i creat classes that can be shaed among different projects . Is there anything in java that can function the same as … | |
Hi all, I'm facing some difficulties with the [b]getchanges [/b]method of a datatable... In my program, I have a standalone datatable which I'm using as the datasource to a datagridview. When I make changes to the datagridview, and I use the [b]getchanges(DataRowState.Modified)[/b] method, I get [b]Nothing[/b] as the result, no … Software Development vb.net | |
My problem is a little strange. I have a clas let say classA. In the classA i have a method with tha name MethodA. I have anaother class called classB that derived from classA. I want to override methodA of classA, but not with the name methodA, but with a … Software Development | |
Hi Everyone, Days that I'm on that problem. I have to calculate a substitution score. Below my code: [code] public void calcSubstitutionScore() { substitutionScore = (average + examMark) /2; } [/code] I previously created the method average, and I try to add to it examMark divide by two, which is … Software Development java | |
I have completed an OOP course using C++ and each student has been asked to do an end term project, so that they make use of all things that was learned, like ( operator oveloading, inheritance , polymorphisms, files, templates) and every thing that can support the project. I want … | |
Hi guys, first post so be nice :S I've been working on a software project (wordsearch generator) for one of my classes at university and I'm stumped on this section. I'm supplied with an array filled with x strings, the integer value of x (for the size of the array) … Software Development c++ | |
Hello,I have a user input and trying to write a precondition that will give an error if the user inputs number or some other odd character (except ' and .) I am thinking of writing and if statement that if my search method finds anything like that it will prompt … Software Development java | |
I have a very hard programming challenge and i need help... I have nothing so far, so im hoping somebody could help me build it... Im to write a program that uses a structure to store student name, student ID number, pointer to and array of test scores, average test … Software Development c++ data-structure | |
Hi This is my second post. I am new to python. I hope I have posted my code correctly. I am trying to have Python rewrite the compare.asc file. This file is used with another program called MUST. This is a transmission line program. This program is suppose to compare … Software Development python user-interface | |
Hello all. Haven't asked a question here in a while. Anyway, i am working on a game. I made the graphics class and now am working on a camera. I thought of making it so the camera would have a reference of the main world variable. So i tried doing … Software Development c++ | |
I need helping creating a random number of "hello worlds" import random count = 0 while count < 5: count += 1 print "Hello World" dont know where to put the module Software Development python | |
I am modifying the WDK "genprint" Print Processor example. Everything is working great, and I can compile fine, but I am running into a snag with one thing. Part of my modification knowingly triggers a print error, and Windows re-submits the print job automatically in the spool. I need to … Software Development c file-system | |
I have programatically created a test.txt file in the LocalApplicationData folder on the computer. Now I test if I can find that file with the below code and it works. The file do exist. What I have found is that the file should be in this directory ? [B]LocalApplicationData C:\Documents … Software Development c++ | |
Dear Sir, This is the 3rd part of the question, I want to find and list the finalists. Cheers, Software Development pascal | |
Hello all, I'm pretty new to coding and I'm having a little trouble in reading a list to an array from a txt file. What I'm trying to is write 24 words from a txt file to an array and then use a number to select one at random (It's … Software Development pascal | |
I usually make a matrix like this [code] from Numeric import * A=zeros([3,3]) print str(A[0,1]) #access an element [/code] I would like to store a pair of values in each element, that is have a matrix where the (0,0) element is (2.3, 2.4), the (0,1) element is (5.6,6.7), etc. Is … Software Development python | |
# include <iostream> using namespace std; int main() { char places[3][11]={"London", "Birmingham", "Glasgow"}; char *p; cout<<places[2]<<endl; p=places[0]; cout<<p<<endl; cout<< &p[2]<< endl; <------ cout<< p[11]<< endl; <------- return 0; } the output is the following Glasgow London ndon B what i dont get is how the 3rd and 4th output line … Software Development c++ | |
![]() | Hi all! I'm trying to implement a small program to test an API I've been provided, and since it's my first approach to C++ under Windows, I could use some help. I have this type definition: [CODE=CPP]typedef struct { const WCHAR* streetAddress; const WCHAR* city; const WCHAR* state; const WCHAR* … Software Development api c++ windows-api |
[code] struct players { string team_name; string driver; string navigator; double best_time; } world[32]; [/code] I am generating random values for the best time and using a bubble sort in ascending order for the best time. See below. How do I sort for best time but retain my team name, … Software Development c++ | |
Can anybody tell me.How should i get value on the basis of combo box.i simple want when user click one of the productname from the combo box other corresponding fields from the database should come in the text box of the form.Here is the code what i have written.kindly help … Software Development visual-basic | |
hello . I am trying to simulate the MD5 hashing algo. My code: [CODE] private void jButton1MouseClicked(java.awt.event.MouseEvent evt) { try { MessageDigest object = MessageDigest.getInstance("MD5"); String str = jTextField1.getText(); byte arr [] = str.getBytes(); object.update(arr);//update the md5 object with the message arr = object.digest();//calculate the digest str = IntegerToHex(arr);//convert to … Software Development java | |
Hi, Can somebody let me know how to check whether particular network drive is mapped or not e.g x:\\share1\share2? Regards, Rana Software Development perl | |
The following is a simple program on 'while ... do': program dowhile; {$APPTYPE CONSOLE} uses SysUtils, Ourcrt; Var my_words: string; begin [COLOR="Green"] my_words:=''; writeln('Enter some words (type "stop" to finish):'); readln(my_words);[/COLOR] while (my_words<>'stop')do begin clrscr; writeln('You typed:'); [COLOR="Red"] writeln(my_words); writeln; writeln('Enter some words (type "stop" to finish):'); readln(my_words);[/COLOR] end; end. … Software Development pascal | |
hi, if I had: [code=C++] char* arr; [/code] and want to add character one by one into [B]arr[/B]. How could I? I don't wanna use vectors! thanks Software Development c++ | |
this is giving me an error at the line that says loc = (zip.find("605", 0)); can't tell why?!? [CODE]void calcShippingCharge(string zip, int RATE605, int RATE606, int &chg) { //search zip code for proper prefix int loc = 0; loc = (zip.find("606", 0)); if (loc >= 0) chg = RATE606; else … Software Development c++ | |
I have a very hard programming challenge and i need help... I have nothing so far, so im hoping somebod could help me build it... Im to write a program that uses a structure to store student name, student ID number, pointer to and array of test scores, average test … Software Development c++ data-structure | |
I have a very hard programming challenge and i need help... I have nothing so far, so im hoping somebod could help me build it... Im to write a program that uses a structure to store student name, student ID number, pointer to and array of test scores, average test … Software Development c++ data-structure | |
I'm trying to install java on my home laptop and it isn't working, i followed all the steps outlined by my lecturer but the javac filename isn't executing properly. Is it setup right by me?? In environmental variables PATH = C:\jre1.6.0_07\bin;C:\Program Files\PC Connectivity Solution\;C:\watcom-1.3\binnt;C:\watcom-1.3\binw;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Metrowerks\CodeWarrior\Bin;C:\Program Files\Metrowerks\CodeWarrior\Other Metrowerks Tools\Command Line Tools;C:\Program … Software Development java | |
Hi Guys, I want to ask about these codes, i don't understand clearly. So to understand these codes detail what kind of books i have to read and tutorial i have to learn. Please guide me. [code] #include <windows.h> int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE PrevInstance, LPSTR lpszArgument, int nFunsterStil) … Software Development c++ windows-virus | |
Hello friends. I'm working on a program to sort a list object using toArray, Arrays.sort, and Arrays.asList. The problem asks that I then apply Collections.binarySearch directly to the list object. I know what the problem is (which I have stated through comments in my code) but I don't know how … Software Development java | |
HI I want to read Excel file from C#,below I menation the coding I use, I add Microsoft Excel 12.0 object library ,but Once I complie the coding it gave me error Meassage.The Error Meassage is 1."Type of Namespace for Application class Doesnt exsits" 2.Excel.Application.Workbook(object) is a method,which not given … Software Development c# | |
Can anyone tell me why i am getting error object invalid or no longer set.here is the code what i have written.any help would be greately appreciated. [code] Private Sub FillVendorList() Dim rs As New ADODB.Recordset, sqlQuery As String, i As Integer sqlQuery = "Select Suppliers.sup_id,Suppliers.Sup_name from Suppliers order by … Software Development visual-basic | |
This is my next question: how to get a document from root? because I have this code: [code] myfile.open ("/home/ws14/Desktop/test.txt"); [/code] But I need to change the path home/ws14 if I change user. Thanks! Software Development c++ | |
Write a program that uses inheritance to create various derived classes of runtime_error . Then show that a catch handler specifying the base class can catch derived-class exceptions? am i doing it rite this is my code : [CODE]#include <stdexcept> #include <exception> using std::runtime_error; class DivideByZeroException : public runtime_error { … Software Development c++ | |
So, I have to write a program that calculates the five number summary of a .txt file with 2 columns and n rows. A snippet of the file would be 23 7.8 27 17.8 39 26.5 41 27.2 From this I am trying to input the numbers into a vector … Software Development c++ | |
I need to have my program use a function to read in numbers from a file to an array, and pass the array back to my main program to be outputted/used by another function; however, I am getting an error(cannot convert from 'int' to 'int [100]'): Here is the relevant … Software Development c++ | |
Can anyone reccomend any good C++ books (available on amazon preferably). Im not a total newb (I know java, php and vb.net), i just dont know that particular language that well. A book which covers data structures and concepts too would be beneficial, as im on a comp/sci course atm, … | |
i am creating a small cpu simulator and i need to parse the assembly instruction which is like "add $s1 $s2 $s3", i need to get these four individual words ignoring the white spaces, if i use string.split(' '), it wont work if user enters more than one space between … Software Development assembly | |
hi, im trying to learn python and this is giving me [ICODE]>>> x=input("Enter a value: ") if x % 2 ==0: print ("even") else: print ("odd")[/ICODE] then when i execute: Enter a number: then i enter a number but it does not print even or odd. why? Software Development python | |
Hi I want to write a program which reads a hexadecimal number and returns an decimal number. I wrote that code(inspired by some code pieces from web): [CODE]#include <stdio.h> int main() { int hexa; scanf("%x", &hexa); printf("%d", hexa); return 0; } [/CODE] but it does't give the answer I want … Software Development c | |
I am getting the above error when trying to compile.. main.cpp [code=cplusplus] #include <windows.h> #include <string> #include "resource.h" #define GETITEM(item) GetDlgItem(hWndDlg, item) static bool keeprunning = true; static bool keeprunning1 = true; static bool keeprunning2 = true; static void run(); static void breakrun(); static void lunchrun(); static void end(); static … | |
Hello everyone, I'm working on a small assignment where I am supposed to write the code for the itoa function [icode]char* itoa(int Value, int Base);[/icode] without using any built-in functions, and where the returned value is allocated on behalf of the caller. Value being the integer to convert, and base … Software Development c++ | |
Hello, I want to total up a variable that changes every time a function is run. [code]import random def flip(): h,t = 0,1 cheads, ctails, = 0,0 cflips = random.choice((0,1)) if cflips == 0: cheads += 1 return 'h' else: ctails += 1 return 't' def repeat(f,n): for i in … Software Development python | |
Hello, I am trying to write a program that flips a coin until it gets the sequence "heads tails heads" and then stops and says how many flips it took to get that sequence. This is what I have so far: [code]import random import time import string def coinflip(): heads … Software Development python |
The End.