SlideShare a Scribd company logo
1 of 2
Download to read offline
I have to write a java program . So basically I have to take my input in only cms. Inches is also
accepted but the inches should be converted into the cms before the program take in the input .
So when the program takes the input , the input must be in cm .
I have to write a java program . So basically I have to take my input in only cms. Inches is also
accepted but the inches should be converted into the cms before the program take in the input .
So when the program takes the input , the input must be in cm .
Solution
import java.io.*;
import java.util.*;
class InchesToCms{
public static void main (String[] args)throws Exception{
//1 Inches = 2.54 Centimeters;
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));//to get
input creating bf is an object.
System.out.print("Enter the inches: ");//asking the input is inches
float inches = Float.parseFloat(bf.readLine());//geting input first in string,so convert into
float using parseFloat function.
float cms = inches * 2.54f;//multiplying given input inches and 2.54.
System.out.println(inches + " inches is " + cms + " centimeter(s).");//display the inches
and centimeters.
System.out.print("Enter the Centimeters: ");//asking the input is Centimeters.
float CMS = Float.parseFloat(bf.readLine());
System.out.println("You entered " +CMS+ " centimeter(s).");//display out put in
Centimeters only.
}
}
/* Output:
1) Enter the inches: 11.0
11.0 inches is 27.939999 centimeter(s).
Enter the Centimeters: 2.0
You entered 2.0 centimeter(s).
Explanatin:
This program 1) It takes input in inches and convert into centimeters
2) and Next It takes input in centimters and display the out in the same centimeters.
*/

More Related Content

Similar to I have to write a java program . So basically I have to take my in.pdf

Tutorial basic of c ++lesson 1 eng ver
Tutorial basic of c ++lesson 1 eng verTutorial basic of c ++lesson 1 eng ver
Tutorial basic of c ++lesson 1 eng verQrembiezs Intruder
 
Programs that work in c and not in c
Programs that work in c and not in cPrograms that work in c and not in c
Programs that work in c and not in cAjay Chimmani
 
import java.util.Scanner;import java.text.DecimalFormat;import j.pdf
import java.util.Scanner;import java.text.DecimalFormat;import j.pdfimport java.util.Scanner;import java.text.DecimalFormat;import j.pdf
import java.util.Scanner;import java.text.DecimalFormat;import j.pdfKUNALHARCHANDANI1
 
H U F F M A N Algorithm
H U F F M A N AlgorithmH U F F M A N Algorithm
H U F F M A N AlgorithmJade Danial
 
P1.javaimport java.util.Scanner;keyboard inputting package pub.pdf
P1.javaimport java.util.Scanner;keyboard inputting package pub.pdfP1.javaimport java.util.Scanner;keyboard inputting package pub.pdf
P1.javaimport java.util.Scanner;keyboard inputting package pub.pdfaquacareser
 
Fundamental of programming Fundamental of programming
Fundamental of programming Fundamental of programmingFundamental of programming Fundamental of programming
Fundamental of programming Fundamental of programmingLidetAdmassu
 
Java: Class Design Examples
Java: Class Design ExamplesJava: Class Design Examples
Java: Class Design ExamplesTareq Hasan
 
iOS,From Development to Distribution
iOS,From Development to DistributioniOS,From Development to Distribution
iOS,From Development to DistributionTunvir Rahman Tusher
 
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018Wim Selles
 
Chapter 2 - Structure of C++ Program
Chapter 2 - Structure of C++ ProgramChapter 2 - Structure of C++ Program
Chapter 2 - Structure of C++ ProgramDeepak Singh
 
c++basics.ppt
c++basics.pptc++basics.ppt
c++basics.pptEPORI
 

Similar to I have to write a java program . So basically I have to take my in.pdf (20)

unit_2.pptx
unit_2.pptxunit_2.pptx
unit_2.pptx
 
unit_2 (1).pptx
unit_2 (1).pptxunit_2 (1).pptx
unit_2 (1).pptx
 
