Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The purpose of this lab is to practice the following: Passing parameters by reference. Write and run the following code. Write a short paragraph where

The purpose of this lab is to practice the following:
Passing parameters by reference.
Write and run the following code. Write a short paragraph where you explain the output.
Be sure that your explanation includes the mechanics of pass-by-value and pass-by-
reference.
-void recolor(int& red, int& green, int& blue){
??? reduce red value by 10%
//reduce green value by 15%
red red ***.1;
green = green - round green **.15) ;
}
Gvoid lab_02(){
int r,g,b;
std: : cout "Enter integer values for red, green, and blue. "
"Values v must be in range s.t.v256.?
";
std: : cout "Red: ";
std: :cin r;
std: :cout "Green: ";
std::cin gi
std: : cout "Blue: ";
std: :cin >b;
recolor (r,g,b);
std: : cout "After recoloring," ";
std: :printf("red =*d, green =*d, blue =%d {:?
?'',r,g,b);
}
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions