SlideShare a Scribd company logo
1 of 4
Download to read offline
ConversionDemo.java
import java.util.*;//package for scanner class
class Tempconversion//temperature conversion class
{
public void farenheattocelcius(double temp)
{//method for farenheat to celcius conversion
System.out.println("Celcius Farenheat");
System.out.println("-----------------------------");
for(int i=(int) temp;i>30;i--)
{
temp = ((9.0*i)/5+32);//formula for converting into celcius
System.out.println(i+" " +temp);
}
}
public void celciustofarenheat(double temp)
{//method for converting celcius to farenheat
System.out.println("Farenheat Celcius");
System.out.println("-----------------------------");
for(int i=(int) temp;i>=30;i=i-10)
{
temp = 5.0*(i - 32)/9;//formula for converting into celcius
String temp1 = String.format("%.2f", temp);
System.out.println(i+" " +temp1);
}
}
}
class ConversionDemo {//main class
public static void main(String[] args) {//main method
Tempconversion f=new Tempconversion();//object creation
f.farenheattocelcius(40);//calling method
f.celciustofarenheat(120);
}
}
output
Celcius Farenheat
-----------------------------
40 104.0
39 102.2
38 100.4
37 98.6
36 96.8
35 95.0
34 93.2
33 91.4
32 89.6
31 87.8
Farenheat Celcius
-----------------------------
120 48.89
110 43.33
100 37.78
90 32.22
80 26.67
70 21.11
60 15.56
50 10.00
40 4.44
30 -1.11
Solution
ConversionDemo.java
import java.util.*;//package for scanner class
class Tempconversion//temperature conversion class
{
public void farenheattocelcius(double temp)
{//method for farenheat to celcius conversion
System.out.println("Celcius Farenheat");
System.out.println("-----------------------------");
for(int i=(int) temp;i>30;i--)
{
temp = ((9.0*i)/5+32);//formula for converting into celcius
System.out.println(i+" " +temp);
}
}
public void celciustofarenheat(double temp)
{//method for converting celcius to farenheat
System.out.println("Farenheat Celcius");
System.out.println("-----------------------------");
for(int i=(int) temp;i>=30;i=i-10)
{
temp = 5.0*(i - 32)/9;//formula for converting into celcius
String temp1 = String.format("%.2f", temp);
System.out.println(i+" " +temp1);
}
}
}
class ConversionDemo {//main class
public static void main(String[] args) {//main method
Tempconversion f=new Tempconversion();//object creation
f.farenheattocelcius(40);//calling method
f.celciustofarenheat(120);
}
}
output
Celcius Farenheat
-----------------------------
40 104.0
39 102.2
38 100.4
37 98.6
36 96.8
35 95.0
34 93.2
33 91.4
32 89.6
31 87.8
Farenheat Celcius
-----------------------------
120 48.89
110 43.33
100 37.78
90 32.22
80 26.67
70 21.11
60 15.56
50 10.00
40 4.44
30 -1.11

More Related Content

Similar to ConversionDemo.javaimport java.util.;package for scanner class.pdf

Military time and Standard time, JavaOne of the assignments given .pdf
Military time and Standard time, JavaOne of the assignments given .pdfMilitary time and Standard time, JavaOne of the assignments given .pdf
Military time and Standard time, JavaOne of the assignments given .pdfmarketing413921
 
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.pdfadhityalapcare
 
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.pdfanfenterprises
 
Structures
StructuresStructures
StructuresSV.CO
 
You are to simulate a dispatcher using a priority queue system in C+.pdf
You are to simulate a dispatcher using a priority queue system in C+.pdfYou are to simulate a dispatcher using a priority queue system in C+.pdf
You are to simulate a dispatcher using a priority queue system in C+.pdfJUSTSTYLISH3B2MOHALI
 
