Question
Useing Jython Environment for Students (JES), Version 5.0 Write the code in Jython and test your program. Remember to include comments in the code! PSEUDOCODE
Useing Jython Environment for Students (JES), Version 5.0
Write the code in Jython and test your program. Remember to include comments in the code!
PSEUDOCODE
As usual, bold monospace is actual code and italic serif is pseudocode to guide you. Do not forget to add a header comment and inline comments!!
def main( ):
Have the user select a picture file and create a picture from it
Display the picture
Get a number from the user representing the percentage change as a whole number.
(By this I mean they will enter 25 to mean 25%)
Convert the percentage to the decimal equivalent by dividing by 100.0.
(I will refer to this as 'percentage' below)
for px in getPixels( your picture ):
Get the red, green, and blue components of the pixel (in variable px)
Calculate the new green value by multiplying the old one by 1+percentage
Calculate the new red and blue values by multiplying each by 1-percentage
Set the pixel's color bands to these new values you calculated
repaint( pic )
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started