22 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for Papa_Don

Group, I've got a complex If/Then statement that may require the use of "Select Case". However I'm not familiar with how "Select Case" actually works. Needless to say, I'm not sure if you can use it within an "If/Then" statement. Here's what I need to do: If row > 7 …

Member Avatar for Reverend Jim
0
2K
Member Avatar for Auroch

Hello everybody! I'm trying to count the number of occurrences of each word in a text file. Problem situation requires to realize menu using "switch" statement (If file exist or not). There are following errors in my program ("case b" and "default" is not working): **[C++ Error] 03_int.cpp(61): E2126 Case …

Member Avatar for Auroch
0
968
Member Avatar for klemme

Hi All, I am pulling out info from my db and need to tjeck if a column is 0, if it is then i need to SUM 3 other columns and pull out that total. I want to use the CASE keyword and tjeck for this, but am doing something …

Member Avatar for klemme
0
212
Member Avatar for ddanbe

I have no problem of putting a break statement in the default option of a **switch case** statement, just wondering why it is needed. Anyone any ideas? int a = 42; switch (a) { case 1 : case 2 : //statements for case 1 and 2 break; // probably more …

Member Avatar for ddanbe
1
356
Member Avatar for JavaGr33nh0rn

import java.io.*; import java.util.*; import java.util.Scanner; public class cooperativeCanteen60 { static Scanner console = new Scanner(System.in); static Scanner sc = new Scanner(System.in); public static void main(String[]args) { //throws java.io.IOException { Scanner in = new Scanner (System.in); int type; int discountRange; int discount; int customerType; int number; int rtotal; int vtotal; …

Member Avatar for JavaGr33nh0rn
0
254
Member Avatar for replic

Hello everyone, i am fairly new to shell scripting so please bear with me. The following script is supposed to read words from a file and depending on the word print different things. However it always prints the default value. It also refuses to work completely if the first line …

Member Avatar for replic
0
333
Member Avatar for Prysm[VA]

So in my classes I've taken I was told by the teacher "case statements and if-else statements are the same things essentionally" so why learn both? and so I was not taught about cases. Besides the fact I should learn it anyway incase I need it for someone elses code, …

Member Avatar for mike_2000_17
0
323
Member Avatar for Khav

Greetings, I have two tables named 'copyright' and 'logs'. Table : copyright Field : Copyr_md5 Table : logs Field : md5checksum Problem 1 Say i have a value stored in `$md5check` in php , now i want to check if the value stored in `$md5check` is found in field `Copyr_md5`.If …

Member Avatar for Khav
0
244
Member Avatar for PriteshP23

I would like to know the best way to manage the two drop down menu on the PHP page. 1st menu : Select Type of House (House1, House2, ) 2nd menu : Select Number of Rooms (1,2 .. 12) The system should be displayed price based on selected items. Need …

Member Avatar for PriteshP23
0
287
Member Avatar for angel06

I'm currently creating a program where a user should enter the correct color shown in it. This should be entered in text box. What code should I use to make the program accept both upper case and lower case text inputs? For example "red" should be equivalent to "Red" something …

Member Avatar for debasisdas
0
533
Member Avatar for swissknife007

[CODE] #include <iostream> #include<stdio.h> #include<string.h> using namespace std; int main() { // cout << "Hello world!" << endl; int t,i,j,a,flag; char str[1000001]; cin>>t; while(t--) { a=1; scanf("%s",str); for(i=0;i<=strlen(str);i++) {flag=0; if(!isdigit(str[i])) {flag=0; for(j=i-1;isdigit(str[j]);j--) { if(str[j]!='0') { flag++; a*=str[j]-'0'; //cout<<"flag"<<flag<<" "<<a<<"A"<<endl; break; } } if(flag==0) { a=0;break; } } while(a>9) { if((a%10)!=0) …

Member Avatar for StuXYZ
0
516
Member Avatar for magicmarkuk

Hi I am having a problem with my syntax for the following code: What I am trying to do is: 1. Check if sticky = 'y' then give a value of 1 2. If not then check whether announcement is 'y' then give a value of 2 3. If not …

Member Avatar for magicmarkuk
0
157
Member Avatar for konman795

Hi all, this is a homework assignment that I'm not sure how to begin with. We are given all the code and I just need to finish a function to convert digits to words. For example, the string "1, 2, and 3." becomes "One, Two, and Three." The String "10" …

Member Avatar for konman795
0
338
Member Avatar for birdlover2010

Hello, I am doing a simple calculator program. I have a combo box and assigned numerical values to a string variable under each case number using the same variable name. My problem is I don't know how to assign that value. When I use the current code, it pulls the …

Member Avatar for codeorder
0
927
Member Avatar for aishapot

Hello i want to the textbox that when I start to type in names it should be like this [B]Camille Aisha Cordova[/B] How do I do this?

Member Avatar for aishapot
0
2K
Member Avatar for Adami

Hello All ! I'm trying to write a Robot Class who have several methods. One of its methods is move() that move the robot the direction his looking at, one step ahead. I'm getting an error on this: [CODE]switch (Direction) {[/CODE] If some one can help me find the mistake, …

Member Avatar for Adami
0
375
Member Avatar for denkfix

Hi, I use the stl features to deal with string conversions, especially facets. Now, I am faced with the task to lower a string except its first letter. Please note that I am dealing with multi-byte characters and so I cannot simply replace the first character of the string with …

Member Avatar for denkfix
0
218
Member Avatar for d_panayotov

Hi, I tried searching but I don't know how exactly to describe my question in 2-3 words so I didn't find anything. Is it possible to do something like this?Just to get the idea... I know it doesn't work: [CODE]switch(c){ case '1':{ (...) ; break;} case '2':{ (...) ; break;} …

Member Avatar for L7Sqr
0
127
Member Avatar for koveras vehcna

Hello everyone, I am currently teaching myself language processing by using the book of NLTK -found at http://www.nltk.org/book - and I have a problem. The following code retrieves every sentence in Shakespeare's Macbeth respectively as a list of list of list -or something like that- format: from nltk.corpus import gutenberg …

Member Avatar for koveras vehcna
0
244
Member Avatar for LloydFarrell

hi all, Im trying to add a "title" to a switch case statement below, but for some reason im unable to complete, what I thought was a simple task. Hope someone can help and explaine the reasons why cheers, Lloyd [code] switch($ad) { case "add1.gif"; header("Location: http://www.google.co.uk"); break; case "add2.gif"; …

Member Avatar for syamsasi
0
734
Member Avatar for cacoyle

basically i have a table which has different branch names recorded in the same column as other data. I cannot change how the data comes in so i have to find a way of extracting and matching data from this column. eg +---------+---------------------+------+------------+--------+ | Company | Branch | Tml | …

Member Avatar for cacoyle
0
167
Member Avatar for Funsize

I am making a simple unit converter, and wanted the user to specify the number of decimal places to be displayed for the results. The user selects which conversion they want to perform from another combo box, and I have a select case to decide the calculation needed. Eg. [code]Select …

Member Avatar for Funsize
0
278

The End.