lo this you will no longer need an if statement. cout << quotient << endl; tient = numl / num2; is "; number; t << ''Enter an even number: ' in >> number; f (number $ 2 != 0) out <<'"Number must be even. Reenter number: hile (number $ 2 != 0) ; The formula for converting a temperature from Fahrenheit to Celsius is (F - 32) e Fis the Fahrenheit temperature and C is the Celsius temperature. Write a function ed Celsius that accepts a Fahrenheit temperature as an argument. The function should n the temperature, converted to Celsius. Demonstrate the function by calling it in a loop displays a table of the Fahrenheit temperatures 0 through 20 and their Celsius equivalen ce the following program and tell what each will display. ssume the user enters 38711. Use a calculator.) clude ng namespace std; main () double salary, monthly; cout << "What is your annual''; Cin >> salary; Monthly = static cast(salary)/12:

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
cout << ''Enter an even number: ";
you do this you will no longer need an if statement.
cout << quotient << endl;
quotient = numl / num2;
Tim
cout << "
int number;
do
{ cin >> number;
at <<'Number must be even. Reenter number: '":
} while (number % 2 != 0) ;
if (number % 2 != 0)
0. The formula for converting a temperature from Fahrenheit to Celsius is
c=(F- 32)
where F is the Fahrenheit temperature and Cis the Celsius temperature. Write a function
named Celsius that accepts a Fahrenheit temperature as an argument. The function should
return the temperature, converted to Celsius. Demonstrate the function by calling it in a loop
that displays a table of the Fahrenheit temperatures 0 through 20 and their Celsius equivalents.
7. Trace the following program and tell what each will display,
A) (Assume the user enters 38711. Use a calculator.)
#include <iostream>
using namespace std;
int main ()
double salary, monthly;
cout << ''What is your annual'';
Cin >> salary;
Monthly =
static cast<int>(salary)/12; I
Transcribed Image Text:cout << ''Enter an even number: "; you do this you will no longer need an if statement. cout << quotient << endl; quotient = numl / num2; Tim cout << " int number; do { cin >> number; at <<'Number must be even. Reenter number: '": } while (number % 2 != 0) ; if (number % 2 != 0) 0. The formula for converting a temperature from Fahrenheit to Celsius is c=(F- 32) where F is the Fahrenheit temperature and Cis the Celsius temperature. Write a function named Celsius that accepts a Fahrenheit temperature as an argument. The function should return the temperature, converted to Celsius. Demonstrate the function by calling it in a loop that displays a table of the Fahrenheit temperatures 0 through 20 and their Celsius equivalents. 7. Trace the following program and tell what each will display, A) (Assume the user enters 38711. Use a calculator.) #include <iostream> using namespace std; int main () double salary, monthly; cout << ''What is your annual''; Cin >> salary; Monthly = static cast<int>(salary)/12; I
* Separate each part of questions by a blank line and try to be neat..
* Manage your time and answer first to the questions that are easier to answer.
* Use of any books, papers, mobile devices, computers or calculators is not permitted.
1. A program contains the following function.
int cube (int num)
return num
num
num; }
Write a statement that passes the value 4 to this function and assigns its return value to tihe
variable result.
What will each of the following program segments display?
2.int x
1;
while (x < 10)
x++;
cout << x;
1; row <= 3; row++)
3. for (int row =
{cout << ''\n$ '';
for (int digit = 1; digit <= 4; digit++)
cout << '9';
4. The following program segment has errors. Find as many as you can.
double numl, num2, quotient;
cout << "Enter a number: ";
Cin >> numl;
cout << "Enter another number: ";
Cin >> num2;
if (num2
cout << "Division by zero is not possible. \n"
cout << "Please run the program again ";
cout << "and enter a number besides zero. \n"
lse
Transcribed Image Text:* Separate each part of questions by a blank line and try to be neat.. * Manage your time and answer first to the questions that are easier to answer. * Use of any books, papers, mobile devices, computers or calculators is not permitted. 1. A program contains the following function. int cube (int num) return num num num; } Write a statement that passes the value 4 to this function and assigns its return value to tihe variable result. What will each of the following program segments display? 2.int x 1; while (x < 10) x++; cout << x; 1; row <= 3; row++) 3. for (int row = {cout << ''\n$ ''; for (int digit = 1; digit <= 4; digit++) cout << '9'; 4. The following program segment has errors. Find as many as you can. double numl, num2, quotient; cout << "Enter a number: "; Cin >> numl; cout << "Enter another number: "; Cin >> num2; if (num2 cout << "Division by zero is not possible. \n" cout << "Please run the program again "; cout << "and enter a number besides zero. \n" lse
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY