Answer:
See explanation
Explanation:
The attachment show that you've attempted the question already.
I'll assist in making corrections to your source code.
First, edit line 5 to
if(r<= 255 and g<=255 and b <=255):
Then edit line 8 to:
if(r>= 255):
Then edit line 11 to:
if(g>= 255):
Lastly, edit line 14 to:
if(b>= 255):
<em>Other part of the attachment is correct</em>
Answer:
#include <iostream>
using namespace std;
void CoordTransform(int *ptr1, int *ptr2);
int main()
{
int xVal;
int yVal;
cout<<"please enter two valid integers";
cin>>xVal;
cin>>yVal;
CoordTransform(&xVal , &yVal);
int xValNew=xVal;
int yValNew=yVal;
cout<<xValNew<<yValNew;
return 0;
}
void CoordTransform(int *ptr1, int *ptr2)
{
int a = *ptr1;
*ptr1=(*ptr1+1)*2;
*ptr2=(*ptr2+1)*2;
}
Explanation:
It will return new values in previously defined variables
coding language: c++
Answer:
Correct code for the above question which is written after the defined list to display the output.
for x,y in country_pop.items(): #for loop to prints the list items.
print(str(x)+" has "+str(y)+" people") #print function to print the value.
Output:
- The above code is in python language which display the output as the above question demands.
Explanation:
- The above question code is written in python language to display the result, but this code is not correct.
- The above code needs a 'for' loop, which will render the list item one by one.
- The above-list defined in the form of key-value pair, So there is a need for the ''item" function which is the part of the python dictionary to display the list items.
- There also needs to define the two variables in the for loop, one is for key and the other is for value.