199,114 Archived Topics
Remove Filter ![]() | |
[CODE]reply=float(raw_input("Enter your choice: ")) if reply!=1 or reply!=2: print "Not a Valid Choice" [/CODE] i cant use while loops other wise i prob wouldve done so. Basically im trying to get the user input to only allow the numbers 1 or 2. anything else should give a not a valid … | |
Plz guys i have a problem in my c++ simple calculator, I made everything great but i just need an important hint for my assignment that i can't figure it out. for example when i add two numbers(2+4) the result is (6)... i need the number (6) to be stored … | |
I need to convert seconds to Minutes, hours and seconds. I must use pass by reference in variables. I know I need to use the modulus to deal with the remainders when I'm converting to Hours, minutes and seconds. I am really having a difficult time with the code. | |
Hey, everyone. I know how to strip certain characters from a string using for loop. Can you give an example of how that can be done with the use of while loop? | |
Im trying to write to the list box "Win_1" with SendMessage() but im doing something wrong. Thanks in advance! [CODE] #include <windows.h> #include <tchar.h> #include <string> #include <iostream> #include <richedit.h> #pragma comment(lib,"user32.lib") #pragma comment(lib,"Gdi32.lib") using namespace std; #define IDB_TEXT2 101 #define IDB_TEXT3 102 #define GetF 103 HWND hwnd, Win_1, Win_2, … | |
How can I limit the length of a text field.. I want allow entering specific number of characters in the text field?? Is there a constructor... I couldn't find 1.. plz help... | |
Hi All, I got the following error on creating a new virtual directory for a working web service version. What could be the issue? Since the same Web service build works fine on another machine. Description: An unhandled exception occurred during the execution of the current web request. Please review … | |
hey i got something again i got confused by in PE files and they don't rlly explain why happens oke so what im confused with FileAlignment and SectionAlignment files must be aligned or sections to whatever count is right ? like if the it's less than the number (x) then … | |
Hi. I am developing a system by using php. Problem I'm facing is that when the resolution of computer is changed, the interfaces of my system is effected. The resolution used while developing the system is 1440X900 while I just being told that resolution used for computers in the company … | |
Hey there everyone, i am wanting to do some college and do game design and programming. What languages should i learn, which ones would be the best? what is the main used language used for game programming now days? | |
Hi, I'm trying to move "leftover" data from one database table to another after the user clicked on a button. Please can anyone give me some advise. This is kinda really urgent plz. Everytime i run my app it gives no error but also doesn't move my data. :angry: I'm … | |
The do...while loop works fine when i key in only single character, however if i key in multiple characters, the default statement is executed infinitely. I think the problem lies in cin >> int?, i need some help in modifying the code, thx [CODE] bool rightanswer = true; do { … | |
I am getting 3 error messages: -cannot convert from 'const char [2]' to 'char [10]' 2messages of: 'char secretType::setName(char)' : overloaded member function not found in 'secretType' #include <iostream> #include <cstring> using namespace std; class secretType {private: char name[10]; *error message here int age, weight; double height; public: char setName … | |
[code=cplusplus] #include <iostream> #define MAX 100 int num[MAX]; int n; int nrows = 0; using namespace std; void print() { if (num != 0) { for (int j = 0; j <n; j++) cout << num[j]; cout <<"\n"; } } void leftRotate ( int n) {int tmp; for(int k =1; … | |
Hi guys I have been trying to figure out the problem with this program but i couldn't. my program basically crahes everythime I run and I get a seg fault. I tured in as is, but for learning purposes I want to know what's wrong with and how I should … | |
Hi, I'm having trouble writing a program that asks the user 3 questions.(3 possible answers for each) I am using a string to remember all the answers with a getline(cin,answer) statement. My problem is the first two questions have choices for the answers that can be the same such as … | |
hi all, i am creating a session variable on the property_detail.php page where after updating all the values i redirected the use to the same page with the value in the session to be printed on the same page as "Property details saved successfully". but the problem is when i … | |
I select a month from a combobox and type the year in maskeditbox then press a button to show the report. 1st the report show. when I select another month to show again the report then show a error msg: [CODE]run-time error 3705 operation is not allowed when the object … | |
What I want to do is a drop down list (comboBox) that the user can see only selected files. For example, if user selects a Word Documents from a comboBox, on the explorer will be only visible a doc files. I have done a FileFilter class: [CODE]public class FileFilter { … | |
Hi there, I'm attempting to write a program that does the target word puzzles you see in most major newspapers. The target word problem involves a 3x3 grid of 9 random letters that a user needs to be able to make words out of using at least the middle letter … | |
Hi guys, Just wondering if someone could help point out why the string value s1 in the for loop cannot be passed on to String input.... here is my code. Please ignore the commented out parts. Cheers for any help [CODE]import java.io.*; import java.util.*; import java.lang.*; public class gaelan3 { … | |
Hi everyone this is my first post, i've been browsing for awhile and finally decided to join. I'm having trouble with an assignment i have in class. I need to calculate the euclidean distance between two 2d vector. The function takes in two 2d vectors of integers. I'm also having … | |
name database : db_shop table_user : uid_user, name_user table_shop : uid_user, date table_question :uid_user, date Help me.... if user wants to accessing to page question, script php will check formerly will what him buy or not yet in certain, has user answered what not yet in certain? if buy so … | |
I am doing a homework assignment for c++. I am able to get my program to run, but I don't know how to modify it for my next assignment. Here is the question. Modify the program so that various comments are printed for each correct answer and each incorrect answer … | |
Hey, I was wondering how to obtain a hash value and pass it to php. URL: [CODE]http://www.mydomain.com/#id=110[/CODE] All I want to grab is just the "110". This is my javascript code: [CODE] <script> function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('#') + 1).split('&'); for(var i = … | |
As seen in my previous post I had a problem with some code dealing with linking a template class, I emailed my professor and the g++ compiler cannot handle the seperate compilation of template classes. So now im stuck with no compiler, in labs we use the CC compiler with … | |
I'd like to use JavaScript to add rows to a table. It seems like an easy idea, but it occurs to me that the parent node of the rows might technically be a TBODY element. So, I'm wondering if I use appendChild to add a table row to a table … | |
So i have a h/w assignment due tomorrow, and i have tried to work on it, but as usual, python frustrates me. Here is the assignment: [url]http://www.cs.gonzaga.edu/depalma/courses/cpsc121/assignPython/asgn5.pdf[/url] and for part two, here is the link for example26 it says to use: [url]http://www.cs.gonzaga.edu/depalma/courses/cpsc121/examplesPython/example26.py[/url] So i tried working out the first part … | |
I've run into a few problems with this one. I've tried my best following the directions. I can't figure out how to properly use "switch" since we haven't really put it to use in class. I want to create random integers (this I know how to do) that will become … | |
Hi, I have to create two forms. In the mainFrm the user enters all his personal data (name, phone, email, address), and a label to display amount due. One of the buttons takes the user to a second form. In the secondFrm , I have two CheckBoxes, one is for … | |
Hi Friends, Can you please help me write 3 functions in C++. It's based on a 2 dimensional linked-list The 3 functions that i have left to write are: [B]1.get_data: If data retrieval is successful return true otherwise return false. 2. update_data: This function updates the data located in the … | |
I need help with my Palindrome code For some reason, I cannot seem to convert the text into lower case letters and I cannot seem to ignore spaces and commas and periods and so on. Here is my code [CODE]def is_palindrome(user_input): i = 0 result = True while i <= … | |
Well, I did this program and it works, but my instructor wants me to use this statements instead of the one I used: My original code was: Dim DiscountVal As Double = 1.0 'ByVal arguments passed as by value (chapter VI) Dim BasePrice As Double = 9.95 Dim AdditionalPrice As … | |
I currently have a template class, another class that is passed as the parameter to the template and a driver and I am getting these errors, I have no clue what the problem is. Also I have another issue with this project I need to sort out which is insert … | |
Im tasked with developing a simple blackjack program for a class. The program I have currently compiles and runs but it isnt paying out properly. A blackjack (21) should pay out 1.5*the wager, but it is doing it more than it should. Here is the code I have. [CODE] #include … | |
Recently I found a way to upload an image path into a MySQL db while uploading the actual image to the server. This works fine, except sometimes I don't have an image to upload with the story. So - my question: If I don't have an image how do I … | |
Hi Guys, I have a compiled java file example.class and i need to use the methods in this file to read from a text file. I need to have this file inside my package as requested by the teacher. However when i put the example.class file into my package and … | |
Hello I have 2 ways to delete a linked list, which one is correct? If I have this linked list: [QUOTE] list = 1 - 2 - 3- 4 [/QUOTE] Which function will delete list correctly? 1. [CODE] void destroy(node * & list) { while (list != NULL) { delete … | |
Hi i am trying to write a function in C which will print a substring oout of a string in loop with a token seperator. For example i have a file which contains the following lines aaaaa bbbbb ccccc ddddd i have to read each line and then copy to … | |
Hi Guys: I am trying to build a simple application to query a REST web service. I have developed a perl script and its working fine. I have also developed a java app which does the same thing. Just wondering if C++ can be used for it. I did not … | |
If the str is a palindrome, return True; otherwise, return False. Punctuation, spaces, and other non-letters are ignored; their presence or absence should have no effect on the result. Uppercase letters are considered to be equal to their lowercase equivalents. So my question basically is... How do I "ignore" the … ![]() | |
Hey guys, I'm reading data from a text file into a vector of strings and would like to pass these strings as parameters to a function. To be clear, I don't want to pass the actual strings as parameters, but the variable with the name which corresponds to the contents … | |
Hi I am trying to create a method that will substitute a value x with a value y in a basic array. Your assistance is much appreciated! Yeungn | |
Need to take input from a file as command line argument and put it in an array, but i keep getting .class expected on this line [CODE]temp[][] = infile.nextInt();[/CODE] Here is the whole code so far for reference [CODE]import java.util.*; class Temps { public static void main(String[] args) { Scanner … | |
Alright, I found this code online which basically solved my issues. [code]<?php header ('Content-type:image/gif'); include('GIFEncoder.class.php'); $text = "Hello World"; // Open the first source image and add the text. $image = imagecreatefrompng('source01.png'); $text_color = imagecolorallocate($image, 200, 200, 200); imagestring($image, 5, 5, 5, $text, $text_color); // Generate GIF from the $image … | |
I am trying to read the value of memory address using c++. For example, how can I read the value contained in "00B12318"? I have tried: [CODE]int value; 00B12318 = &value; cout << value;[/CODE] But sadly it doesnt work. Please help! THank you :( | |
I was asked "This program should calculate which of four company divisions had the highest sales for the last year. The program should ask for the annual sales for the four divisions. The function should calculate which division has the highest amount in sales and return that amount to the … | |
Hi, I want to create multiple executables corresponding to their .c files in one target rule. For example, I have prog1.c and pro2.c, how do I create the executables prog1 and prog2 from just one target? By target I mean something like this test: [I]dependencies[/I] [tab] [I]command rules[/I] Thanks in … | |
I have created a JApplet and I want to be able to clear the screen and draw new components depending on what button I click on. Right now the code below will clear the screen but it doesn't redraw the JTextFields (label_1 & label_2). However I did notice whenever I … | |
I need help with my programming assignment which states A mail-order house sells five different products whose retail prices are as follows: Product Price 1 $2.98; 2 $4.50; 3 $9.98; 4 $4.49; 5 $6.87. Write a C++ program that reads a series of pairs of numbers as follows: a) Product … |
The End.