SlideShare a Scribd company logo
1 of 1
Download to read offline
A. Write an application where the main method holds two double variables. Assign values to the
variables. Pass both variables to a method named computePercent() that displays the two values
and the value of the first number as a percentage of the second one. Save the file as
Percentages.java. Example: If the numbers are 2.0 and 5.0 Output: 2.0 is 40 percent of 5.0.
B. Modify the program above (Percentages.java) to accept values of the two doubles in the main
method from a user at the keyboard. Save the file as UserPercentages.java. Output: Enter in two
numbers: 2.0 5.0 2.0 is 40 percent of 5.0

More Related Content

More from ankkarao9652

Abstract Classes, Virtual Functions and Polymorphism Code Review.pdf
Abstract Classes, Virtual Functions and Polymorphism Code Review.pdfAbstract Classes, Virtual Functions and Polymorphism Code Review.pdf
Abstract Classes, Virtual Functions and Polymorphism Code Review.pdfankkarao9652
 
a) Si la tasa de los fondos federales estuviera por debajo del nivel.pdf
a) Si la tasa de los fondos federales estuviera por debajo del nivel.pdfa) Si la tasa de los fondos federales estuviera por debajo del nivel.pdf
a) Si la tasa de los fondos federales estuviera por debajo del nivel.pdfankkarao9652
 
a) Is f(x,y) a proper probability density function Show workb) Wh.pdf
a) Is f(x,y) a proper probability density function Show workb) Wh.pdfa) Is f(x,y) a proper probability density function Show workb) Wh.pdf
a) Is f(x,y) a proper probability density function Show workb) Wh.pdfankkarao9652
 
a) In the Serba Dinamik Holdings Bhd (SDHB) case context, what are t.pdf
a) In the Serba Dinamik Holdings Bhd (SDHB) case context, what are t.pdfa) In the Serba Dinamik Holdings Bhd (SDHB) case context, what are t.pdf
a) In the Serba Dinamik Holdings Bhd (SDHB) case context, what are t.pdfankkarao9652
 
A) How much less do each of these firms earn in the Nash equilibrium.pdf
A) How much less do each of these firms earn in the Nash equilibrium.pdfA) How much less do each of these firms earn in the Nash equilibrium.pdf
A) How much less do each of these firms earn in the Nash equilibrium.pdfankkarao9652
 
According to classical economistsSelect oneO a. The velocity.pdf
According to classical economistsSelect oneO a. The velocity.pdfAccording to classical economistsSelect oneO a. The velocity.pdf
According to classical economistsSelect oneO a. The velocity.pdfankkarao9652
 
Access a governments CAFR (or use the one obtained in Learning Plan .pdf
Access a governments CAFR (or use the one obtained in Learning Plan .pdfAccess a governments CAFR (or use the one obtained in Learning Plan .pdf
Access a governments CAFR (or use the one obtained in Learning Plan .pdfankkarao9652
 
ABC Oil Exploration was undergoing a financial statement audit. The .pdf
ABC Oil Exploration was undergoing a financial statement audit. The .pdfABC Oil Exploration was undergoing a financial statement audit. The .pdf
ABC Oil Exploration was undergoing a financial statement audit. The .pdfankkarao9652
 
ABBC Y. 805060T1102540y210250r=0.04 Find npv and which Project is bett.pdf
ABBC Y. 805060T1102540y210250r=0.04 Find npv and which Project is bett.pdfABBC Y. 805060T1102540y210250r=0.04 Find npv and which Project is bett.pdf
ABBC Y. 805060T1102540y210250r=0.04 Find npv and which Project is bett.pdfankkarao9652
 
A2-3. Imagine an economy that keeps all of its money in the form of .pdf
A2-3. Imagine an economy that keeps all of its money in the form of .pdfA2-3. Imagine an economy that keeps all of its money in the form of .pdf
A2-3. Imagine an economy that keeps all of its money in the form of .pdfankkarao9652
 
Aaron Feuerstein, presidente de Malden Mills, celebr� su cumplea�os .pdf
Aaron Feuerstein, presidente de Malden Mills, celebr� su cumplea�os .pdfAaron Feuerstein, presidente de Malden Mills, celebr� su cumplea�os .pdf
Aaron Feuerstein, presidente de Malden Mills, celebr� su cumplea�os .pdfankkarao9652
 
A.) En vida, casi todos los caracoles (Clase Gastropoda) construyen .pdf
A.) En vida, casi todos los caracoles (Clase Gastropoda) construyen .pdfA.) En vida, casi todos los caracoles (Clase Gastropoda) construyen .pdf
A.) En vida, casi todos los caracoles (Clase Gastropoda) construyen .pdfankkarao9652
 
