This can well be summed up through a Java program 🙂
import java.util.*;
Class Success
{
     public static void main (String args []) throws IOException
     {
          int no_of_days = 0;
          Scanner sc = new Scanner (System.in);

          System.out.println (“Enter the value of Total Success”);
          // Eg. no. of sales to be achieved, etc.
          int total_success = sc.nextInt();
          System.out.println (“Enter the maximum success that can be achieved in 1 night”);             // Eg. no. of sales calls possible in a day
          int overnight_success = sc.nextInt();
          while (overnight_success != total_success)
          {
              total_success = total_success + overnight_success;
              no_of_days++;
          }
          if (no_of_days == 1)
              {
                    System.out.println (“It is an Overnight Success”);
               }
          else
               {
                    System.out.println (“It is a Compounded Success”);
               }
     }
}

Recommended Reads:

Advertisements