package employeeType.employee;public class Employee {    private.pdf
package employeeType.employee;public class Employee {    private.pdfpackage employeeType.employee;public class Employee {    private.pdf
package employeeType.employee;public class Employee {    private.pdfsharnapiyush773
 
I have done it under neatbeans IDE and just added ToggleGroup for gr.pdf
I have done it under neatbeans IDE and just added ToggleGroup for gr.pdfI have done it under neatbeans IDE and just added ToggleGroup for gr.pdf
I have done it under neatbeans IDE and just added ToggleGroup for gr.pdfannaimobiles
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuningAOE
 
help me Java projectI put problem and my own code in the linkmy .pdf
help me Java projectI put problem and my own code in the linkmy .pdfhelp me Java projectI put problem and my own code in the linkmy .pdf
help me Java projectI put problem and my own code in the linkmy .pdfarihantmum
 
The current program only run one iteration of the KMeans algorithm. .docx
The current program only run one iteration of the KMeans algorithm. .docxThe current program only run one iteration of the KMeans algorithm. .docx
The current program only run one iteration of the KMeans algorithm. .docxtodd241
 
C346_PA3_W12srccommonBaseThread.javaC346_PA3_W12srccommonB.docx
C346_PA3_W12srccommonBaseThread.javaC346_PA3_W12srccommonB.docxC346_PA3_W12srccommonBaseThread.javaC346_PA3_W12srccommonB.docx
C346_PA3_W12srccommonBaseThread.javaC346_PA3_W12srccommonB.docxhumphrieskalyn
 

Similar to ConversionDemo.javaimport java.util.;package for scanner class.pdf (14)

Military time and Standard time, JavaOne of the assignments given .pdf
Military time and Standard time, JavaOne of the assignments given .pdfMilitary time and Standard time, JavaOne of the assignments given .pdf
Military time and Standard time, JavaOne of the assignments given .pdf
 
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
 
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
 
Structures
StructuresStructures
Structures
 
You are to simulate a dispatcher using a priority queue system in C+.pdf
You are to simulate a dispatcher using a priority queue system in C+.pdfYou are to simulate a dispatcher using a priority queue system in C+.pdf
You are to simulate a dispatcher using a priority queue system in C+.pdf
 
package employeeType.employee;public class Employee {    private.pdf
package employeeType.employee;public class Employee {    private.pdfpackage employeeType.employee;public class Employee {    private.pdf
package employeeType.employee;public class Employee {    private.pdf
 
I have done it under neatbeans IDE and just added ToggleGroup for gr.pdf
I have done it under neatbeans IDE and just added ToggleGroup for gr.pdfI have done it under neatbeans IDE and just added ToggleGroup for gr.pdf
I have done it under neatbeans IDE and just added ToggleGroup for gr.pdf
 
Composing method
Composing methodComposing method
Composing method
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuning
 
MK1_Addendum
MK1_AddendumMK1_Addendum
MK1_Addendum
 
5 Rmi Print
5  Rmi Print5  Rmi Print
5 Rmi Print
 
help me Java projectI put problem and my own code in the linkmy .pdf
help me Java projectI put problem and my own code in the linkmy .pdfhelp me Java projectI put problem and my own code in the linkmy .pdf
help me Java projectI put problem and my own code in the linkmy .pdf
 
The current program only run one iteration of the KMeans algorithm. .docx
The current program only run one iteration of the KMeans algorithm. .docxThe current program only run one iteration of the KMeans algorithm. .docx
The current program only run one iteration of the KMeans algorithm. .docx
 
C346_PA3_W12srccommonBaseThread.javaC346_PA3_W12srccommonB.docx
C346_PA3_W12srccommonBaseThread.javaC346_PA3_W12srccommonB.docxC346_PA3_W12srccommonBaseThread.javaC346_PA3_W12srccommonB.docx
C346_PA3_W12srccommonBaseThread.javaC346_PA3_W12srccommonB.docx
 

More from mukhtaransarcloth

S monoclinic is most stable since entropy is the .pdf
                     S monoclinic is most stable since entropy is the .pdf                     S monoclinic is most stable since entropy is the .pdf
S monoclinic is most stable since entropy is the .pdfmukhtaransarcloth
 
Option D is correct. B is limiting reagent .pdf
                     Option D is correct.  B is limiting reagent      .pdf                     Option D is correct.  B is limiting reagent      .pdf
Option D is correct. B is limiting reagent .pdfmukhtaransarcloth
 
Let us assume the conc of Ba(OH)2 is known to us .pdf
                     Let us assume the conc of Ba(OH)2 is known to us .pdf                     Let us assume the conc of Ba(OH)2 is known to us .pdf
Let us assume the conc of Ba(OH)2 is known to us .pdfmukhtaransarcloth
 
london dispersion forces .pdf
                     london dispersion forces                         .pdf                     london dispersion forces                         .pdf
london dispersion forces .pdfmukhtaransarcloth
 
Methods a, b, c, and e are formal additions of H2.pdf
                     Methods a, b, c, and e are formal additions of H2.pdf                     Methods a, b, c, and e are formal additions of H2.pdf
Methods a, b, c, and e are formal additions of H2.pdfmukhtaransarcloth
 
h2s4 structure is H-S-S-S-S-H there for two middl.pdf
                     h2s4 structure is H-S-S-S-S-H there for two middl.pdf                     h2s4 structure is H-S-S-S-S-H there for two middl.pdf
h2s4 structure is H-S-S-S-S-H there for two middl.pdfmukhtaransarcloth
 
freezing point decreases with increase in imp.pdf
                     freezing point decreases   with  increase  in imp.pdf                     freezing point decreases   with  increase  in imp.pdf
freezing point decreases with increase in imp.pdfmukhtaransarcloth
 
We are currently living in the so-called information age which can b.pdf
We are currently living in the so-called information age which can b.pdfWe are currently living in the so-called information age which can b.pdf
We are currently living in the so-called information age which can b.pdfmukhtaransarcloth
 
The balanced equation is2 H2O2 = 2 H2O + O2SolutionThe bal.pdf
The balanced equation is2 H2O2 = 2 H2O + O2SolutionThe bal.pdfThe balanced equation is2 H2O2 = 2 H2O + O2SolutionThe bal.pdf
The balanced equation is2 H2O2 = 2 H2O + O2SolutionThe bal.pdfmukhtaransarcloth
 
Tay-Sachs disease is caused by a mutation (abnormal change) in the g.pdf
Tay-Sachs disease is caused by a mutation (abnormal change) in the g.pdfTay-Sachs disease is caused by a mutation (abnormal change) in the g.pdf
Tay-Sachs disease is caused by a mutation (abnormal change) in the g.pdfmukhtaransarcloth
 
E.) is less acidic in other A ,B triple bond an.pdf
                     E.) is less acidic   in other A ,B triple bond an.pdf                     E.) is less acidic   in other A ,B triple bond an.pdf
E.) is less acidic in other A ,B triple bond an.pdfmukhtaransarcloth
 
Solution when user sending the email, then user should select eithe.pdf
Solution when user sending the email, then user should select eithe.pdfSolution when user sending the email, then user should select eithe.pdf
Solution when user sending the email, then user should select eithe.pdfmukhtaransarcloth
 
publicclass Date {privatestatic String DATE_SEPARATOR = ;pr.pdf
publicclass Date {privatestatic String DATE_SEPARATOR = ;pr.pdfpublicclass Date {privatestatic String DATE_SEPARATOR = ;pr.pdf
publicclass Date {privatestatic String DATE_SEPARATOR = ;pr.pdfmukhtaransarcloth
 
please give me points as nobody ecen noticed the qusetion as it is u.pdf
please give me points as nobody ecen noticed the qusetion as it is u.pdfplease give me points as nobody ecen noticed the qusetion as it is u.pdf
please give me points as nobody ecen noticed the qusetion as it is u.pdfmukhtaransarcloth
 
Part-IQuestion 1. What is Dr. Warren’s hypothesis regarding the ba.pdf
Part-IQuestion 1. What is Dr. Warren’s hypothesis regarding the ba.pdfPart-IQuestion 1. What is Dr. Warren’s hypothesis regarding the ba.pdf
Part-IQuestion 1. What is Dr. Warren’s hypothesis regarding the ba.pdfmukhtaransarcloth
 
Peru is not a part of the Southern South America.SolutionPeru .pdf
Peru is not a part of the Southern South America.SolutionPeru .pdfPeru is not a part of the Southern South America.SolutionPeru .pdf
Peru is not a part of the Southern South America.SolutionPeru .pdfmukhtaransarcloth
 
Combustion of glucose is respiration. The equatio.pdf
                     Combustion of glucose is respiration. The equatio.pdf                     Combustion of glucose is respiration. The equatio.pdf
Combustion of glucose is respiration. The equatio.pdfmukhtaransarcloth
 
in truss one...the forces in the member BC and DE have zero.in tru.pdf
in truss one...the forces in the member BC and DE have zero.in tru.pdfin truss one...the forces in the member BC and DE have zero.in tru.pdf
in truss one...the forces in the member BC and DE have zero.in tru.pdfmukhtaransarcloth
 
iam giving you entire process of  forensc duplication;the response.pdf
iam giving you entire process of  forensc duplication;the response.pdfiam giving you entire process of  forensc duplication;the response.pdf
iam giving you entire process of  forensc duplication;the response.pdfmukhtaransarcloth
 

More from mukhtaransarcloth (20)

S monoclinic is most stable since entropy is the .pdf
                     S monoclinic is most stable since entropy is the .pdf                     S monoclinic is most stable since entropy is the .pdf
S monoclinic is most stable since entropy is the .pdf
 
Option D is correct. B is limiting reagent .pdf
                     Option D is correct.  B is limiting reagent      .pdf                     Option D is correct.  B is limiting reagent      .pdf
Option D is correct. B is limiting reagent .pdf
 
Let us assume the conc of Ba(OH)2 is known to us .pdf
                     Let us assume the conc of Ba(OH)2 is known to us .pdf                     Let us assume the conc of Ba(OH)2 is known to us .pdf
Let us assume the conc of Ba(OH)2 is known to us .pdf
 
london dispersion forces .pdf
                     london dispersion forces                         .pdf                     london dispersion forces                         .pdf
london dispersion forces .pdf
 
Methods a, b, c, and e are formal additions of H2.pdf
                     Methods a, b, c, and e are formal additions of H2.pdf                     Methods a, b, c, and e are formal additions of H2.pdf
Methods a, b, c, and e are formal additions of H2.pdf
 
h2s4 structure is H-S-S-S-S-H there for two middl.pdf
                     h2s4 structure is H-S-S-S-S-H there for two middl.pdf                     h2s4 structure is H-S-S-S-S-H there for two middl.pdf
h2s4 structure is H-S-S-S-S-H there for two middl.pdf
 
freezing point decreases with increase in imp.pdf
                     freezing point decreases   with  increase  in imp.pdf                     freezing point decreases   with  increase  in imp.pdf
freezing point decreases with increase in imp.pdf
 
We are currently living in the so-called information age which can b.pdf
We are currently living in the so-called information age which can b.pdfWe are currently living in the so-called information age which can b.pdf
We are currently living in the so-called information age which can b.pdf
 
The balanced equation is2 H2O2 = 2 H2O + O2SolutionThe bal.pdf
The balanced equation is2 H2O2 = 2 H2O + O2SolutionThe bal.pdfThe balanced equation is2 H2O2 = 2 H2O + O2SolutionThe bal.pdf
The balanced equation is2 H2O2 = 2 H2O + O2SolutionThe bal.pdf
 
Tay-Sachs disease is caused by a mutation (abnormal change) in the g.pdf
Tay-Sachs disease is caused by a mutation (abnormal change) in the g.pdfTay-Sachs disease is caused by a mutation (abnormal change) in the g.pdf
Tay-Sachs disease is caused by a mutation (abnormal change) in the g.pdf
 
E.) is less acidic in other A ,B triple bond an.pdf
                     E.) is less acidic   in other A ,B triple bond an.pdf                     E.) is less acidic   in other A ,B triple bond an.pdf
E.) is less acidic in other A ,B triple bond an.pdf
 
Solution when user sending the email, then user should select eithe.pdf
Solution when user sending the email, then user should select eithe.pdfSolution when user sending the email, then user should select eithe.pdf
Solution when user sending the email, then user should select eithe.pdf
 
publicclass Date {privatestatic String DATE_SEPARATOR = ;pr.pdf
publicclass Date {privatestatic String DATE_SEPARATOR = ;pr.pdfpublicclass Date {privatestatic String DATE_SEPARATOR = ;pr.pdf
publicclass Date {privatestatic String DATE_SEPARATOR = ;pr.pdf
 
please give me points as nobody ecen noticed the qusetion as it is u.pdf
please give me points as nobody ecen noticed the qusetion as it is u.pdfplease give me points as nobody ecen noticed the qusetion as it is u.pdf
please give me points as nobody ecen noticed the qusetion as it is u.pdf
 
covalent bond .pdf
                     covalent bond                                    .pdf                     covalent bond                                    .pdf
covalent bond .pdf
 
Part-IQuestion 1. What is Dr. Warren’s hypothesis regarding the ba.pdf
Part-IQuestion 1. What is Dr. Warren’s hypothesis regarding the ba.pdfPart-IQuestion 1. What is Dr. Warren’s hypothesis regarding the ba.pdf
Part-IQuestion 1. What is Dr. Warren’s hypothesis regarding the ba.pdf
 
Peru is not a part of the Southern South America.SolutionPeru .pdf
Peru is not a part of the Southern South America.SolutionPeru .pdfPeru is not a part of the Southern South America.SolutionPeru .pdf
Peru is not a part of the Southern South America.SolutionPeru .pdf
 
Combustion of glucose is respiration. The equatio.pdf
                     Combustion of glucose is respiration. The equatio.pdf                     Combustion of glucose is respiration. The equatio.pdf
Combustion of glucose is respiration. The equatio.pdf
 
in truss one...the forces in the member BC and DE have zero.in tru.pdf
in truss one...the forces in the member BC and DE have zero.in tru.pdfin truss one...the forces in the member BC and DE have zero.in tru.pdf
in truss one...the forces in the member BC and DE have zero.in tru.pdf
 
iam giving you entire process of  forensc duplication;the response.pdf
iam giving you entire process of  forensc duplication;the response.pdfiam giving you entire process of  forensc duplication;the response.pdf
iam giving you entire process of  forensc duplication;the response.pdf
 

Recently uploaded

latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answersdalebeck957
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111GangaMaiya1
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningMarc Dusseiller Dusjagr
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17Celine George
 

Recently uploaded (20)

latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 

ConversionDemo.javaimport java.util.;package for scanner class.pdf

  • 1. ConversionDemo.java import java.util.*;//package for scanner class class Tempconversion//temperature conversion class { public void farenheattocelcius(double temp) {//method for farenheat to celcius conversion System.out.println("Celcius Farenheat"); System.out.println("-----------------------------"); for(int i=(int) temp;i>30;i--) { temp = ((9.0*i)/5+32);//formula for converting into celcius System.out.println(i+" " +temp); } } public void celciustofarenheat(double temp) {//method for converting celcius to farenheat System.out.println("Farenheat Celcius"); System.out.println("-----------------------------"); for(int i=(int) temp;i>=30;i=i-10) { temp = 5.0*(i - 32)/9;//formula for converting into celcius String temp1 = String.format("%.2f", temp); System.out.println(i+" " +temp1); } } } class ConversionDemo {//main class public static void main(String[] args) {//main method
  • 2. Tempconversion f=new Tempconversion();//object creation f.farenheattocelcius(40);//calling method f.celciustofarenheat(120); } } output Celcius Farenheat ----------------------------- 40 104.0 39 102.2 38 100.4 37 98.6 36 96.8 35 95.0 34 93.2 33 91.4 32 89.6 31 87.8 Farenheat Celcius ----------------------------- 120 48.89 110 43.33 100 37.78 90 32.22 80 26.67 70 21.11 60 15.56 50 10.00 40 4.44 30 -1.11 Solution ConversionDemo.java
  • 3. import java.util.*;//package for scanner class class Tempconversion//temperature conversion class { public void farenheattocelcius(double temp) {//method for farenheat to celcius conversion System.out.println("Celcius Farenheat"); System.out.println("-----------------------------"); for(int i=(int) temp;i>30;i--) { temp = ((9.0*i)/5+32);//formula for converting into celcius System.out.println(i+" " +temp); } } public void celciustofarenheat(double temp) {//method for converting celcius to farenheat System.out.println("Farenheat Celcius"); System.out.println("-----------------------------"); for(int i=(int) temp;i>=30;i=i-10) { temp = 5.0*(i - 32)/9;//formula for converting into celcius String temp1 = String.format("%.2f", temp); System.out.println(i+" " +temp1); } } } class ConversionDemo {//main class public static void main(String[] args) {//main method Tempconversion f=new Tempconversion();//object creation
  • 4. f.farenheattocelcius(40);//calling method f.celciustofarenheat(120); } } output Celcius Farenheat ----------------------------- 40 104.0 39 102.2 38 100.4 37 98.6 36 96.8 35 95.0 34 93.2 33 91.4 32 89.6 31 87.8 Farenheat Celcius ----------------------------- 120 48.89 110 43.33 100 37.78 90 32.22 80 26.67 70 21.11 60 15.56 50 10.00 40 4.44 30 -1.11