Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class WhichSystem {
- /* This application will help you determine
- * how much memory you need on the current
- * machine to do the task you report you
- * want to do.
- * The specifics are in the project description
- * file posted on the class web site.
- */
- public static void main(String[] args) {
- Scanner s = new Scanner(System.in);
- System.out.println("Users?");
- int users = s.nextInt();
- if (users < 1) {
- System.out.println("None needed");
- } else if (users >= 50) {
- System.out.println("Impossible");
- }
- if ((users >= 1) && (users > 50)) {
- System.out.println("System?");
- String operatingSystem = s.nextLine();
- if (operatingSystem != "windows" + "linux" + "mac" ) {
- System.out.println("Impossible");
- }else {
- System.out.println("Processes?");
- int processes = s.nextInt();
- if (processes <= 0) {
- System.out.println("Impossible");
- s.nextLine();
- } else if (processes >= 100) {
- System.out.println("Impossible");
- }
- }
- }}}
Add Comment
Please, Sign In to add comment