

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(date.toString()+"\n");
System.out.println("Welcome to Ksa's disolved acetaminophen calculator!\n");
System.out.println("WARNING: This program outputs toxicity information for acetaminophen only.");
System.out.println(" Daily use of acetaminophen can be hazardous regardless of output.");
System.out.println("");
System.out.println("Select a topic and press enter:");
System.out.println("");
System.out.println("1. Check if a solution has safe amounts of disolved acetaminophen.");
System.out.println("2. Give me the acetaminophen water solubility value for a certain temperature.");
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("");
System.out.println("Enter solution temperature before filtration:");
double temperature = input3.nextDouble();
if(temperature < 0)
{
System.out.println("Water freezes at zero degrees celsius.(Invalid value)");
System.out.println("Press Enter to abord.");
Scanner input4 = new Scanner(System.in);
String entrya = input4.nextLine();
System.exit(0);
}
System.out.println("");
System.out.println("Enter amount of pills:");
double pills = input.nextDouble();
if(pills < 0)
{
System.out.println("Invalid entry.");
System.out.println("Press Enter to abord.");
Scanner input4 = new Scanner(System.in);
String entrya = input4.nextLine();
System.exit(0);
}
System.out.println("");
System.out.println("Enter acetaminophen content of one pill, in miligrams (mg):");
double apap = input.nextDouble();
if(apap < 0)
{
System.out.println("Invalid entry.");
System.out.println("Press Enter to abord.");
Scanner input4 = new Scanner(System.in);
String entrya = input4.nextLine();
System.exit(0);
}
System.out.println("");
System.out.println("Enter the total water volume, in millilitres (mL):");
double water = input.nextDouble();
if(water < 0)
{
System.out.println("Invalid entry.");
System.out.println("Press Enter to abord.");
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 and may result in high amounts of disolved acetaminophen.\n Please lower the temperature below 50 degrees Celsius.");
System.out.println("Press Enter to abord.");
Scanner input4 = new Scanner(System.in);
String entrya = input4.nextLine();
System.exit(0);
}
if(pills > 50)
{
System.out.println("You have entered "+ pills+" pills. That may be unsafe for other reasons.");
System.out.println("Press Enter to abord.");
Scanner input5 = new Scanner(System.in);
String entrya = input5.nextLine();
System.exit(0);
}
if(pills*apap < water*solubility && pills*apap>8000)
{
System.out.println("The solution contains "+ a.format(intake/1000)+ " g of disolved acetaminophen.");
System.out.println("Ingestion can result in fatal acetaminophen overdose.");
System.out.println("Death occurs aproximatly 8 hours after ingestion if no antidote is provided.");
System.out.println("Reason of death: Liver failure.");
System.out.println("Using "+ 2.5*pills+" mL of water instead of "+water+" mL should render the solution safe to ingest.");
System.out.println("Press Enter to abord.");
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("The solution contains "+ a.format(intake2/1000)+ " g of disolved acetaminophen.");
System.out.println("Ingestion can result in fatal acetaminophen overdose.");
System.out.println("Death occurs aproximatly 8 hours after ingestion if no antidote is provided.");
System.out.println("Reason of death: Liver failure.");
System.out.println("Using "+ a.format(2.5*pills)+" mL of water instead of "+a.format(water)+" mL should render the solution safe to ingest.");
System.out.println("Press Enter to abord.");
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("The solution contains "+ a.format(intake/1000)+ " g of disolved acetaminophen.");
System.out.println("Ingestion is hazardous and can result in permanent liver damage.");
System.out.println("Using "+ a.format(2.5*pills)+" mL of water instead of "+a.format(water)+" mL should render the solution safe to ingest.");
System.out.println("Press Enter to abord.");
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("The solution contains "+ a.format(intake2/1000)+ " g of disolved acetaminophen.");
System.out.println("Ingestion is hazardous and can result in permanent liver damage.");
System.out.println("Using "+ a.format(2.5*pills)+" mL of water instead of "+a.format(water)+" mL should render the solution safe to ingest.");
System.out.println("Press Enter to abord.");
Scanner input9 = new Scanner(System.in);
String entrya = input9.nextLine();
System.exit(0);
}
else{
System.out.println(pills*apap < water*solubility ? "The solution contains "+a.format(intake/1000)+ " g of disolved acetaminophen." : "The solution contains "+a.format(intake2/1000)+ " g of disolved acetaminophen.");
System.out.println("Ingesting the solution is safe occasionally, given it only contains water and acetaminophen ");
System.out.println("Press Enter to abord.");
Scanner input9 = new Scanner(System.in);
String entrya = input9.nextLine();
System.exit(0);
}
}
else if(entry==2)
{
System.out.println("");
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 degrees Celsius(Invalid value)");
System.out.println("Press Enter to abord.");
Scanner input4 = new Scanner(System.in);
String entrya = input4.nextLine();
System.exit(0);
}
else if(temperature > 100)
{
System.out.println("Water boils at 100 degrees Celsius. (Invalid value)");
System.out.println("Press Enter to abord.");
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 abord.");
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("Invalid entry. Please try again.\n");
}
}while(n==1);
}
}
. Apparently wanting a life for myself that is somewhat stable and livable (though not boring) is too much to ask. Is having a place that is decent, a woman that loves me and some kind of hope for the future too much to ask really? 
. Apparently wanting a life for myself that is somewhat stable and livable (though not boring) is too much to ask. Is having a place that is decent, a woman that loves me and some kind of hope for the future too much to ask really? 

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);
}
}