Suppose you are asked to convert temperature from Celsius to Fahrenheit, and Fahrenheit to Celsius. Write a complete C++ program that contains all of the following: a) A function definition named CelsiusToFahrenheit() that receives the temperature in Celsius through its parameter. This function will calculate and return the value in Fahrenheit. The conversion is calculated by the following formula: fahrenheit - (celsius * 9.0) / 5.0 + 32; b) A function definition named FahrenheitTocelsius() that receives the temperature in Fahrenheit through its parameter. This function will calculate and return the value in Celsius. The conversion is calculated by the following formula: celsius - (fahrenheit - 32.0) * 5.0 / 9.0; c) A main () program to do the following:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Task 1
Suppose you are asked to convert temperature from Celsius to Fahrenheit, and Fahrenheit to Celsius.
Write a complete C+ program that contains all of the following:
a) A function definition named CelsiusTOFahrenheit() that receives the temperature in
Celsius through its parameter. This function will calculate and return the value in Fahrenheit. The
conversion is calculated by the following formula:
fahrenheit = (celsius * 9.0) / 5.0 + 32;
b) A function definition named FahrenheitToCelsius() that receives the temperature in
Fahrenheit through its parameter. This function will calculate and return the value in Celsius. The
conversion is calculated by the following formula:
celsius - (fahrenheit
- 32.0) * 5.0 / 9.0;
c) A main () program to do the following:
* Display the following menu:
OPTION
OPERATION
1
Convert from Celsius to Fahrenheit
Convert from Fahrenheit to Celsius
3
Exit
Figure 1
v User needs to input the option based on the displayed menu as shown in Figure 1. Print the
error message if the user enters a number other than the listed options.
* Write the appropriate function call mentioned above based on the user input and display the
output.
Transcribed Image Text:Task 1 Suppose you are asked to convert temperature from Celsius to Fahrenheit, and Fahrenheit to Celsius. Write a complete C+ program that contains all of the following: a) A function definition named CelsiusTOFahrenheit() that receives the temperature in Celsius through its parameter. This function will calculate and return the value in Fahrenheit. The conversion is calculated by the following formula: fahrenheit = (celsius * 9.0) / 5.0 + 32; b) A function definition named FahrenheitToCelsius() that receives the temperature in Fahrenheit through its parameter. This function will calculate and return the value in Celsius. The conversion is calculated by the following formula: celsius - (fahrenheit - 32.0) * 5.0 / 9.0; c) A main () program to do the following: * Display the following menu: OPTION OPERATION 1 Convert from Celsius to Fahrenheit Convert from Fahrenheit to Celsius 3 Exit Figure 1 v User needs to input the option based on the displayed menu as shown in Figure 1. Print the error message if the user enters a number other than the listed options. * Write the appropriate function call mentioned above based on the user input and display the output.
S Shopee Seller Centre
x b Answered: Table 1: The result x
M array and function c++ quest X
O
array and function c++ quest X
Upload Documents for Free A x +
O File | file:///C:/Users/user/Downloads/array%20and%20function%20c++%20question.pdf
I Apps M Gmail
YouTube
O Maps
E Reading list
array and function c++ question.pdf
2 / 2|
+ | O 0
75%
Task 2
Given logical representation of an array:
1
2
3
5
6.
7
angka
2
-1
3
8
-3
9 5
-4
-7
1
a) Declare and initialize an array named angka based on the above diagram
1
b) Write a program segment to:
(i)
Display each elements of array angka
(ii)
Display each elements of array angka in reversed order
▬▬▬-
(iii)
Calculate and display the sum and average of elements in array angka
(iv)
Determine and display the highest and lowest elements in array angka
(v) Count and display how many positive and negative numbers stored in array angka
2
12:03 PM
P Type here to search
27°C
A E ENG
W
7/13/2021
Transcribed Image Text:S Shopee Seller Centre x b Answered: Table 1: The result x M array and function c++ quest X O array and function c++ quest X Upload Documents for Free A x + O File | file:///C:/Users/user/Downloads/array%20and%20function%20c++%20question.pdf I Apps M Gmail YouTube O Maps E Reading list array and function c++ question.pdf 2 / 2| + | O 0 75% Task 2 Given logical representation of an array: 1 2 3 5 6. 7 angka 2 -1 3 8 -3 9 5 -4 -7 1 a) Declare and initialize an array named angka based on the above diagram 1 b) Write a program segment to: (i) Display each elements of array angka (ii) Display each elements of array angka in reversed order ▬▬▬- (iii) Calculate and display the sum and average of elements in array angka (iv) Determine and display the highest and lowest elements in array angka (v) Count and display how many positive and negative numbers stored in array angka 2 12:03 PM P Type here to search 27°C A E ENG W 7/13/2021
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Concept of Parenthesis
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education