How to get conditional input in java? -


i want enter 2 numbers csv , cr. condition that: if csv positive, cr can positive or negative. if csv negative, cr cannot positive how can this?

scanner scanner = new scanner(system.in);  system.out.print("csv: "); double csv = scanner.nextdouble();  system.out.print("cr: "); double cr =  scanner.nextdouble();  if (csv < 0.0) {     while (cr > 0.0) {         system.out.println("cr cannot positive since csv negative.");         system.out.print("cr: ");         cr = scanner.nextdouble();     } } 

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -