213 Topics
| |
Hello, I know this question might sound stupid! I am using recursion inside a loop. I want to stop the loop as soon as the method is called recursively and resume it again when the call returns. I am not able to do so. Do I need to lock the … | |
Hi im zee and i'm new to javascript.. The javascript function below..examines if a string value contains only numbers.. My problem is..I can't figure out why it doesn't continue with the 2nd loop and iterate j..please help.! [CODE]<script language="javascript"> <!-- value = "23e"; isNumber(value); function isNumber(value){ document.write('I'm inside the function … | |
I am trying to make a program which so i can put in orders and have shopping and handling calculated the problem is, each time i run the program there will be a different number of people placing an order, how would i set up a loop that on each … | |
our task is to show the histogram in a vertical orientation like this: Sample Input/Output Enter a string: waka waka fifa Histogram for waka waka fifa * * * * * * * * * * * a f i k w I have here my code, but the output … | |
please help me with this problem... i dont have any idea on how to make the code... Histogram is a process of representing the frequency of data in a chart. Write a C++ program that will simulate this process. Your program should read a string (only letters are allowed) and … | |
I kinda use this: [CODE]while 1: [body] [/CODE] a lot... But I've also read that it's not a good idea to be doing so even if you put add some way to break from the loop within the body... Any alternatives, please? | |
Hey there! I'm new to c++ and programming in general and have a quick question to why the program below works. I had most of it completed but for hours i couldn't figure out why every time i tried to enter input for the "make" member of my dynamic structure … | |
| I am trying to edit my current homework assignment to include a loop that lets the user repeat the computation for new values until the user says they want to end the program. I was given a hint to use integer division and the % operator to implement this function. … |
the program asks the user to input the number of users who wants to play. i couldn't get the result of players.length individually. each players result should be number of correct answers from the number of questions asked. please help!. [CODE]import java.text.DecimalFormat; import java.util.Random; import javax.swing.*; public class coll { … | |
--Homework-- Write a C program that codes a string which is given by keyboard so that the coded string includes characters with their number of sequential occurrences. For example, if the string to be coded is AAABBFFFRRRRZTT then the coded string must be A3B2F3R4Z1T2. You can assume that there is … | |
I am trying to read a csv file and store it into a 2D array, However it give me "segmentation fault" each time I run it. Here is my code [CODE] #include <stdlib.h> int main(void) { const char filename[] = "a.txt"; FILE *file = fopen(filename, "r"); if ( file != … | |
Hi everyone: I have written C++ code for populating a matrix/2D array with calculation results. Each column of the array represents results for a distinct time step. My problem arises because the rows of my results vector do NOT correspond to the rows of the matrix. The matrix includes extra … | |
Hey guys/gals i need some help with finding the T(n) complexity of the following for nested loops [CODE] sum = 0 for i = 0 to n-1 do [INDENT]for j = 0 to (i^2) - 1 do[/INDENT] [INDENT][INDENT]for k = 0 to j - 1[/INDENT][/INDENT] [INDENT][INDENT][INDENT]sum = sum + 1[/INDENT][/INDENT][/INDENT] … | |
the program I had looks like this: def wordToNumber(word): if word == "one": return 1 elif word == "two": return 2 elif word == "three": return 3 elif word == "four": return 4 elif word == "five": return 5 elif word == "six": return 6 elif word == "seven": return … | |
| I'm new to C Programming ( 6th week of an 8 week course ) and I am working on user defined structures. I have created a structure to store data received from a file and three of the four sub functions planned: open the file, store the data in the … |
Hey Everyone... Not quite sure how it works on these forums as this is my first post, but I am looking to separate elements of lines printed to a text file in real-time for a log parser. An example of the text output is: [INDENT][CHAT WINDOW TEXT] [Sun Nov 29 … | |
Hello, I'm still a huge beginner in C++ and while i spent hours trying to find a solution to this problem i came to this forum pretty often and I thought it'd be a good idea if I try to ask about my problem. (If you notice anything that can … | |
All, Basically what you have here is a PART of my program. Here I am supposed to get the LENGTH of a rectangle from a user and return that length to the main method for further use. My program works fine if I take out the input validation but I … | |
Hi all, After some time pulling my hair my brain has turned to mush on this senerio. I'd appreciate any help offered as my PHP skills are still limited. Here is the senerio: I am creatings a voting website. I am currently creating an admin page that creates local election. … | |
let's say i have a list of things, like: [bread, cookies, cake, chocolate, bread] how can I make loop that will, in each iteration, create a variable with the name of the item in the list? basically, i want to be able to count the times each item appears in … | |
I cannot find the mistake in the below code, I receive "statement ignored error" at the last line of the first select clause part of the code:[CODE]SELECT * BULK COLLECT INTO l_employees FROM employees;[/CODE] But I am not sure if thats the real problem. Here is my full code [CODE]declare … | |
Hi, I have made a working program that collects data from a server then puts it into an array. I decided its time to move away from text files and on to XML. [CODE] Dim sr As StreamReader = File.OpenText(frm_Loader.jokes_dic) Dim input As String input = sr.ReadLine() frm_Loader.counter = 0 … | |
I have an assignment that asks me to: 1. create a button 2. when that button is clicked, an inputBox will appear to ask the user how many words they will enter. 3. then display an inputBox for each word. For example, when the first inputBox appears, I enter "3" … | |
Hello I'm begining to learn Java and I'm trying to convert from a While loop into a for loop. Sadly I'm just not quite grasping it... I understand the loop is here [CODE]while (n * n > Math.pow(2,i)) { i++; } [/CODE] but it's not quite as simple as changing … | |
i have a program which displays a certain menu, after the menu it askes for the selection from the menu....now when an integer is used it works perfectly. but when you input a character(letter) in the menu it goes into an infinite loop. anything to use to stop this behavior … | |
Afternoon: I am trying to create a loop to give me a series of random numbers. I need the random numbers to be between 100 and 999, this is necessary so I can divide the numbers by 1000 and then use this numbers for another program. My problem is that … | |
Hi: I posted yesterday about setting my loop to get random number between the values I desire. Now I got a bit of misunderstanding with my arrays. In the program now I am trying to calculate the average sum of the amount of numbers I get each series. My problem … | |
Hello, I need some help on processing only even numbers on a counter-controlled do-while-loop, an event-controlled do-while-loop, and event-controlled do-while-loop to process only even numbers that breaks within the loop. I'm new at C++ so help would be appreciated. Thanks. [CODE] #include <iostream> #include <fstream> #include <string> #include <cstring> #include … | |
[CODE]ok ok i got it now right i copy it to vector and sort it..... here is the code #include <iostream> #include <fstream> #include <algorithm> #include <string> #include <map> #include <vector> using namespace std; typedef map<string,int> word_count_list; struct val_lessthan : binary_function < pair<string,int>, pair<string,int>, bool > { bool operator() (const … | |
ok ok i got it now right i copy it to vector and sort it..... here is the code #include <iostream> #include <fstream> #include <algorithm> #include <string> #include <map> #include <vector> using namespace std; typedef map<string,int> word_count_list; struct val_lessthan : binary_function < pair<string,int>, pair<string,int>, bool > { bool operator() (const … |
The End.