SlideShare a Scribd company logo
import java.text.SimpleDateFormat; import java.util.Calendar; import
java.util.GregorianCalendar; import java.util.Scanner; class Main { private static Scanner
input; public static void main(String args[]) { SimpleDateFormat sdf = new
SimpleDateFormat("yyyy MMM dd HH:mm:ss"); System.out.println("when to begin
taking the medication (Year,month,day of month,hour, minute"); input = new
Scanner(System.in); String begin = input.nextLine(); String[] parts = begin.split(",");
Calendar calendar = new
GregorianCalendar(Integer.parseInt(parts[0]),Integer.parseInt(parts[1])-
1,Integer.parseInt(parts[2]),Integer.parseInt(parts[3]),Integer.parseInt(parts[4]),00);
System.out.println(sdf.format(calendar.getTime())); System.out.println("when to end");
String end = input.nextLine(); String[] parts2 = end.split(","); Calendar calendar2 =
new GregorianCalendar(Integer.parseInt(parts2[0]),Integer.parseInt(parts2[1])-
1,Integer.parseInt(parts2[2]),Integer.parseInt(parts2[3]),Integer.parseInt(parts2[4]),00);
System.out.println(sdf.format(calendar2.getTime())); System.out.println("proper
dosage"); String dosage = input.nextLine(); System.out.println("frequency (hours
between medication)"); int frequence = input.nextInt();
calendar.add(Calendar.HOUR_OF_DAY,+ frequence); System.out.println("The second
scheduled medication is: " + sdf.format(calendar.getTime())); } }
Solution
import java.text.SimpleDateFormat; import java.util.Calendar; import
java.util.GregorianCalendar; import java.util.Scanner; class Main { private static Scanner
input; public static void main(String args[]) { SimpleDateFormat sdf = new
SimpleDateFormat("yyyy MMM dd HH:mm:ss"); System.out.println("when to begin
taking the medication (Year,month,day of month,hour, minute"); input = new
Scanner(System.in); String begin = input.nextLine(); String[] parts = begin.split(",");
Calendar calendar = new
GregorianCalendar(Integer.parseInt(parts[0]),Integer.parseInt(parts[1])-
1,Integer.parseInt(parts[2]),Integer.parseInt(parts[3]),Integer.parseInt(parts[4]),00);
System.out.println(sdf.format(calendar.getTime())); System.out.println("when to end");
String end = input.nextLine(); String[] parts2 = end.split(","); Calendar calendar2 =
new GregorianCalendar(Integer.parseInt(parts2[0]),Integer.parseInt(parts2[1])-
1,Integer.parseInt(parts2[2]),Integer.parseInt(parts2[3]),Integer.parseInt(parts2[4]),00);
System.out.println(sdf.format(calendar2.getTime())); System.out.println("proper
dosage"); String dosage = input.nextLine(); System.out.println("frequency (hours
between medication)"); int frequence = input.nextInt();
calendar.add(Calendar.HOUR_OF_DAY,+ frequence); System.out.println("The second
scheduled medication is: " + sdf.format(calendar.getTime())); } }

More Related Content

Similar to import java.text.SimpleDateFormat; import java.util.Calendar; import.pdf

please help finish sorting methods- import java-util-Arrays- import ja.pdf
please help finish sorting methods- import java-util-Arrays- import ja.pdfplease help finish sorting methods- import java-util-Arrays- import ja.pdf
please help finish sorting methods- import java-util-Arrays- import ja.pdf
anfenterprises
 
DS LAB RECORD.docx
DS LAB RECORD.docxDS LAB RECORD.docx
DS LAB RECORD.docx
davinci54
 
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdfimport java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
adhityalapcare
 
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
MaruMengesha
 
Hi,I have updated your code. It is working fine now. Highllighted .pdf
Hi,I have updated your code. It is working fine now. Highllighted .pdfHi,I have updated your code. It is working fine now. Highllighted .pdf
Hi,I have updated your code. It is working fine now. Highllighted .pdf
aniyathikitchen
 
Computer java programs
Computer java programsComputer java programs
Computer java programs
ADITYA BHARTI
 
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdfSumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
ankkitextailes
 
Write a Java ProgramSolutionAnswer- Code- import java-io--- import jav.docx
Write a Java ProgramSolutionAnswer- Code- import java-io--- import jav.docxWrite a Java ProgramSolutionAnswer- Code- import java-io--- import jav.docx
Write a Java ProgramSolutionAnswer- Code- import java-io--- import jav.docx
lez31palka
 
Java Programs
Java ProgramsJava Programs
Java Programs
Seetharamaiah Vadde
 
JSR 310. New Date API in Java 8
JSR 310. New Date API in Java 8JSR 310. New Date API in Java 8
JSR 310. New Date API in Java 8
Serhii Kartashov
 
Code javascript
Code javascriptCode javascript
Code javascript
Ray Ray
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
New Java Date/Time API
New Java Date/Time APINew Java Date/Time API
New Java Date/Time API
Juliet Nkwor
 
JAVA.Q4 Create a Time class. This class will represent a point in.pdf
JAVA.Q4 Create a Time class. This class will represent a point in.pdfJAVA.Q4 Create a Time class. This class will represent a point in.pdf
JAVA.Q4 Create a Time class. This class will represent a point in.pdf
karymadelaneyrenne19
 
What's New in C++ 11/14?
What's New in C++ 11/14?What's New in C++ 11/14?
What's New in C++ 11/14?
Dina Goldshtein
 

Similar to import java.text.SimpleDateFormat; import java.util.Calendar; import.pdf (15)

please help finish sorting methods- import java-util-Arrays- import ja.pdf
please help finish sorting methods- import java-util-Arrays- import ja.pdfplease help finish sorting methods- import java-util-Arrays- import ja.pdf
please help finish sorting methods- import java-util-Arrays- import ja.pdf
 
DS LAB RECORD.docx
DS LAB RECORD.docxDS LAB RECORD.docx
DS LAB RECORD.docx
 
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdfimport java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
 
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
 
Hi,I have updated your code. It is working fine now. Highllighted .pdf
Hi,I have updated your code. It is working fine now. Highllighted .pdfHi,I have updated your code. It is working fine now. Highllighted .pdf
Hi,I have updated your code. It is working fine now. Highllighted .pdf
 
Computer java programs
Computer java programsComputer java programs
Computer java programs
 
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdfSumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
 
Write a Java ProgramSolutionAnswer- Code- import java-io--- import jav.docx
Write a Java ProgramSolutionAnswer- Code- import java-io--- import jav.docxWrite a Java ProgramSolutionAnswer- Code- import java-io--- import jav.docx
Write a Java ProgramSolutionAnswer- Code- import java-io--- import jav.docx
 
Java Programs
Java ProgramsJava Programs
Java Programs
 
JSR 310. New Date API in Java 8
JSR 310. New Date API in Java 8JSR 310. New Date API in Java 8
JSR 310. New Date API in Java 8
 
Code javascript
Code javascriptCode javascript
Code javascript
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
New Java Date/Time API
New Java Date/Time APINew Java Date/Time API
New Java Date/Time API
 
JAVA.Q4 Create a Time class. This class will represent a point in.pdf
JAVA.Q4 Create a Time class. This class will represent a point in.pdfJAVA.Q4 Create a Time class. This class will represent a point in.pdf
JAVA.Q4 Create a Time class. This class will represent a point in.pdf
 
What's New in C++ 11/14?
What's New in C++ 11/14?What's New in C++ 11/14?
What's New in C++ 11/14?
 

More from premkhatri99

A SturmSolution A Sturm.pdf
 A SturmSolution A Sturm.pdf A SturmSolution A Sturm.pdf
A SturmSolution A Sturm.pdf
premkhatri99
 
Yes it is minus 1 (-1). Oxygen is normally -2, bu.pdf
                     Yes it is minus 1 (-1). Oxygen is normally -2, bu.pdf                     Yes it is minus 1 (-1). Oxygen is normally -2, bu.pdf
Yes it is minus 1 (-1). Oxygen is normally -2, bu.pdf
premkhatri99
 
very easy Water formula — H 2 O .pdf
                     very easy  Water formula — H 2 O                 .pdf                     very easy  Water formula — H 2 O                 .pdf
very easy Water formula — H 2 O .pdf
premkhatri99
 
TLC or Thin Layer Chromatography is performed on.pdf
                     TLC or Thin Layer Chromatography is performed on.pdf                     TLC or Thin Layer Chromatography is performed on.pdf
TLC or Thin Layer Chromatography is performed on.pdf
premkhatri99
 
The name of the compound is 2-Ethoxyethanol .pdf
                     The name of the compound is  2-Ethoxyethanol     .pdf                     The name of the compound is  2-Ethoxyethanol     .pdf
The name of the compound is 2-Ethoxyethanol .pdf
premkhatri99
 
THANKS Solution THANKS .pdf
                     THANKS Solution                     THANKS .pdf                     THANKS Solution                     THANKS .pdf
THANKS Solution THANKS .pdf
premkhatri99
 
Potassium (K) ion has an electron configuration i.pdf
                     Potassium (K) ion has an electron configuration i.pdf                     Potassium (K) ion has an electron configuration i.pdf
Potassium (K) ion has an electron configuration i.pdf
premkhatri99
 
oxidation-reduction reactions (redox reactions) a.pdf
                     oxidation-reduction reactions (redox reactions) a.pdf                     oxidation-reduction reactions (redox reactions) a.pdf
oxidation-reduction reactions (redox reactions) a.pdf
premkhatri99
 
NO reaction between these two salts, thus no equa.pdf
                     NO reaction between these two salts, thus no equa.pdf                     NO reaction between these two salts, thus no equa.pdf
NO reaction between these two salts, thus no equa.pdf
premkhatri99
 
Helium is a little lighter then a sum of two prot.pdf
                     Helium is a little lighter then a sum of two prot.pdf                     Helium is a little lighter then a sum of two prot.pdf
Helium is a little lighter then a sum of two prot.pdf
premkhatri99
 
It is F tset.The between-group degrees of freedom is 3-1=2.pdf
It is F tset.The between-group degrees of freedom is 3-1=2.pdfIt is F tset.The between-group degrees of freedom is 3-1=2.pdf
It is F tset.The between-group degrees of freedom is 3-1=2.pdf
premkhatri99
 
there is no reaction between Cu(NO3)2 and water.Solutionth.pdf
there is no reaction between Cu(NO3)2 and water.Solutionth.pdfthere is no reaction between Cu(NO3)2 and water.Solutionth.pdf
there is no reaction between Cu(NO3)2 and water.Solutionth.pdf
premkhatri99
 
There are 7 in total ( 3 up and 4 right )Differnet paths possi.pdf
There are 7 in total ( 3 up and 4 right )Differnet paths possi.pdfThere are 7 in total ( 3 up and 4 right )Differnet paths possi.pdf
There are 7 in total ( 3 up and 4 right )Differnet paths possi.pdf
premkhatri99
 
The length of a is independent of the shaft length L. Because it is .pdf
The length of a is independent of the shaft length L. Because it is .pdfThe length of a is independent of the shaft length L. Because it is .pdf
The length of a is independent of the shaft length L. Because it is .pdf
premkhatri99
 
The answer is E all of the aboveSolutionThe answer is E all of.pdf
The answer is E all of the aboveSolutionThe answer is E all of.pdfThe answer is E all of the aboveSolutionThe answer is E all of.pdf
The answer is E all of the aboveSolutionThe answer is E all of.pdf
premkhatri99
 
Suppose there is a parasite P which feeds on a species of insect.pdf
Suppose there is a parasite P which feeds on a species of insect.pdfSuppose there is a parasite P which feeds on a species of insect.pdf
Suppose there is a parasite P which feeds on a species of insect.pdf
premkhatri99
 
Run the following code to get the deisred resultfunction .pdf
Run the following code to get the deisred resultfunction .pdfRun the following code to get the deisred resultfunction .pdf
Run the following code to get the deisred resultfunction .pdf
premkhatri99
 
only the ketone at the left top changes to acid (cooH)Solution.pdf
only the ketone at the left top changes to acid (cooH)Solution.pdfonly the ketone at the left top changes to acid (cooH)Solution.pdf
only the ketone at the left top changes to acid (cooH)Solution.pdf
premkhatri99
 
P(a)=15=0.2SolutionP(a)=15=0.2.pdf
P(a)=15=0.2SolutionP(a)=15=0.2.pdfP(a)=15=0.2SolutionP(a)=15=0.2.pdf
P(a)=15=0.2SolutionP(a)=15=0.2.pdf
premkhatri99
 
Please find my solution.Please let me know in case of any issue..pdf
Please find my solution.Please let me know in case of any issue..pdfPlease find my solution.Please let me know in case of any issue..pdf
Please find my solution.Please let me know in case of any issue..pdf
premkhatri99
 

More from premkhatri99 (20)

A SturmSolution A Sturm.pdf
 A SturmSolution A Sturm.pdf A SturmSolution A Sturm.pdf
A SturmSolution A Sturm.pdf
 
Yes it is minus 1 (-1). Oxygen is normally -2, bu.pdf
                     Yes it is minus 1 (-1). Oxygen is normally -2, bu.pdf                     Yes it is minus 1 (-1). Oxygen is normally -2, bu.pdf
Yes it is minus 1 (-1). Oxygen is normally -2, bu.pdf
 
very easy Water formula — H 2 O .pdf
                     very easy  Water formula — H 2 O                 .pdf                     very easy  Water formula — H 2 O                 .pdf
very easy Water formula — H 2 O .pdf
 
TLC or Thin Layer Chromatography is performed on.pdf
                     TLC or Thin Layer Chromatography is performed on.pdf                     TLC or Thin Layer Chromatography is performed on.pdf
TLC or Thin Layer Chromatography is performed on.pdf
 
The name of the compound is 2-Ethoxyethanol .pdf
                     The name of the compound is  2-Ethoxyethanol     .pdf                     The name of the compound is  2-Ethoxyethanol     .pdf
The name of the compound is 2-Ethoxyethanol .pdf
 
THANKS Solution THANKS .pdf
                     THANKS Solution                     THANKS .pdf                     THANKS Solution                     THANKS .pdf
THANKS Solution THANKS .pdf
 
Potassium (K) ion has an electron configuration i.pdf
                     Potassium (K) ion has an electron configuration i.pdf                     Potassium (K) ion has an electron configuration i.pdf
Potassium (K) ion has an electron configuration i.pdf
 
oxidation-reduction reactions (redox reactions) a.pdf
                     oxidation-reduction reactions (redox reactions) a.pdf                     oxidation-reduction reactions (redox reactions) a.pdf
oxidation-reduction reactions (redox reactions) a.pdf
 
NO reaction between these two salts, thus no equa.pdf
                     NO reaction between these two salts, thus no equa.pdf                     NO reaction between these two salts, thus no equa.pdf
NO reaction between these two salts, thus no equa.pdf
 
Helium is a little lighter then a sum of two prot.pdf
                     Helium is a little lighter then a sum of two prot.pdf                     Helium is a little lighter then a sum of two prot.pdf
Helium is a little lighter then a sum of two prot.pdf
 
It is F tset.The between-group degrees of freedom is 3-1=2.pdf
It is F tset.The between-group degrees of freedom is 3-1=2.pdfIt is F tset.The between-group degrees of freedom is 3-1=2.pdf
It is F tset.The between-group degrees of freedom is 3-1=2.pdf
 
there is no reaction between Cu(NO3)2 and water.Solutionth.pdf
there is no reaction between Cu(NO3)2 and water.Solutionth.pdfthere is no reaction between Cu(NO3)2 and water.Solutionth.pdf
there is no reaction between Cu(NO3)2 and water.Solutionth.pdf
 
There are 7 in total ( 3 up and 4 right )Differnet paths possi.pdf
There are 7 in total ( 3 up and 4 right )Differnet paths possi.pdfThere are 7 in total ( 3 up and 4 right )Differnet paths possi.pdf
There are 7 in total ( 3 up and 4 right )Differnet paths possi.pdf
 
The length of a is independent of the shaft length L. Because it is .pdf
The length of a is independent of the shaft length L. Because it is .pdfThe length of a is independent of the shaft length L. Because it is .pdf
The length of a is independent of the shaft length L. Because it is .pdf
 
The answer is E all of the aboveSolutionThe answer is E all of.pdf
The answer is E all of the aboveSolutionThe answer is E all of.pdfThe answer is E all of the aboveSolutionThe answer is E all of.pdf
The answer is E all of the aboveSolutionThe answer is E all of.pdf
 
Suppose there is a parasite P which feeds on a species of insect.pdf
Suppose there is a parasite P which feeds on a species of insect.pdfSuppose there is a parasite P which feeds on a species of insect.pdf
Suppose there is a parasite P which feeds on a species of insect.pdf
 
Run the following code to get the deisred resultfunction .pdf
Run the following code to get the deisred resultfunction .pdfRun the following code to get the deisred resultfunction .pdf
Run the following code to get the deisred resultfunction .pdf
 
only the ketone at the left top changes to acid (cooH)Solution.pdf
only the ketone at the left top changes to acid (cooH)Solution.pdfonly the ketone at the left top changes to acid (cooH)Solution.pdf
only the ketone at the left top changes to acid (cooH)Solution.pdf
 
P(a)=15=0.2SolutionP(a)=15=0.2.pdf
P(a)=15=0.2SolutionP(a)=15=0.2.pdfP(a)=15=0.2SolutionP(a)=15=0.2.pdf
P(a)=15=0.2SolutionP(a)=15=0.2.pdf
 
Please find my solution.Please let me know in case of any issue..pdf
Please find my solution.Please let me know in case of any issue..pdfPlease find my solution.Please let me know in case of any issue..pdf
Please find my solution.Please let me know in case of any issue..pdf
 

Recently uploaded

DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 

Recently uploaded (20)

DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 

import java.text.SimpleDateFormat; import java.util.Calendar; import.pdf

  • 1. import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.GregorianCalendar; import java.util.Scanner; class Main { private static Scanner input; public static void main(String args[]) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy MMM dd HH:mm:ss"); System.out.println("when to begin taking the medication (Year,month,day of month,hour, minute"); input = new Scanner(System.in); String begin = input.nextLine(); String[] parts = begin.split(","); Calendar calendar = new GregorianCalendar(Integer.parseInt(parts[0]),Integer.parseInt(parts[1])- 1,Integer.parseInt(parts[2]),Integer.parseInt(parts[3]),Integer.parseInt(parts[4]),00); System.out.println(sdf.format(calendar.getTime())); System.out.println("when to end"); String end = input.nextLine(); String[] parts2 = end.split(","); Calendar calendar2 = new GregorianCalendar(Integer.parseInt(parts2[0]),Integer.parseInt(parts2[1])- 1,Integer.parseInt(parts2[2]),Integer.parseInt(parts2[3]),Integer.parseInt(parts2[4]),00); System.out.println(sdf.format(calendar2.getTime())); System.out.println("proper dosage"); String dosage = input.nextLine(); System.out.println("frequency (hours between medication)"); int frequence = input.nextInt(); calendar.add(Calendar.HOUR_OF_DAY,+ frequence); System.out.println("The second scheduled medication is: " + sdf.format(calendar.getTime())); } } Solution import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.GregorianCalendar; import java.util.Scanner; class Main { private static Scanner input; public static void main(String args[]) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy MMM dd HH:mm:ss"); System.out.println("when to begin taking the medication (Year,month,day of month,hour, minute"); input = new Scanner(System.in); String begin = input.nextLine(); String[] parts = begin.split(","); Calendar calendar = new GregorianCalendar(Integer.parseInt(parts[0]),Integer.parseInt(parts[1])- 1,Integer.parseInt(parts[2]),Integer.parseInt(parts[3]),Integer.parseInt(parts[4]),00); System.out.println(sdf.format(calendar.getTime())); System.out.println("when to end"); String end = input.nextLine(); String[] parts2 = end.split(","); Calendar calendar2 = new GregorianCalendar(Integer.parseInt(parts2[0]),Integer.parseInt(parts2[1])- 1,Integer.parseInt(parts2[2]),Integer.parseInt(parts2[3]),Integer.parseInt(parts2[4]),00); System.out.println(sdf.format(calendar2.getTime())); System.out.println("proper dosage"); String dosage = input.nextLine(); System.out.println("frequency (hours between medication)"); int frequence = input.nextInt();
  • 2. calendar.add(Calendar.HOUR_OF_DAY,+ frequence); System.out.println("The second scheduled medication is: " + sdf.format(calendar.getTime())); } }