Cookie Monster is friends with many different monsters. The monsters often have fur in all sorts...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Cookie Monster is friends with many different monsters. The monsters often have fur in all sorts of colors. For this question, you will write a program that will let the user explore what Cookie Monster might look like if his fur was a different color. The following describes what your program should do in more detail • Draw a picture of Cookie Monster's face in the middle of the canvas • Initially. Cookie Monster's fur should be blue • Pressing the 'r' key increases the red component of Cookie Monster's fur color by a small amount. The more the 'r' key is pressed, the redder the fur should become. • Pressing the 'g' key increases the green component of Cookie Monster's fur in the same way. . Clicking the mouse should reset Cookie Monster's fur to its original, pure blue color. Figure 2: Cookie Monster's original face, and again after having pressed 'r' and 'g' multiple times Recalling the Model-View-Controller programming style, you will need to think about how to build a model for this program. What pieces of information will your program need to remember over time? You'll need a variable for each such piece of information, and these variables ARE your model of the problem. If a piece of information does NOT change, it does not need to be part of your model. Once you've decided on your model, you simply have to choose the right interactive functions to put code that will either display or change the model as appropriate. In particular. • The draw() function is your view. Function calls to background() and code that draws any portion of Cookie Monster's face should ONLY go here (it is fine to encapsulate the code that draws the face into its own function, as long as that function is only called in draw()) • The mouseClicked () and keyPressed () functions are your controllers. Statements that change the variables in your model should go here. Cookie Monster is friends with many different monsters. The monsters often have fur in all sorts of colors. For this question, you will write a program that will let the user explore what Cookie Monster might look like if his fur was a different color. The following describes what your program should do in more detail • Draw a picture of Cookie Monster's face in the middle of the canvas • Initially. Cookie Monster's fur should be blue • Pressing the 'r' key increases the red component of Cookie Monster's fur color by a small amount. The more the 'r' key is pressed, the redder the fur should become. • Pressing the 'g' key increases the green component of Cookie Monster's fur in the same way. . Clicking the mouse should reset Cookie Monster's fur to its original, pure blue color. Figure 2: Cookie Monster's original face, and again after having pressed 'r' and 'g' multiple times Recalling the Model-View-Controller programming style, you will need to think about how to build a model for this program. What pieces of information will your program need to remember over time? You'll need a variable for each such piece of information, and these variables ARE your model of the problem. If a piece of information does NOT change, it does not need to be part of your model. Once you've decided on your model, you simply have to choose the right interactive functions to put code that will either display or change the model as appropriate. In particular. • The draw() function is your view. Function calls to background() and code that draws any portion of Cookie Monster's face should ONLY go here (it is fine to encapsulate the code that draws the face into its own function, as long as that function is only called in draw()) • The mouseClicked () and keyPressed () functions are your controllers. Statements that change the variables in your model should go here.
Expert Answer:
Answer rating: 100% (QA)
It seems you are looking for guidance on how to create an interactive program that adjusts the color of Cookie Monsters fur based on key presses follo... View the full answer
Related Book For
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba
Posted Date:
Students also viewed these programming questions
-
Assume a money market with safe and risky borrowers. The MFI's that is ready to lend money does not know who is safe and who is risky. However experience has led the MFI to know that 50% of the...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Please write an summary according to the article. Please don't copy from others and write full view of article in the summary. Value creation. Wealth creation. These are really powerful words. Maybe...
-
Is the State of Michigan justified in advertising the prize amount as $1.586 billion? Explain.
-
Bird-Bath, inc., experienced four situation for its supplies. Compute the amounts that have been left blank for each situation For situations 1 and 2, Journalize the needed transaction. Consider each...
-
Suppose \(\vec{E}=2 \vec{A}+3 \vec{B}\) where vector \(\vec{A}\) has components \(A_{x}=5, A_{y}=2\) and vector \(\vec{B}\) has components \(B_{x}=-3, B_{y}=-5\). a. What are the \(x\) - and...
-
What are some audit steps to catch skimming and money-laundering schemes?
-
Preston & Grover Soap Company manufactures powdered detergent. Phosphate is placed in process in the Making Department, where it is turned into granulars. The output of Making is transferred to the...
-
would you please elaborate wtih formulas the following parts Sun Products Company (SPC) uses only debt and equity. It can borrow unlimited amounts at an interest rate of 12% so long as it ?nances...
-
Will Googles pay strategy work forever? Consider the evolution of Microsofts pay strategy as its growth slackened. Should Google prepare for a similar future? If so, when and what sort of actions...
-
Pepper Company has the following info For the ended on December 31. Compute the company's Cost of good sold For the year Total man Facturing Costs Work-In-Process inver 18300 $900 Jan 1st inventory!...
-
Explain why the Auditor General of Canada performs value-for-money audits rather than simply performing financial audits of the various government departments.
-
You are responsible for the statutory audit of Servit Ltd (Servit) for the year ended 30 November 2X10. Servit provides industrial maintenance services to companies operating in the engineering...
-
Evaluate the performance of each of Alternative Tyress salespeople.
-
Your firm is the external auditor of Bestwood Engineering Ltd which manufactures components for motor vehicles and sells them to motor vehicle manufacturers and wholesalers. It has a turnover of...
-
Identify the four concerns that management has in establishing internal controls. Explain how each of those four concerns can be part of operational auditing.
-
Information bias result in miss classification A- rrors in classifiyhng disease status B Error of classifying exposure status C- Error of classifying Disease exposure status D Error That always...
-
Outline a general process applicable to most control situations. Using this, explain how you would develop a system to control home delivery staff at a local pizza shop.
-
Suppose my brother and I both go on a week-long vacation in Cayman and, when we arrive at the airport on the island, we have to choose between either renting a car or taking a taxi to our hotel....
-
Mortgage Interest Deductibility, Land Values and the Equilibrium Rate of Return on Capital: In the text, we suggested that the property tax can be thought of in part as a tax on land and in part as a...
-
In representative democracies where legislators represent geographic districts in legislative bodies (such as the U.S. House of Representatives), we often hear of pork barrel spending. Typically,...
-
6. YOU BE THE JUDGE WRITING PROBLEM World-Wide Coin Investments Ltd. sold rare coins, precious metals, camera equipment, and Coca-Cola collector items. Its stock was registered with the SEC under the...
-
5. CPA QUESTION Pace Corp. previously issued 300,000 shares of its common stock. The shares are now actively traded on a national securities exchange. The original offering was exempt from...
-
7. Suppose that, while waiting in line at the grocery store, you overhear a stranger saying that the FDA is going to approve a new drug tomorrow-one that will be a huge success for Alpha...
Study smarter with the SolutionInn App