Tutorial basic of c ++lesson 1 eng ver
Tutorial basic of c ++lesson 1 eng verTutorial basic of c ++lesson 1 eng ver
Tutorial basic of c ++lesson 1 eng ver
 
C++basics
C++basicsC++basics
C++basics
 
Cocoa heads 09112017
Cocoa heads 09112017Cocoa heads 09112017
Cocoa heads 09112017
 
Cpp
CppCpp
Cpp
 
Programs that work in c and not in c
Programs that work in c and not in cPrograms that work in c and not in c
Programs that work in c and not in c
 
import java.util.Scanner;import java.text.DecimalFormat;import j.pdf
import java.util.Scanner;import java.text.DecimalFormat;import j.pdfimport java.util.Scanner;import java.text.DecimalFormat;import j.pdf
import java.util.Scanner;import java.text.DecimalFormat;import j.pdf
 
H U F F M A N Algorithm
H U F F M A N AlgorithmH U F F M A N Algorithm
H U F F M A N Algorithm
 
P1.javaimport java.util.Scanner;keyboard inputting package pub.pdf
P1.javaimport java.util.Scanner;keyboard inputting package pub.pdfP1.javaimport java.util.Scanner;keyboard inputting package pub.pdf
P1.javaimport java.util.Scanner;keyboard inputting package pub.pdf
 
Fundamental of programming Fundamental of programming
Fundamental of programming Fundamental of programmingFundamental of programming Fundamental of programming
Fundamental of programming Fundamental of programming
 
Java: Class Design Examples
Java: Class Design ExamplesJava: Class Design Examples
Java: Class Design Examples
 
iOS,From Development to Distribution
iOS,From Development to DistributioniOS,From Development to Distribution
iOS,From Development to Distribution
 
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
 
ACM init()- Day 4
ACM init()- Day 4ACM init()- Day 4
ACM init()- Day 4
 
Chapter 2 - Structure of C++ Program
Chapter 2 - Structure of C++ ProgramChapter 2 - Structure of C++ Program
Chapter 2 - Structure of C++ Program
 
c++basics.ppt
c++basics.pptc++basics.ppt
c++basics.ppt
 
C++basics
C++basicsC++basics
C++basics
 
C++basics
C++basicsC++basics
C++basics
 
c++basics.ppt
c++basics.pptc++basics.ppt
c++basics.ppt
 

More from FashionBoutiquedelhi

Questions1) How does multimedia transmission differ than messag.pdf
Questions1) How does multimedia transmission differ than messag.pdfQuestions1) How does multimedia transmission differ than messag.pdf
Questions1) How does multimedia transmission differ than messag.pdfFashionBoutiquedelhi
 
Question 1 of 10 Map sapling learning Based on the chart to the right.pdf
Question 1 of 10 Map sapling learning Based on the chart to the right.pdfQuestion 1 of 10 Map sapling learning Based on the chart to the right.pdf
Question 1 of 10 Map sapling learning Based on the chart to the right.pdfFashionBoutiquedelhi
 
please send edited code of RCBug.javaRCBUG.javaimport java.util..pdf
please send edited code of RCBug.javaRCBUG.javaimport java.util..pdfplease send edited code of RCBug.javaRCBUG.javaimport java.util..pdf
please send edited code of RCBug.javaRCBUG.javaimport java.util..pdfFashionBoutiquedelhi
 
On January 1, 2002, Germany officially adopted the euro as its curre.pdf
On January 1, 2002, Germany officially adopted the euro as its curre.pdfOn January 1, 2002, Germany officially adopted the euro as its curre.pdf
On January 1, 2002, Germany officially adopted the euro as its curre.pdfFashionBoutiquedelhi
 
Networking problem help Consider the following TCP session between h.pdf
Networking problem help Consider the following TCP session between h.pdfNetworking problem help Consider the following TCP session between h.pdf
Networking problem help Consider the following TCP session between h.pdfFashionBoutiquedelhi
 
