Questions tagged as 'switch'

1
answer

In Python do we have the switch function? [duplicate]

In Python we have the function switch ? I wanted to create a program but I did not want to use many if , and for that the switch function helps, but I have already seen several videos of Python classes and no talk of swit...
asked by 10.06.2017 / 00:03
2
answers

Convert Switch to IF

Hello everyone is this I have this code and I needed to change it to if instead of switch , how can I do this? switch (theOperator) { case "+": total2 = total1 + double.Parse(total3.ToString()); break;...
asked by 03.08.2016 / 11:50
1
answer

Back to the beginning of the code after an if or switch case in C

I have a question regarding if . I'm developing a college semester program and every time I need to use a if and at the end of if , I need to go back to the beginning of the program. I'm having a hard time doing this. Examp...
asked by 25.11.2015 / 23:26
2
answers

Error in code using switch and new date

I tried to do a function that returns the day of the week we are, via switch in JS, but somehow, the result does not appear. I debugged all the code but did not find the error. Code: <!DOCTYPE html> <html lang="en"> <h...
asked by 14.12.2016 / 22:55
1
answer

Switch large case in C

I am developing a system for college and would like to know the best option, in the sense of code optimization, even improvement. I have switch case for Menu, where I have 88 cases. I have a screen called "Help", in this screen, the...
asked by 11.11.2015 / 14:25
1
answer

Access object array inside a switch

Good evening, I'm having difficulty accessing and modifying an array of main class objects within a switch in the view class. The array is declared as such in the main: public class Controle { public static void main(String[] args) {...
asked by 22.11.2015 / 01:14
1
answer

How many "cases" are possible in a "switch"? [closed]

Case 1 Informação.Text = "Olá Mundo!" Case 2 Informação.Text = "Tudo bem com você?" Case 3 Informação.Text = "Que horas são?" Notice that I added 3 (three) cases. Now a question; Do you limit the number of cases? Let's look at the examples:...
asked by 30.07.2017 / 05:30
3
answers

VB.NET conversion to C #

I found this line of code: Try Dim WebReq As HttpWebRequest = HttpWebRequest.Create(GET_Data) Using WebRes As HttpWebResponse = WebReq.GetResponse Using Reader As New StreamReader(WebRes.GetResponseStream)...
asked by 16.05.2017 / 16:40
1
answer

Getting in the wrong case

I'm doing an exercise in Java that asks for registration, salary, tax and exit. I used switch case for this, of course and so far so good. However when I run and register for Java I go through case 1 and even before I put the na...
asked by 15.08.2017 / 17:57
1
answer

How to call distinct methods under various Case Switch conditions?

I have this code, and would like to know how to call a method from switch...case . public static void opcoes(){ System.out.println("Selecione o Algoritmo de Substituicao Desejado"); System.out.println("1 - FIFO");...
asked by 15.10.2017 / 23:15