A U.S. firm holds an asset in Israel and faces the following scenari.pdf
A U.S. firm holds an asset in Israel and faces the following scenari.pdfA U.S. firm holds an asset in Israel and faces the following scenari.pdf
A U.S. firm holds an asset in Israel and faces the following scenari.pdfankkarao9652
 
A. What must be true for the transcription of the trp operon to be a.pdf
A. What must be true for the transcription of the trp operon to be a.pdfA. What must be true for the transcription of the trp operon to be a.pdf
A. What must be true for the transcription of the trp operon to be a.pdfankkarao9652
 
a. Using the data from the table, for all death calculate 1) The pr.pdf
a. Using the data from the table, for all death calculate 1) The pr.pdfa. Using the data from the table, for all death calculate 1) The pr.pdf
a. Using the data from the table, for all death calculate 1) The pr.pdfankkarao9652
 
A. SupuestosB. L�neas de baseC. ProcesosD. Limit.pdf
A. SupuestosB. L�neas de baseC. ProcesosD. Limit.pdfA. SupuestosB. L�neas de baseC. ProcesosD. Limit.pdf
A. SupuestosB. L�neas de baseC. ProcesosD. Limit.pdfankkarao9652
 
a. Si las personas que viven en alg�n lugar de la galaxia A observan.pdf
a. Si las personas que viven en alg�n lugar de la galaxia A observan.pdfa. Si las personas que viven en alg�n lugar de la galaxia A observan.pdf
a. Si las personas que viven en alg�n lugar de la galaxia A observan.pdfankkarao9652
 
a. Los procesos para producir penicilina y queso azul utilizan el ho.pdf
a. Los procesos para producir penicilina y queso azul utilizan el ho.pdfa. Los procesos para producir penicilina y queso azul utilizan el ho.pdf
a. Los procesos para producir penicilina y queso azul utilizan el ho.pdfankkarao9652
 

More from ankkarao9652 (20)

Abstract Classes, Virtual Functions and Polymorphism Code Review.pdf
Abstract Classes, Virtual Functions and Polymorphism Code Review.pdfAbstract Classes, Virtual Functions and Polymorphism Code Review.pdf
Abstract Classes, Virtual Functions and Polymorphism Code Review.pdf
 
a) Si la tasa de los fondos federales estuviera por debajo del nivel.pdf
a) Si la tasa de los fondos federales estuviera por debajo del nivel.pdfa) Si la tasa de los fondos federales estuviera por debajo del nivel.pdf
a) Si la tasa de los fondos federales estuviera por debajo del nivel.pdf
 
a) Is f(x,y) a proper probability density function Show workb) Wh.pdf
a) Is f(x,y) a proper probability density function Show workb) Wh.pdfa) Is f(x,y) a proper probability density function Show workb) Wh.pdf
a) Is f(x,y) a proper probability density function Show workb) Wh.pdf
 
a) In the Serba Dinamik Holdings Bhd (SDHB) case context, what are t.pdf
a) In the Serba Dinamik Holdings Bhd (SDHB) case context, what are t.pdfa) In the Serba Dinamik Holdings Bhd (SDHB) case context, what are t.pdf
a) In the Serba Dinamik Holdings Bhd (SDHB) case context, what are t.pdf
 
A) How much less do each of these firms earn in the Nash equilibrium.pdf
A) How much less do each of these firms earn in the Nash equilibrium.pdfA) How much less do each of these firms earn in the Nash equilibrium.pdf
A) How much less do each of these firms earn in the Nash equilibrium.pdf
 
According to classical economistsSelect oneO a. The velocity.pdf
According to classical economistsSelect oneO a. The velocity.pdfAccording to classical economistsSelect oneO a. The velocity.pdf
According to classical economistsSelect oneO a. The velocity.pdf
 
Access a governments CAFR (or use the one obtained in Learning Plan .pdf
Access a governments CAFR (or use the one obtained in Learning Plan .pdfAccess a governments CAFR (or use the one obtained in Learning Plan .pdf
Access a governments CAFR (or use the one obtained in Learning Plan .pdf
 
ABC Oil Exploration was undergoing a financial statement audit. The .pdf
ABC Oil Exploration was undergoing a financial statement audit. The .pdfABC Oil Exploration was undergoing a financial statement audit. The .pdf
ABC Oil Exploration was undergoing a financial statement audit. The .pdf
 
ABBC Y. 805060T1102540y210250r=0.04 Find npv and which Project is bett.pdf
ABBC Y. 805060T1102540y210250r=0.04 Find npv and which Project is bett.pdfABBC Y. 805060T1102540y210250r=0.04 Find npv and which Project is bett.pdf
ABBC Y. 805060T1102540y210250r=0.04 Find npv and which Project is bett.pdf
 
A2-3. Imagine an economy that keeps all of its money in the form of .pdf
A2-3. Imagine an economy that keeps all of its money in the form of .pdfA2-3. Imagine an economy that keeps all of its money in the form of .pdf
A2-3. Imagine an economy that keeps all of its money in the form of .pdf
 
Aaron Feuerstein, presidente de Malden Mills, celebr� su cumplea�os .pdf
Aaron Feuerstein, presidente de Malden Mills, celebr� su cumplea�os .pdfAaron Feuerstein, presidente de Malden Mills, celebr� su cumplea�os .pdf
Aaron Feuerstein, presidente de Malden Mills, celebr� su cumplea�os .pdf
 
A={0,1}.pdf
A={0,1}.pdfA={0,1}.pdf
A={0,1}.pdf
 
A=(b)(2)R2.pdf
A=(b)(2)R2.pdfA=(b)(2)R2.pdf
A=(b)(2)R2.pdf
 
A.) En vida, casi todos los caracoles (Clase Gastropoda) construyen .pdf
A.) En vida, casi todos los caracoles (Clase Gastropoda) construyen .pdfA.) En vida, casi todos los caracoles (Clase Gastropoda) construyen .pdf
A.) En vida, casi todos los caracoles (Clase Gastropoda) construyen .pdf
 
A U.S. firm holds an asset in Israel and faces the following scenari.pdf
A U.S. firm holds an asset in Israel and faces the following scenari.pdfA U.S. firm holds an asset in Israel and faces the following scenari.pdf
A U.S. firm holds an asset in Israel and faces the following scenari.pdf
 
A. What must be true for the transcription of the trp operon to be a.pdf
A. What must be true for the transcription of the trp operon to be a.pdfA. What must be true for the transcription of the trp operon to be a.pdf
A. What must be true for the transcription of the trp operon to be a.pdf
 
a. Using the data from the table, for all death calculate 1) The pr.pdf
a. Using the data from the table, for all death calculate 1) The pr.pdfa. Using the data from the table, for all death calculate 1) The pr.pdf
a. Using the data from the table, for all death calculate 1) The pr.pdf
 
A. SupuestosB. L�neas de baseC. ProcesosD. Limit.pdf
A. SupuestosB. L�neas de baseC. ProcesosD. Limit.pdfA. SupuestosB. L�neas de baseC. ProcesosD. Limit.pdf
A. SupuestosB. L�neas de baseC. ProcesosD. Limit.pdf
 
a. Si las personas que viven en alg�n lugar de la galaxia A observan.pdf
a. Si las personas que viven en alg�n lugar de la galaxia A observan.pdfa. Si las personas que viven en alg�n lugar de la galaxia A observan.pdf
a. Si las personas que viven en alg�n lugar de la galaxia A observan.pdf
 
a. Los procesos para producir penicilina y queso azul utilizan el ho.pdf
a. Los procesos para producir penicilina y queso azul utilizan el ho.pdfa. Los procesos para producir penicilina y queso azul utilizan el ho.pdf
a. Los procesos para producir penicilina y queso azul utilizan el ho.pdf
 

Recently uploaded

Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 

Recently uploaded (20)

Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 

A. Write an application where the main method holds two double varia.pdf

  • 1. A. Write an application where the main method holds two double variables. Assign values to the variables. Pass both variables to a method named computePercent() that displays the two values and the value of the first number as a percentage of the second one. Save the file as Percentages.java. Example: If the numbers are 2.0 and 5.0 Output: 2.0 is 40 percent of 5.0. B. Modify the program above (Percentages.java) to accept values of the two doubles in the main method from a user at the keyboard. Save the file as UserPercentages.java. Output: Enter in two numbers: 2.0 5.0 2.0 is 40 percent of 5.0