Guest User

Untitled

a guest
Jun 25th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.15 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class WhichSystem {
  4.     /* This application will help you determine  
  5.      * how much memory you need on the current
  6.      * machine to do the task you report you
  7.      * want to do.
  8.      * The specifics are in the project description
  9.      * file posted on the class web site.
  10.      */
  11.     public static void main(String[] args) {
  12.        
  13.         Scanner s = new Scanner(System.in);
  14.             System.out.println("Users?");
  15.                 int users = s.nextInt();
  16.        
  17.         if (users < 1) {
  18.             System.out.println("None needed");
  19.                
  20.         } else if (users >= 50) {
  21.                 System.out.println("Impossible");
  22.         }
  23.        
  24.         if ((users >= 1) && (users > 50)) {
  25.            
  26.             System.out.println("System?");
  27.                 String operatingSystem = s.nextLine();
  28.            
  29.                     if (operatingSystem != "windows" + "linux" + "mac" ) {
  30.                     System.out.println("Impossible");
  31.                
  32.                
  33.                     }else {
  34.                         System.out.println("Processes?");
  35.                             int processes = s.nextInt();
  36.            
  37.                             if (processes <= 0) {
  38.                                 System.out.println("Impossible");
  39.                                 s.nextLine();
  40.                        
  41.                             } else if (processes >= 100) {
  42.                                 System.out.println("Impossible");
  43.                 }
  44.                
  45.        
  46.    
  47.             }
  48.            
  49.                
  50.                
  51.     }}}
Add Comment
Please, Sign In to add comment