• Select Your Topic Then Scroll Down
    Alcohol Bupe Benzos
    Cocaine Heroin Opioids
    RCs Stimulants Misc
    Harm Reduction All Topics Gabapentinoids
    Tired of your habit? Struggling to cope?
    Want to regain control or get sober?
    Visit our Recovery Support Forums

Opioids I made a program that tells if a CWE is safe

Status
Not open for further replies.

Ksa

Ex-Bluelighter
Joined
Aug 13, 2010
Messages
2,093
Location
TRUMP...TRUTH.
And other things, here it is:

http://www.megaupload.com/?d=G5G5DSW0

and the java code:

Code:
import java.io.*;
import java.util.*;
import java.text.*;
public class Tylenol
{
  public static void main(String[] args)
  {
    DecimalFormat a = new DecimalFormat(".00");
    Date date = new Date();
    double n = 1;
    do{
    try{
    System.out.println("    _/    _/    _/_/_/    _/_/    ");
    System.out.println("   _/  _/    _/        _/    _/   ");
    System.out.println("  _/_/        _/_/    _/_/_/_/    ");
    System.out.println(" _/  _/          _/  _/    _/     ");
    System.out.println("_/    _/  _/_/_/    _/    _/      ");
    System.out.println("");
    System.out.println("Welcome to Ksa's Tylenol CWE APAP intake calculator!");
    System.out.println("");
    System.out.println("Select a topic and press enter:");
    System.out.println("");
    System.out.println("1. Check if my CWE is safe");
    System.out.println("2. Tylenol solubility in water");
    System.out.println("3. Exit");
    Scanner input = new Scanner(System.in);
    double entry = input.nextDouble();
    n = 2;
    if(entry==1)
    {
        Scanner input3 = new Scanner(System.in);
        System.out.println("Enter the solution temperature before filtration in degrees Celsius:");
        double temperature = input3.nextDouble();
         if(temperature < 0)
        {
          System.out.println("Water freezes at zero...");
          System.out.println("Press Enter to exit the program.");
          Scanner input4 = new Scanner(System.in);
          String entrya = input4.nextLine();
          System.exit(0);
        }
        System.out.println("How many pills do you want to use?");
        double pills = input.nextDouble();
        if(pills < 0)
        {
          System.out.println("Stop trying to fail the program...I'm smarter lol.");
          System.out.println("Press Enter to exit the program.");
          Scanner input4 = new Scanner(System.in);
          String entrya = input4.nextLine();
          System.exit(0);
        }
        System.out.println("Enter acetaminophen content of one pill, in miligrams (mg):");
        double apap = input.nextDouble();
        if(apap < 0)
        {
          System.out.println("Stop trying to fail the program...I'm smarter lol.");
          System.out.println("Press Enter to exit the program.");
          Scanner input4 = new Scanner(System.in);
          String entrya = input4.nextLine();
          System.exit(0);
        }
        System.out.println("Enter the total water volume you plan on using, in millilitres (mL):");
        double water = input.nextDouble();
        if(water < 0)
        {
          System.out.println("Stop trying to fail the program...I'm smarter lol.");
          System.out.println("Press Enter to exit the program.");
          Scanner input4 = new Scanner(System.in);
          String entrya = input4.nextLine();
          System.exit(0);
        }
        double solubility = (0.0006*Math.pow(temperature,2) + 0.0165*temperature + 0.7221)*10;
        double intake = pills*apap;
        double intake2 = water*solubility;
        if(temperature > 50)
        {
          System.out.println("Your temperature is unsafe.");
          System.out.println("Lower the temperature below 50 degrees Celsius.");
          System.out.println("Press Enter to exit the program.");
          Scanner input4 = new Scanner(System.in);
          String entrya = input4.nextLine();
          System.exit(0);
        }
        if(pills > 50)
        {
        System.out.println("FATAL OPIATE OVERDOSE IMMINENT!");
        System.out.println("You have entered "+ pills+" pills, that's unsafe!!!");
        System.out.println("Press Enter to exit the program.");
        Scanner input5 = new Scanner(System.in);
        String entrya = input5.nextLine();
        System.exit(0);
      }
      if(pills*apap < water*solubility && pills*apap>8000)
      {
        System.out.println("FATAL APAP OVERDOSE IMMINENT!");
        System.out.println("Your APAP intake is "+ a.format(intake/1000)+ " g!");
        System.out.println("You should be using "+ 2.5*pills+" mL of water instead of "+water+" mL!");
        System.out.println("Press Enter to exit the program.");
        Scanner input6 = new Scanner(System.in);
        String entrya = input6.nextLine();
        System.exit(0);
      }
      else if(pills*apap >= water*solubility && water*solubility>8000)
      {
        System.out.println("FATAL APAP OVERDOSE IMMINENT!");
        System.out.println("Your APAP intake is "+ a.format(intake2/1000)+ " g!");
        System.out.println("You should be using "+ a.format(2.5*pills)+" mL of water instead of "+a.format(water)+" mL!");
        System.out.println("Press Enter to exit the program.");
        Scanner input7 = new Scanner(System.in);
        String entrya = input7.nextLine();
        System.exit(0);
      }
      else if(pills*apap < water*solubility && pills*apap>2000)
      {
        System.out.println("Your CWE is unsafe! Abord immediatly!");
        System.out.println("Your APAP intake is "+ a.format(intake/1000)+ " g!");
        System.out.println("You should be using "+ a.format(2.5*pills)+" mL of water instead of "+a.format(water)+" mL!");
        System.out.println("Press Enter to exit the program.");
        Scanner input8 = new Scanner(System.in);
        String entrya = input8.nextLine();
        System.exit(0);
      }
      else if(pills*apap >= water*solubility && water*solubility>2000)
      {
        System.out.println("Your CWE is unsafe! Abord immediatly!");
        System.out.println("Your APAP intake is "+ a.format(intake2/1000)+ " g!");
        System.out.println("You should be using "+ a.format(2.5*pills)+" mL of water instead of "+a.format(water)+" mL!");
        System.out.println("Press Enter to exit the program.");
        Scanner input9 = new Scanner(System.in);
        String entrya = input9.nextLine();
        System.exit(0);
      }
      else{
        System.out.println(pills*apap < water*solubility ? "Your APAP intake is "+a.format(intake/1000)+ " g. All the APAP is disolved." : " Your Tylenol intake is "+a.format(intake2/1000)+ " g. Looks safe to me 8]");
        System.out.println("Press Enter to exit the program.");
        Scanner input9 = new Scanner(System.in);
        String entrya = input9.nextLine();
        System.exit(0);
      }
    }
    else if(entry==2)
    {
      System.out.println("Enter water temperature in degrees Celsius from 0 to 100C:");
      Scanner input2 = new Scanner(System.in);
      double temperature = input2.nextDouble();
      if(temperature < 0)
        {
          System.out.println("Water freezes at zero...(Invalid value)");
          System.out.println("Press Enter to exit the program.");
          Scanner input4 = new Scanner(System.in);
          String entrya = input4.nextLine();
          System.exit(0);
        }
      else if(temperature > 100)
        {
          System.out.println("Water boils at 100C. (Invalid value)");
          System.out.println("Press Enter to exit the program.");
          Scanner input4 = new Scanner(System.in);
          String entrya = input4.nextLine();
          System.exit(0);
        }
      else{
      double solubility = 0.0006*Math.pow(temperature,2) + 0.0165*temperature + 0.7221;
      System.out.println("The solubility of Acetaminophen in water at "+temperature+" degrees Celsius is "+a.format(solubility)+"g/100mL");
      System.out.println("Press Enter to exit the program.");
      Scanner input9 = new Scanner(System.in);
      String entrya = input9.nextLine();
      System.exit(0);
      }
    }
    else{System.exit(0);}
    
  }
    catch(Exception e){
      System.out.println("");
      System.out.println("Wtf did you type???");
      System.out.println("Type again dude...");
      System.out.println("");
  }
  }while(n==1);

}
}
 
Cool, this sort of thing is better for your blogs. We're not here to critique your programming abilities, but its not really HR since there's no way to confirm the accuracy of your program.

Closed.
 
Status
Not open for further replies.
Top