Lipid bilayers can only be synthesized by biological organisms. This .pdf
Lipid bilayers can only be synthesized by biological organisms. This .pdfLipid bilayers can only be synthesized by biological organisms. This .pdf
Lipid bilayers can only be synthesized by biological organisms. This .pdfFashionBoutiquedelhi
 
Is a neutral trait (meaning it is neither deleterious nor advantageo.pdf
Is a neutral trait (meaning it is neither deleterious nor advantageo.pdfIs a neutral trait (meaning it is neither deleterious nor advantageo.pdf
Is a neutral trait (meaning it is neither deleterious nor advantageo.pdfFashionBoutiquedelhi
 
Let T R^n rightarrow R^m be a linear transformation. Given a subspa.pdf
Let T  R^n rightarrow R^m be a linear transformation. Given a subspa.pdfLet T  R^n rightarrow R^m be a linear transformation. Given a subspa.pdf
Let T R^n rightarrow R^m be a linear transformation. Given a subspa.pdfFashionBoutiquedelhi
 
Just a general question on some vocab words I cannot piece together .pdf
Just a general question on some vocab words I cannot piece together .pdfJust a general question on some vocab words I cannot piece together .pdf
Just a general question on some vocab words I cannot piece together .pdfFashionBoutiquedelhi
 
In order to be useful to managers, management accounting reports shou.pdf
In order to be useful to managers, management accounting reports shou.pdfIn order to be useful to managers, management accounting reports shou.pdf
In order to be useful to managers, management accounting reports shou.pdfFashionBoutiquedelhi
 
Im also confused on question 9 and 10 On which point(s) would Charle.pdf
Im also confused on question 9 and 10 On which point(s) would Charle.pdfIm also confused on question 9 and 10 On which point(s) would Charle.pdf
Im also confused on question 9 and 10 On which point(s) would Charle.pdfFashionBoutiquedelhi
 
In about six billion years, our suns luminosity (a.k.a. power outpu.pdf
In about six billion years, our suns luminosity (a.k.a. power outpu.pdfIn about six billion years, our suns luminosity (a.k.a. power outpu.pdf
In about six billion years, our suns luminosity (a.k.a. power outpu.pdfFashionBoutiquedelhi
 
Fill in the blanks.Intensity of orangebrownred color of reduced .pdf
Fill in the blanks.Intensity of orangebrownred color of reduced .pdfFill in the blanks.Intensity of orangebrownred color of reduced .pdf
Fill in the blanks.Intensity of orangebrownred color of reduced .pdfFashionBoutiquedelhi
 
Explain how cellular respiration (O2 consumption and CO2 production).pdf
Explain how cellular respiration (O2 consumption and CO2 production).pdfExplain how cellular respiration (O2 consumption and CO2 production).pdf
Explain how cellular respiration (O2 consumption and CO2 production).pdfFashionBoutiquedelhi
 
Entrepreneurship isA. one of the basic rights of the private enter.pdf
Entrepreneurship isA. one of the basic rights of the private enter.pdfEntrepreneurship isA. one of the basic rights of the private enter.pdf
Entrepreneurship isA. one of the basic rights of the private enter.pdfFashionBoutiquedelhi
 
Discrete Random Variables we are working with commonly used discre.pdf
Discrete Random Variables we are working with commonly used discre.pdfDiscrete Random Variables we are working with commonly used discre.pdf
Discrete Random Variables we are working with commonly used discre.pdfFashionBoutiquedelhi
 
Determine the open intervals over which the function is increasing an.pdf
Determine the open intervals over which the function is increasing an.pdfDetermine the open intervals over which the function is increasing an.pdf
Determine the open intervals over which the function is increasing an.pdfFashionBoutiquedelhi
 
Discuss and define Isotropy. Anisotropy and Orthotropy with regards t.pdf
Discuss and define Isotropy. Anisotropy and Orthotropy with regards t.pdfDiscuss and define Isotropy. Anisotropy and Orthotropy with regards t.pdf
Discuss and define Isotropy. Anisotropy and Orthotropy with regards t.pdfFashionBoutiquedelhi
 
Consider the circuits in figure 2.32. If we assume the transistors ar.pdf
Consider the circuits in figure 2.32. If we assume the transistors ar.pdfConsider the circuits in figure 2.32. If we assume the transistors ar.pdf
Consider the circuits in figure 2.32. If we assume the transistors ar.pdfFashionBoutiquedelhi
 
Can you please debug this Thank you in advance! This program is sup.pdf
Can you please debug this Thank you in advance! This program is sup.pdfCan you please debug this Thank you in advance! This program is sup.pdf
Can you please debug this Thank you in advance! This program is sup.pdfFashionBoutiquedelhi
 

More from FashionBoutiquedelhi (20)

Questions1) How does multimedia transmission differ than messag.pdf
Questions1) How does multimedia transmission differ than messag.pdfQuestions1) How does multimedia transmission differ than messag.pdf
Questions1) How does multimedia transmission differ than messag.pdf
 
Question 1 of 10 Map sapling learning Based on the chart to the right.pdf
Question 1 of 10 Map sapling learning Based on the chart to the right.pdfQuestion 1 of 10 Map sapling learning Based on the chart to the right.pdf
Question 1 of 10 Map sapling learning Based on the chart to the right.pdf
 
please send edited code of RCBug.javaRCBUG.javaimport java.util..pdf
please send edited code of RCBug.javaRCBUG.javaimport java.util..pdfplease send edited code of RCBug.javaRCBUG.javaimport java.util..pdf
please send edited code of RCBug.javaRCBUG.javaimport java.util..pdf
 
On January 1, 2002, Germany officially adopted the euro as its curre.pdf
On January 1, 2002, Germany officially adopted the euro as its curre.pdfOn January 1, 2002, Germany officially adopted the euro as its curre.pdf
On January 1, 2002, Germany officially adopted the euro as its curre.pdf
 
Networking problem help Consider the following TCP session between h.pdf
Networking problem help Consider the following TCP session between h.pdfNetworking problem help Consider the following TCP session between h.pdf
Networking problem help Consider the following TCP session between h.pdf
 
Lipid bilayers can only be synthesized by biological organisms. This .pdf
Lipid bilayers can only be synthesized by biological organisms. This .pdfLipid bilayers can only be synthesized by biological organisms. This .pdf
Lipid bilayers can only be synthesized by biological organisms. This .pdf
 
Is a neutral trait (meaning it is neither deleterious nor advantageo.pdf
Is a neutral trait (meaning it is neither deleterious nor advantageo.pdfIs a neutral trait (meaning it is neither deleterious nor advantageo.pdf
Is a neutral trait (meaning it is neither deleterious nor advantageo.pdf
 
Let T R^n rightarrow R^m be a linear transformation. Given a subspa.pdf
Let T  R^n rightarrow R^m be a linear transformation. Given a subspa.pdfLet T  R^n rightarrow R^m be a linear transformation. Given a subspa.pdf
Let T R^n rightarrow R^m be a linear transformation. Given a subspa.pdf
 
Just a general question on some vocab words I cannot piece together .pdf
Just a general question on some vocab words I cannot piece together .pdfJust a general question on some vocab words I cannot piece together .pdf
Just a general question on some vocab words I cannot piece together .pdf
 
In order to be useful to managers, management accounting reports shou.pdf
In order to be useful to managers, management accounting reports shou.pdfIn order to be useful to managers, management accounting reports shou.pdf
In order to be useful to managers, management accounting reports shou.pdf
 
Im also confused on question 9 and 10 On which point(s) would Charle.pdf
Im also confused on question 9 and 10 On which point(s) would Charle.pdfIm also confused on question 9 and 10 On which point(s) would Charle.pdf
Im also confused on question 9 and 10 On which point(s) would Charle.pdf
 
In about six billion years, our suns luminosity (a.k.a. power outpu.pdf
In about six billion years, our suns luminosity (a.k.a. power outpu.pdfIn about six billion years, our suns luminosity (a.k.a. power outpu.pdf
In about six billion years, our suns luminosity (a.k.a. power outpu.pdf
 
Fill in the blanks.Intensity of orangebrownred color of reduced .pdf
Fill in the blanks.Intensity of orangebrownred color of reduced .pdfFill in the blanks.Intensity of orangebrownred color of reduced .pdf
Fill in the blanks.Intensity of orangebrownred color of reduced .pdf
 
Explain how cellular respiration (O2 consumption and CO2 production).pdf
Explain how cellular respiration (O2 consumption and CO2 production).pdfExplain how cellular respiration (O2 consumption and CO2 production).pdf
Explain how cellular respiration (O2 consumption and CO2 production).pdf
 
Entrepreneurship isA. one of the basic rights of the private enter.pdf
Entrepreneurship isA. one of the basic rights of the private enter.pdfEntrepreneurship isA. one of the basic rights of the private enter.pdf
Entrepreneurship isA. one of the basic rights of the private enter.pdf
 
Discrete Random Variables we are working with commonly used discre.pdf
Discrete Random Variables we are working with commonly used discre.pdfDiscrete Random Variables we are working with commonly used discre.pdf
Discrete Random Variables we are working with commonly used discre.pdf
 
Determine the open intervals over which the function is increasing an.pdf
Determine the open intervals over which the function is increasing an.pdfDetermine the open intervals over which the function is increasing an.pdf
Determine the open intervals over which the function is increasing an.pdf
 
Discuss and define Isotropy. Anisotropy and Orthotropy with regards t.pdf
Discuss and define Isotropy. Anisotropy and Orthotropy with regards t.pdfDiscuss and define Isotropy. Anisotropy and Orthotropy with regards t.pdf
Discuss and define Isotropy. Anisotropy and Orthotropy with regards t.pdf
 
Consider the circuits in figure 2.32. If we assume the transistors ar.pdf
Consider the circuits in figure 2.32. If we assume the transistors ar.pdfConsider the circuits in figure 2.32. If we assume the transistors ar.pdf
Consider the circuits in figure 2.32. If we assume the transistors ar.pdf
 
Can you please debug this Thank you in advance! This program is sup.pdf
Can you please debug this Thank you in advance! This program is sup.pdfCan you please debug this Thank you in advance! This program is sup.pdf
Can you please debug this Thank you in advance! This program is sup.pdf
 

Recently uploaded

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
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesAmanpreetKaur157993
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024Borja Sotomayor
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽中 央社
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhleson0603
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSean M. Fox
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
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
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint23600690
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................MirzaAbrarBaig5
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportDenish Jangid
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxLimon Prince
 

Recently uploaded (20)

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
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
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
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 

I have to write a java program . So basically I have to take my in.pdf

  • 1. I have to write a java program . So basically I have to take my input in only cms. Inches is also accepted but the inches should be converted into the cms before the program take in the input . So when the program takes the input , the input must be in cm . I have to write a java program . So basically I have to take my input in only cms. Inches is also accepted but the inches should be converted into the cms before the program take in the input . So when the program takes the input , the input must be in cm . Solution import java.io.*; import java.util.*; class InchesToCms{ public static void main (String[] args)throws Exception{ //1 Inches = 2.54 Centimeters; BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));//to get input creating bf is an object. System.out.print("Enter the inches: ");//asking the input is inches float inches = Float.parseFloat(bf.readLine());//geting input first in string,so convert into float using parseFloat function. float cms = inches * 2.54f;//multiplying given input inches and 2.54. System.out.println(inches + " inches is " + cms + " centimeter(s).");//display the inches and centimeters. System.out.print("Enter the Centimeters: ");//asking the input is Centimeters. float CMS = Float.parseFloat(bf.readLine()); System.out.println("You entered " +CMS+ " centimeter(s).");//display out put in Centimeters only. } } /* Output: 1) Enter the inches: 11.0 11.0 inches is 27.939999 centimeter(s).
  • 2. Enter the Centimeters: 2.0 You entered 2.0 centimeter(s). Explanatin: This program 1) It takes input in inches and convert into centimeters 2) and Next It takes input in centimters and display the out in the same centimeters. */