题目
题目

I&C SCI 10 LEC A: HOW ... Lecture 7 Pre-work: Editing Only Some Pixels

论述题

Go to: https://web.stanford.edu/class/cs101/image-functions-reference.html Links to an external site. Go to the Code Area and erase what’s there. In the Code Area, paste in the following code: img = new SimpleImage("x.png"); img.setZoom(20); print(img); Now, edit the code to change only the white pixels in x.png to orange, so it looks like this: Paste your code here.

题目图片
查看解析

查看解析

标准答案
Please login to view
思路分析
The task asks to edit the provided code so that only the white pixels in x.png are changed to orange. Starting with the original setup, the code creates an image object from x.png and sets a zoom level, which is fine since these lines are initial boilerplate for displaying the image. The key portion is the loop that iterates over each pixel in the image: for (pixel of img) { ... }. This pattern allows inspecti......Login to view full explanation

登录即可查看完整答案

我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!