Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #32279 > unrolled thread
| Started by | srcommunicationsvja@gmail.com |
|---|---|
| First post | 2015-08-08 06:51 -0700 |
| Last post | 2015-08-08 08:58 -0500 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.java.programmer
please solve this error(why we cannot write - case 1:from=="VIJAYAWADA") srcommunicationsvja@gmail.com - 2015-08-08 06:51 -0700
Re: please solve this error(why we cannot write - case 1:from=="VIJAYAWADA") leif.roar@dimnakorr.com - 2015-08-08 08:58 -0500
| From | srcommunicationsvja@gmail.com |
|---|---|
| Date | 2015-08-08 06:51 -0700 |
| Subject | please solve this error(why we cannot write - case 1:from=="VIJAYAWADA") |
| Message-ID | <7cffe59c-a450-40e1-baf3-7ad58520ca3d@googlegroups.com> |
switch(true){
{
case1:from=="VIJAYAWADA"
if(to=="HYDERABAD")
ticharge=3000;
elseif(to=="MUMBAI")
ticharge=9000;
elseif(to=="BANGLORE")
ticharge=10000;
else
ticharge=20000;
}
{
case2:from=="HYDERABAD"
if(to=="VIJAYAWADA")
ticharge=3000;
elseif(to=="MUMBAI")
ticharge=6000;
elseif(to=="BANGLORE")
ticharge=9000;
else
ticharge=19000;
}
{
case3:from=="MUMBAI"
if(to=="VIJAYAWADA")
ticharge=9000;
elseif(to=="HYDERABAD")
ticharge=6000;
elseif(to=="BANGLORE")
ticharge=10000;
else
ticharge=17000;
}
{
case4:from=="BANGLORE"
if(to=="VIJAYAWADA")
ticharge=10000;
elseif(to=="HYDERABAD")
ticharge=9000;
elseif(to=="MUMBAI")
ticharge=10000;
else
ticharge=21000;
}
{
case5:from=="DELHI"
if(to=="VIJAYAWADA")
ticharge=20000;
elseif(to=="HYDERABAD")
ticharge=19000;
elseif(to=="MUMBAI")
ticharge=17000;
else
ticharge=21000;
}
[toc] | [next] | [standalone]
| From | leif.roar@dimnakorr.com |
|---|---|
| Date | 2015-08-08 08:58 -0500 |
| Message-ID | <RKOdnW_WgOeallvInZ2dnUU78YmdnZ2d@giganews.com> |
| In reply to | #32279 |
srcommunicationsvja@gmail.com wrote:
> switch(true){
> {
> case1:from=="VIJAYAWADA"
Have a look at the website
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/switch.html
Pay particular attention to the section on using strings in switch
statements.
--
Leif Roar Moldskred
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web