158 Topics
|
|
Am working on a project right now and almost stuck at a point. Say, I have a text document with contents like: `abc,123.xyz;praise;end,file,clear` Now I want abc , 123 . xyz ; praise ... in an array. I used split method with array of characters. Though I retrieved abc,123,xyz,praise,end,file,clear I … |
|
Am working on a project right now and almost stuck at a point. Say, I have a text document with contents like: `abc,123.xyz;praise;end,file,clear` Now I want abc , 123 . xyz ; praise ... in an array. I used split method with array of characters. Though I retrieved abc,123,xyz,praise,end,file,clear I … |
|
So I'm trying to count the number of occurrences of each digit within an array. My code I've got so far looks like the following: #include <stdio.h> #include <string.h> int main() { int numbers [10]= {1, 4, 5, 5, 5, 6, 6, 3, 2, 1}; int count = 0; for(int … |
|
In the brute force pattern matching algorithm when all the characters in the pattern are unique then brute force can be implemented in Big-oh(n) complexity where n is the length of the string (reference: introduction to algorithms). can anyone help me with the algorithm? Thanks in advance |
|
How could i convert One number system to another system? this is the output: Choose a number system below: Press A if you want Decimal to convert to another number system. Press B if you want Binary to convert to another number system. Press C if you want Octal to … |
|
.model large .stack 100h .DATA STR1 DB "ENTER YOUR NAME HERE : $" STR2 DB "JABBAR$" INSTR1 DB 20 DUP("$") INSTR2 DB 20 DUP("$") N DB ? S DB ? NEWLINE DB 10,13,"$" MSG1 DB "HAPPY BIRTHDAY BRO MAY BLESSINGS OF ALLAH BE UPON YOU (^_^)$" MSG2 DB "SORRY It'S … |
|
Hi, I have a quick question. I am making a hang man game for project (I am at university as a computer science major), I have completed most of the game but have run into one small issue which has been given me a big problem. Right now I am … |
|
Hello I am working on this code for a hotel reservation. so far I am stuck on the part which requests that fridays and saturdays be charged 150 instead of the 120 usual cost per night. I have dateTime variables for the arrival date and departure date and a timeSpan … |
|
I'm having trouble with this: import java.util.Scanner; public class triangleLoop { public static void main (String[] args) { int height, row, col, spa; String hyp; Scanner kbd = new Scanner(System.in); System.out.println("Enter the desired height of the triangle: "); height = kbd.nextInt(); System.out.println("What side do you want the hypoteneuse on? (left/right)"); … |
|
Hello, First of all I want to thank all the help with my posts. I have a program where I have to convert a phrase from lower case to upper case, but I cannot use any of the toupper() isupper() functions and vice versa. I think I almost got it, … |
|
For some reason my string is spitting out pure trash, and I have no idea why it's doing it. There are no errors kicked out when debugging. #include <iostream> #include <string> using namespace std; void main(){ string xx = ""; string yy = ""; for( int x = 0; x … |
|
Dear all, In the function below, how should the array of arrays data structure be defined and used? void foo(int option) { int i =0; char Colstr[3][15] = {"Red","Blue","Green"}; char Volstr[7][15] = {"1","2","3","3.5","4","4.5","5"}; char Sndstr[4][15] = {"lo","med","hi","vhi"}; int numSTrings[2] = {3,7,4}; char *arrayOfarrays[] = {Colstr,Volstr,Sndstr}; // How should this be … |
|
I'm trying to write an algorithm for a larger project that will take two strings which are both large integers (only using 10 digit numbers for the sake of this demo) and add them together to produce a final string that accurately represents the sum of the two original strings. … |
|
Hi all! I am making a program to input a paragraph from the user and then finds/swap/delete/insert a word in that paragraph. I am stuck on the first stage. I have made a program that just returns the starting index of the searched word. But its case sensitive and i … |
|
Develop a telephone directory which is capable of doing the following: 1. Insert a contact 2. Delete a contact 3. Edit an existing contact (changing or modifying a record) 4. Search a contact (and display complete record on screen) a. Search through first name b. Search through last name c. … |
|
I need to sort these strings in order and I have changed the code of my program which use to sort integers and now I need it to sort strings and I cannot get it to work, any help..... import java.util.Scanner; public class Strings { // -------------------------------------------- // Reads in … |
|
|
Credit card numbers follow certain patterns. A credit card number must have between 13 and 19 digits. It must start with for example: 4 for Visa cards 5 for Master cards 37 for American Express cards 6 for Discover cards So, this here is the code thats identify either a … |
#include<string> int str_len( const char * const src) { int len=0; while(src[len]) { len++; } return len; } int str_copy( char * &dest, char * src) // removed (const) to sore the string in dest.By using const,we dont have the // access to store the string.By using ampersand we can … |
|
Hellou. Can anyone tell me how can i save a string to a file? I have this function: void PrintGameBoard(jogo_4line*jg) { int i,n; system("clear"); printf("===============Jogo do 4 em linha===============\n\n\n"); printf(" +--+--+--+--+--+--+--+\n"); for(i=1; i<=6; i++) { printf("%d |%c |%c |%c |%c |%c |%c |%c |\n",7-i,jg->T[i][1],jg->T[i][2],jg->T[i][3],jg->T[i][4],jg->T[i][5],jg->T[i][6],jg->T[i][7]); if (i!=0) printf(" +--+--+--+--+--+--+--+\n"); } printf(" … |
|
So im having issues with a sorted list template, heres how I implemented it enum RelationType {LESS, EQUAL, GREATER}; template<class ItemType> struct NodeType { ItemType info; NodeType<ItemType>* next; }; template<class ItemType> class SortedType { public: SortedType(); ~SortedType(); bool IsFull() const; int GetLength() const; void MakeEmpty(); ItemType GetItem(ItemType item, bool& found); … |
|
I need help with my java code for the game hangman... we are using eclipse to write the game and using three main files to start...hangman.java hangmanlexicon.java and hangmancanvas.java. the first part of the assignment, is to create a ConsoleProgram for the game and this is what i have so … |
|
Write a program (in a single .c file) with a queue of strings implemented using array. You should write ite a queue type. The program reads a set of strings stored in a file (filename given on command line as argument) and inserts each string in the queue. Then it … |
|
Hi There, I need to re-write any mention of .tellg() in my code as the function is not supported on the desired hardware. I have the following lines of code: getline(file,line); { std::istringstream stream(line); stream >> first >> second >> third >> forth; UINT32 file_pos = stream.tellg(); file_pos++; fifth = … |
|
I want to make a program that cross checks strings. Here is an example : **Enter line: AAGGAA This sequence can make a hairpin** **Enter line: UGAG This sequence cannot make a hairpin** **Enter line: GUGCCACGGCACCGUG This sequence can make a hairpin** **Enter line: GUACCACGGCACCGUG This sequence cannot make a … |
|
HI i have this error null reference i don't know why Imports System.Data.SqlClient Imports System.Configuration Imports System.Configuration.ConfigurationSettings Public Class Form1 Private ConName As New DataAccess Private Sub cmdconnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdconnect.Click Dim conn As String Dim m_server As String Dim m_db As String m_server … |
|
Hello All, I'm trying to write a function that outputs the reverse of the input. I know that you can use the built-in list.reverse() or S[::-1] methods, but I want to make it using the 'for' loop. My code initially is: def reverse(S) for x in S: print(x, end = … |
|
Hi, Im stuck, Im trying to make a program that asks the user for a decimal number and then it converts it to a binary number. Im assuming I need a "remainder = string % 2" or something along these lines but Im not really sure where to start. anyhelp … |
|
I am getting this output: This is the source string╠This is a destination string╠╠╠╠╠╠╠╠╠╠╠╠╠╠5Press any k ey to continue . . . My code is: void Problem5(char strDestination [], char strSource []) { int intIndexOfStrSource = 0; int intConcatenatedStringIndex = 0; int intStringDestinationIndex = 0; int intLengthOfDestination = strlen(strDestination); int … |
|
Hi, again Im hoping to be on the right topic. So here it is: I am publishing a SilverlightApplication that uses a WCF service to read from a database. The application uses Bing Maps to visualize some polygons. The thing is, that after I publish it ONLY on some machines … |
|
The `ReplaceStrings` function replaces all strings in `APatterns` found in `ASubject` with the value in `AReplacement`. As an example, I added the `RemoveStrings` function which replaces everthing with an empty string, thus deleting all strings found. Usage examples are in the XMLDoc comments. A good test will be to rewrite … |
The End.