SlideShare une entreprise Scribd logo
1  sur  1
Télécharger pour lire hors ligne
In this module, you learned about creating functions in C++ and how to combine functions with
the concepts covered in previous modules to solve problems.
For this assignment you will create a program converting Fahrenheit temperatures to Celsius
temperatures.
The formula for converting a temperature from Celsius to Fahrenheit is, multiply by 1.8 (or 9/5)
and add 32.:
F = C x 1.8 + 32 , where F is the Fahrenheit temperature and C is the Celsius temperature.
The formula for convert a temperature in degrees Fahrenheit to Celsius, subtract 32 and multiply
by .5556 (or 5/9).
C = (F - 32) x .5556 , where F is the Fahrenheit temperature and C is the Celsius temperature.
Write a function named f ahrenheitconverter that accepts a Celsius temperature as an argument
and returns the temperature converted to Fahrenheit.
Write a second function named celsiusconverter that accepts a Fahrenheit temperature as an
argument and returns the temperature converted to Celsius.
Demonstrate the functions by accepting the different temperatures from a user and displaying the
temperature converted to Fahrenheit and Celsius. Be sure to include comments throughout your
code where appropriate.
Make sure the output formatting is appropriate for the values provide

Contenu connexe

Plus de asravi1982

Plus de asravi1982 (20)

Indicate which of these structures might be found associated with cell.pdf
Indicate which of these structures might be found associated with cell.pdfIndicate which of these structures might be found associated with cell.pdf
Indicate which of these structures might be found associated with cell.pdf
 
Inflation rates can be computed for overall indexes or for individual.pdf
Inflation rates can be computed for overall indexes or for individual.pdfInflation rates can be computed for overall indexes or for individual.pdf
Inflation rates can be computed for overall indexes or for individual.pdf
 
Inequality in the distribution of income and wealth is increased by th.pdf
Inequality in the distribution of income and wealth is increased by th.pdfInequality in the distribution of income and wealth is increased by th.pdf
Inequality in the distribution of income and wealth is increased by th.pdf
 
Ine 3 sin -31.pdf
Ine 3 sin -31.pdfIne 3 sin -31.pdf
Ine 3 sin -31.pdf
 
Ineed just the answer 5) High concentration of solutes in the small.pdf
Ineed just the answer    5) High concentration of solutes in the small.pdfIneed just the answer    5) High concentration of solutes in the small.pdf
Ineed just the answer 5) High concentration of solutes in the small.pdf
 
Industrialization is only possible when scientists focus on Question 4.pdf
Industrialization is only possible when scientists focus on Question 4.pdfIndustrialization is only possible when scientists focus on Question 4.pdf
Industrialization is only possible when scientists focus on Question 4.pdf
 
Individuals who are able to lead their employees through a variety of.pdf
Individuals who are able to lead their employees through a variety of.pdfIndividuals who are able to lead their employees through a variety of.pdf
Individuals who are able to lead their employees through a variety of.pdf
 
Individuals in a random sample of 150 were asked whether they supporte.pdf
Individuals in a random sample of 150 were asked whether they supporte.pdfIndividuals in a random sample of 150 were asked whether they supporte.pdf
Individuals in a random sample of 150 were asked whether they supporte.pdf
 
Individual Assignment A framework for studying Organizational Behavior.pdf
Individual Assignment A framework for studying Organizational Behavior.pdfIndividual Assignment A framework for studying Organizational Behavior.pdf
Individual Assignment A framework for studying Organizational Behavior.pdf
 
Indicate which of the following groups of genes typically creates a tr.pdf
Indicate which of the following groups of genes typically creates a tr.pdfIndicate which of the following groups of genes typically creates a tr.pdf
Indicate which of the following groups of genes typically creates a tr.pdf
 
Increased emigration Increased immigration Increased birth rate Increa.pdf
Increased emigration Increased immigration Increased birth rate Increa.pdfIncreased emigration Increased immigration Increased birth rate Increa.pdf
Increased emigration Increased immigration Increased birth rate Increa.pdf
 
