What is the output of the following for loop? for (int i=6; i>2; i-=2) cout << i < endl; What is the output of the following do-while loop int x-2, y=10; do cout << y << " y *= x; x++; } while (x<5); What are two errors in the following function declaration that will cause compiler errors? Suggest a potential fix for each error. float funcNew (float numl, float num2) while (num2>0) num2--; numl -= num2; cout << num1; Write the function definition for the function max that takes in two floats and returns the larger float. Consider the following function definition: char mystery (int a, int b) { if (a <- b) return 'V'; else return 'A'; Circle each of the following lines that will cause the letter 'A' to be output to the screen. (At least one line below will cause 'A' to be output to the screen.) cout « mystery (12,12); cout <« mystery (21,13); cout <« mystery (4,12); cout « mystery (8,-8); Explain why there is a compiler error in the function call included in the two lines below. How can we fix the error? int r=22, t=11; cout << mystery (int r, int t) « endl

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
100%
What is the output of the following for loop?
for (int i=6; i>2; i-=2)
cout << i < endl;
What is the output of the following do-while loop
int x-2, y=10;
do
cout << y << "
y *= x;
x++;
} while (x<5);
What are two errors in the following function declaration that will cause compiler errors?
Suggest a potential fix for each error.
float funcNew (float numl, float num2)
while (num2>0)
num2--;
numl -= num2;
cout << num1;
Transcribed Image Text:What is the output of the following for loop? for (int i=6; i>2; i-=2) cout << i < endl; What is the output of the following do-while loop int x-2, y=10; do cout << y << " y *= x; x++; } while (x<5); What are two errors in the following function declaration that will cause compiler errors? Suggest a potential fix for each error. float funcNew (float numl, float num2) while (num2>0) num2--; numl -= num2; cout << num1;
Write the function definition for the function max that takes in two floats and returns the
larger float.
Consider the following function definition:
char mystery (int a, int b) {
if (a <- b)
return 'V';
else
return 'A';
Circle each of the following lines that will cause the letter 'A' to be output to the screen. (At
least one line below will cause 'A' to be output to the screen.)
cout « mystery (12,12);
cout <« mystery (21,13);
cout <« mystery (4,12);
cout « mystery (8,-8);
Explain why there is a compiler error in the function call included in the two lines below. How
can we fix the error?
int r=22, t=11;
cout << mystery (int r, int t) « endl
Transcribed Image Text:Write the function definition for the function max that takes in two floats and returns the larger float. Consider the following function definition: char mystery (int a, int b) { if (a <- b) return 'V'; else return 'A'; Circle each of the following lines that will cause the letter 'A' to be output to the screen. (At least one line below will cause 'A' to be output to the screen.) cout « mystery (12,12); cout <« mystery (21,13); cout <« mystery (4,12); cout « mystery (8,-8); Explain why there is a compiler error in the function call included in the two lines below. How can we fix the error? int r=22, t=11; cout << mystery (int r, int t) « endl
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar 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