Questions tagged as 'switch'

1
answer

Error compiling this simple program that shows the corresponding month

I'm trying to compile this program here in Code :: Blocks but I can not and can not understand why. #include <iostream> #include <string> #include <stdlib.h> #include <stdio.h> using namespace std; using std::endl; usin...
asked by 22.02.2017 / 16:40
1
answer

Open an EditText when a Switch component is turned off

I have a custom Adapter fault that renders a list, in that list it has a switch that by default comes on and when the user hangs up, the system validates a rule and if that rule was true , it has to show a EditText so that th...
asked by 01.04.2016 / 19:27
3
answers

Creating Array within Function

I'm trying to do an exercise where I have to create a array inside a function, and the same be accessed through an external code (example: ... php? pais = uk and show UK - London ). The array items are countries and capitals, eg...
asked by 27.07.2016 / 16:30
3
answers

How the switch works

Is it possible to make comparisons with variable values in the switch case statement or the case just check the value of a variable and do an action? Is it better to make this type of comparison with if ?     
asked by 09.02.2017 / 23:53
1
answer

How to make a switch in Ruby?

How can I make a switch in Ruby?     
asked by 05.11.2014 / 15:46
1
answer

Problem with menu switch case and while

My goal is that after I run one of the menu options and say that I do not want to continue on it, I can insert another option (or the same if you want to go back). My code executes the first option that I type but does not pick up the second,...
asked by 30.06.2017 / 06:26
4
answers

How to use switch in C?

I have to understand this code that my advisor passed to me. How much% of% after opt is required? The command switch too? Why does not it appear after the options break and case '?' ? if( argc <= 1) { fp...
asked by 13.03.2018 / 19:26
1
answer

Break and Continue on Switch

What's the difference between using break and continue within switch ?     
asked by 30.07.2018 / 02:22
1
answer

In this case use switch or if?

I have an exercise to do that consists of the following: The user informs the salary, and depending on the value informed, it gains an increase according to the table. Example: From 1000 to 1500 he gains 10% From 1500 to 2000 he earns 5% 2000...
asked by 17.03.2017 / 05:15
2
answers

Program Ignoring Scanf

I need to create an algorithm as a request below, however, every time I run the program it "skips" steps. For example: I want you to stay like this Product: "Potato" Sector: "Food" Quantity: "15" Price: "15.23" But it prints on...
asked by 13.05.2018 / 22:12