Indigo Inc- is trying to determine whether to use the FIFO or average.pdf
Indigo Inc- is trying to determine whether to use the FIFO or average.pdfIndigo Inc- is trying to determine whether to use the FIFO or average.pdf
Indigo Inc- is trying to determine whether to use the FIFO or average.pdf
 
Indicate whether the following audit procedure is a Test of Control (T (1).pdf
Indicate whether the following audit procedure is a Test of Control (T (1).pdfIndicate whether the following audit procedure is a Test of Control (T (1).pdf
Indicate whether the following audit procedure is a Test of Control (T (1).pdf
 
Indicate the primary audit objective for the following audit procedure (1).pdf
Indicate the primary audit objective for the following audit procedure (1).pdfIndicate the primary audit objective for the following audit procedure (1).pdf
Indicate the primary audit objective for the following audit procedure (1).pdf
 
In your opinion- does Bitcoin work better than fiat money- Please answ.pdf
In your opinion- does Bitcoin work better than fiat money- Please answ.pdfIn your opinion- does Bitcoin work better than fiat money- Please answ.pdf
In your opinion- does Bitcoin work better than fiat money- Please answ.pdf
 
In which direction are secretory proteins transported through the Golg.pdf
In which direction are secretory proteins transported through the Golg.pdfIn which direction are secretory proteins transported through the Golg.pdf
In which direction are secretory proteins transported through the Golg.pdf
 
In winter- Earth's axis- tilts away from the Sun is completely covered.pdf
In winter- Earth's axis- tilts away from the Sun is completely covered.pdfIn winter- Earth's axis- tilts away from the Sun is completely covered.pdf
In winter- Earth's axis- tilts away from the Sun is completely covered.pdf
 
In Twitter v- Elon Musk- the basis of the original suit was a crime a.pdf
In Twitter v- Elon Musk- the basis of the original suit was a crime a.pdfIn Twitter v- Elon Musk- the basis of the original suit was a crime a.pdf
In Twitter v- Elon Musk- the basis of the original suit was a crime a.pdf
 
In what ways are the development of adaptations constrained- How does.pdf
In what ways are the development of adaptations constrained- How does.pdfIn what ways are the development of adaptations constrained- How does.pdf
In what ways are the development of adaptations constrained- How does.pdf
 
In two communities of similar size and age structure ( A and b-- there.pdf
In two communities of similar size and age structure ( A and b-- there.pdfIn two communities of similar size and age structure ( A and b-- there.pdf
In two communities of similar size and age structure ( A and b-- there.pdf
 

Dernier

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
QucHHunhnh
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Dernier (20)

On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
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
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
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
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 

In this module- you learned about creating functions in C++ and how to.pdf

  • 1. In this module, you learned about creating functions in C++ and how to combine functions with the concepts covered in previous modules to solve problems. For this assignment you will create a program converting Fahrenheit temperatures to Celsius temperatures. The formula for converting a temperature from Celsius to Fahrenheit is, multiply by 1.8 (or 9/5) and add 32.: F = C x 1.8 + 32 , where F is the Fahrenheit temperature and C is the Celsius temperature. The formula for convert a temperature in degrees Fahrenheit to Celsius, subtract 32 and multiply by .5556 (or 5/9). C = (F - 32) x .5556 , where F is the Fahrenheit temperature and C is the Celsius temperature. Write a function named f ahrenheitconverter that accepts a Celsius temperature as an argument and returns the temperature converted to Fahrenheit. Write a second function named celsiusconverter that accepts a Fahrenheit temperature as an argument and returns the temperature converted to Celsius. Demonstrate the functions by accepting the different temperatures from a user and displaying the temperature converted to Fahrenheit and Celsius. Be sure to include comments throughout your code where appropriate. Make sure the output formatting is appropriate for the values provide