CLASS VII COMPUTER MODEL TEST PAPER - KEY
SECTION-A (MCQ'S)
1. d) character
2. c) 17
3. d) Timeline Docker
4. a) Onion Skins
5. b) <audio>
6. c) <header>
7. b) Think and learn like humans.
8. c) Spam filters in email
9. c) To make decisions based on conditions.
10. c) PNG
11. b) alt
12. c) Cloud Computing
SECTION-B
13. Integer vs. Float Data Types in Python:
• Integer (int): Represents whole numbers, both positive and negative, without any
decimal point.
Example: age = 12, count = -5
• Float (float): Represents numbers with a decimal point.
Example: price = 99.99, pi = 3.14
14. Keyframes in Krita Animation:
• Keyframes: Are specific frames in an animation timeline that define the start and
end points of a transition or movement. They mark significant changes in the
properties of an animated object (like position, rotation, or scale) at a particular
point in time.
• Usefulness: Keyframes are useful because they allow animators to:
• Control Animation: Precisely define the most important poses or states in an
animation sequence, and the software calculates the frames in between (in-
betweens).
• Efficiency: Avoid drawing every single frame, saving time and effort.
• Flexibility: Easily adjust the timing and pacing of animations by moving or
modifying keyframes.
15. Advantages of Semantic HTML5 Tags:
• Improved Accessibility: Semantic tags like <header>, <nav>, <article>, <footer>
clearly define the different parts of a webpage. This helps screen readers and other
assistive technologies to understand the content structure, making websites more
accessible to users with disabilities.
• Better SEO (Search Engine Optimization): Search engines like Google use semantic
tags to understand the context and relevance of content on a webpage. Using
semantic tags correctly can improve a website's search engine ranking as it helps
search engines to index the content more effectively.
17. The Turing Test:
• Definition: The Turing Test, proposed by Alan Turing, is a test of a machine's ability
to exhibit intelligent behavior equivalent to, or indistinguishable from, that of a
human. In the original test, a human evaluator would have conversations with both
a human and a machine, without knowing which is which. If the evaluator cannot
reliably distinguish between the machine and the human, the machine is said to
have passed the Turing Test.
Significance in AI: It is significant because:
• Benchmark for AI: It serves as a philosophical and practical benchmark for
artificial intelligence. It challenges AI researchers to create machines that cannot
just perform tasks but also think and communicate like humans.
• Drives Research: The test has spurred research in areas like natural language
processing, knowledge representation, reasoning, and machine learning, which are
crucial for developing human-like AI.
• Raise Questions: It raises fundamental questions about what constitutes
"intelligence" and "thinking" in machines.
17. Python Code Snippet for User Input and Greeting:
name = input("Enter your name: ")
print("Hello, " + name + "!")
18. Krita Features for Smooth Animations:
• Onion Skins: This feature displays semi-transparent previews of the frames before
and after the current frame. This helps animators to see the flow of motion and
make smooth transitions between poses.
• Timeline Docker: Krita's Timeline Docker allows precise control over animation
timing and frame manipulation. Features like frame duplication, moving frames,
and adjusting frame durations contribute to creating smoother animation
sequences.
• Frame Interpolation: Krita supports frame interpolation which can automatically
generate in-between frames to create smoother transitions between keyframes,
reducing the need to manually draw every frame.
19. <canvas> Element in HTML5:
• Purpose: The <canvas> element in HTML5 is used to provide a drawing surface on
a webpage via JavaScript. It is essentially a container for graphics that are
rendered dynamically using scripting (usually JavaScript).
• Example of Use: Drawing interactive charts and graphs, creating simple games,
manipulating images, or generating animations directly within a web browser. For
example, you can use JavaScript and the <canvas> element to draw a circle:
<canvas id="myCanvas" width="200" height="100" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
<script>
var c = [Link]("myCanvas");
var ctx = [Link]("2d");
[Link]();
[Link](95,50,40,0,2*[Link]).
[Link]();
</script>
SECTION-C
20. Loops in Python:
Concept of Loops: Loops in Python are used to execute a block of code repeatedly. They
automate repetitive tasks, making code more efficient and concise. Python primarily has
two types of loops: for and while.
• for loop: Iterates over a sequence (like a list, tuple, string, or range) or other iterable
object. It executes the loop body for each item in the sequence.
Example:
# Example of for loop
fruits = ["apple", "banana", "cherry"]
for fruit in fruits:
print(fruit)
Output:
apple
banana
cherry
• while loop: Repeatedly executes a block of code as long as a condition is true. The
loop continues until the condition becomes false.
Example:
Python
# Example of while loop
count = 0
while count < 3:
print("Count is:", count)
count = count + 1
Output:
Count is: 0
Count is: 1
Count is: 2
Difference:
• for loop is used when you know how many times you need to iterate (or when
iterating over a known sequence).
• while loop is used when you need to repeat a block of code until a certain condition
is met, and you may not know in advance how many iterations will be needed.
21. Steps to Create a Simple Walk Cycle Animation in Krita:
• Storyboarding/Planning: Plan the walk cycle. Decide on the number of frames, key
poses (like contact, down, pass, up), and the duration of each step.
• Create a New Animation Project: Open Krita and create a new animation project.
Set the desired frame rate and dimensions.
• Set up Layers: Create layers for different parts of the character (e.g., body, legs,
arms, head). This makes it easier to animate individual parts.
• Draw Key Poses: In the Timeline Docker, draw the key poses of the walk cycle on
different frames. Start with the contact pose, then the down pose, pass pose, and
up pose. Use Onion Skins to help align each pose with the previous one.
• Add In-between Frames: Create new frames between the key poses and draw the
in-between movements to create a smoother transition from one key pose to the
next. Onion skins are very helpful here to ensure fluid motion.
• Refine and Adjust Timing: Play back the animation to check the walk cycle. Adjust
the timing of frames in the Timeline Docker by dragging frames to lengthen or
shorten their duration. Refine the drawings to ensure smooth and consistent
movement.
• Animate Arms and Other Details: Once the leg movement is satisfactory, animate
the arms to swing naturally with the walk. Add other details like head bobbing or
clothing movement to enhance the animation.
• Looping: Ensure the walk cycle loops seamlessly. The last frame should transition
smoothly back to the first frame to create a continuous walk.
• Background (Optional): Add a background layer if needed to give context to the
animation. You can animate the background to create an illusion of movement
across a scene.
22. Embedding a YouTube Video in HTML5:
• Tag: The primary tag used to embed a YouTube video (or other external content) is
the <iframe> tag (Inline Frame).
Code Structure:
<iframe width="560" height="315" src="[Link]
title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-
write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
Attributes:
• src: This is the most important attribute. It specifies the URL of the YouTube video
to be embedded. You need to use the "embed" URL format from YouTube. To get
this, find the "Share" button below a YouTube video, click "Embed," and copy the
URL provided in the src attribute. Replace VIDEO_ID in the example above with the
actual video ID from the YouTube URL.
• width and height: These attributes define the dimensions of the video player on
your webpage in pixels. Adjust these values as needed.
• title: Provides a title for the <iframe>. This is important for accessibility, especially
for screen readers.
• frameborder="0": Removes the border around the iframe. 0 means no border, 1
would mean a border.
• allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope;
picture-in-picture": Specifies what features are allowed in the iframe. These are
common permissions for embedded YouTube videos, enabling features like
autoplay (if desired and permitted by browser settings), clipboard access, encrypted
media, gyroscope, and picture-in-picture mode.
• allowfullscreen: Allows the video to be played in fullscreen mode when the user
clicks the fullscreen button in the player.
23. Benefits and Ethical Concerns of AI in Everyday Life:
Potential Benefits:
• Automation and Efficiency: AI can automate repetitive and time-consuming tasks
in various sectors like manufacturing, customer service, and data analysis,
increasing efficiency and productivity.
• Improved Healthcare: AI can assist in medical diagnosis, drug discovery,
personalized treatment plans, and robotic surgery, potentially leading to more
accurate diagnoses and better patient outcomes.
• Enhanced Convenience and Personalization: AI powers virtual assistants,
personalized recommendations (e.g., in shopping and entertainment), smart home
devices, and more, making daily life more convenient and tailored to individual
needs.
• Safer Transportation: AI is crucial for the development of self-driving cars, which
promise to reduce accidents caused by human error and improve traffic flow.
• Better Accessibility: AI-powered tools like speech recognition and text-to-speech
technologies can improve accessibility for people with disabilities.
Ethical Concerns:
• Job Displacement: Automation driven by AI could lead to significant job losses
across various industries, potentially increasing unemployment and economic
inequality.
• Bias and Fairness: AI algorithms can inherit and amplify biases present in the data
they are trained on, leading to unfair or discriminatory outcomes in areas like
hiring, loan applications, and even criminal justice.
• Privacy and Surveillance: AI systems often rely on vast amounts of data, raising
concerns about privacy violations and mass surveillance, especially with facial
recognition and data collection technologies.
• Lack of Transparency and Accountability: Complex AI models (like deep learning
networks) can be "black boxes," making it difficult to understand how they arrive at
decisions. This lack of transparency can make it challenging to hold AI systems
accountable for errors or biases.
• Potential for Misuse: AI technologies could be misused for malicious purposes,
such as creating autonomous weapons, spreading misinformation, or enhancing
cyberattacks.
• Dependence and Deskilling: Over-reliance on AI systems might lead to a decline in
human skills and critical thinking abilities in certain areas.
SECTION-D
24. Creating an Animated Story in Krita - From Planning to Export:
Planning & Storyboarding:
• Idea Generation: Start with a simple story idea. For example, "A small bird learns
to fly."
• Storyboarding: Create a storyboard, which is a sequence of drawings representing
key scenes or moments in your story. Each panel in the storyboard should depict a
key action or shot, along with brief notes about what's happening in the scene,
camera angles, and character expressions. This visual plan helps to structure your
animation and ensures a coherent narrative flow.
Project Setup in Krita:
• New Animation File: Open Krita and create a new animation document. Choose a
suitable resolution (e.g., 1280x720 for web) and frame rate (e.g., 12 or 24 fps).
• Layer Organization: Organize your project using layers. Common layers include:
• Background Layer: For static backgrounds.
• Character Layers: Separate layers for different characters or parts of a character
(e.g., bird body, wings, eyes).
• Foreground Layers: For elements in front of characters.
• Organize layers logically in the Layer Docker for easy management.
Animation Techniques:
• Frame-by-Frame Animation: For detailed and expressive movements. Draw each
frame individually, making slight changes to character positions and poses to
create motion. Use Onion Skins to guide your drawings and ensure smooth
transitions. For the bird learning to fly, you'd draw each flap of the wings frame by
frame.
• Keyframe Animation (for simpler movements): For simpler movements or changes
over time. Set keyframes at the start and end of a movement, and Krita can
interpolate the frames in between. Useful for background movement or simple
character shifts.
• Transform Masks/Animation Masks: For non-destructive animation of properties
like position, rotation, scale. Can be applied to layers or groups to animate
elements without directly altering the drawn pixels.
Creating Animation:
• Background Art: Create your background art on the background layer. Keep it
relatively simple so it doesn't distract from the main animation.
• Character Animation: Animate your main character(s) frame by frame or using
keyframes, depending on the desired style and complexity. Focus on key actions
from your storyboard. Use Krita's animation tools like the Timeline Docker, Onion
Skins, and animation playback to refine your animation.
• Timing and Spacing: Pay attention to the timing and spacing of your animation.
Adjust frame durations in the Timeline to control the speed of actions. Use ease-in
and ease-out for more natural movement.
• Adding Sound (Optional in Krita, can be added in video editing software later):
• Krita has basic audio support. You can import sound files and synchronize them
with your animation in the Timeline. For more complex sound design, you might
prefer to add sound in video editing software after exporting the animation.
Exporting for Web Viewing:
• Choose Export Format: For web viewing, common formats are:
• GIF: For short, looping animations with limited colors. Good for simple animations
and memes. Export from Krita using "Render Animation" and choose GIF.
• MP4 (using video encoding): For longer animations with better quality and sound.
Export as a sequence of PNG or JPEG images from Krita ("Render Animation" ->
Image Sequence) and then use video editing software (like OpenShot, DaVinci
Resolve, or online converters) to encode them into an MP4 video. Or, if Krita's video
export is configured, you could directly export to MP4.
• Animated PNG (APNG): For animations that need transparency and better quality
than GIF. Export from Krita as PNG image sequence and use APNG assembler tools
to create an APNG file.
Optimize for Web:
• File Size: Keep file sizes as small as possible for fast loading on web pages.
Optimize images, reduce frame count if possible, and choose efficient export
settings.
• Resolution: Use web-friendly resolutions (like 720p or 1080p if needed, but lower
resolutions can be better for simple animations).
• Testing: Test your exported animation in a web browser to ensure it plays correctly
and looks as intended.
SECTION-E
25. Case Study: Python Program Debugging
(a) Identify the error in the given Python code. (1 Mark)
Error: The error is in the if number > 10: line. You cannot directly compare a string
(which is the data type of number after using input()) with an integer (10) using the
greater than > operator in this way in Python.
(b) Explain why this error occurs. (1.5 Marks)
Explanation: The input() function in Python always returns the user's input as a
string, regardless of whether the user enters numbers or text. In the given code,
even if the user enters a number, it is stored as a string in the number variable.
Python cannot directly compare a string to an integer numerically. It will either
raise a TypeError in some Python versions or perform lexicographical (dictionary)
comparison in others, which is not the intended numerical comparison.
(c) Rewrite the corrected code (1.5 Marks)
number_str = input("Enter a number: ")
number = int(number_str) # Convert the input string to an integer
if number > 10:
print("The number is greater than 10")
else:
print("The number is not greater than 10")
Explanation of Correction:
number_str = input("Enter a number: "): The input is first taken as a string and
stored in number_str.
number = int(number_str): The int() function is used to convert the input string
(number_str) into an integer. Now, number variable holds an integer value, which
can be correctly compared with the integer 10.
26. Case Study: Building a Simple HTML5 Page
(a) Basic HTML5 code structure (1 Mark)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Hobby</title>
</head>
<body>
</body>
</html>
(b) HTML code for title, heading, and paragraph (1.5 Marks)
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Hobby</title>
</head>
<body>
<h1>Photography</h1>
<p>I enjoy taking photos of nature and landscapes.</p>
</body>
</html>
(c) HTML tag for image and essential attributes (1.5 Marks)
Tag: The <img> tag is used to insert an image into an HTML webpage. It is a self-
closing tag.
Essential Attributes:
src (source): This attribute is mandatory. It specifies the path or URL to the image
file. For example: src="images/[Link]" (if the image is in an "images"
folder) or src="[Link] (for an image from a
web URL).
alt (alternative text): This attribute is also highly essential, mainly for accessibility
and SEO. It provides alternative text for the image, which is displayed if the image
cannot be loaded (e.g., due to a broken link, slow connection, or if the user is using
a screen reader). It should describe the image content. For example:
alt="Landscape photograph of mountains at sunset".
Example of using <img> tag:
<img src="images/[Link]" alt="Landscape photograph of nature"
width="300" height="200">
Note: width and height attributes are optional but often used to set the dimensions
of the image on the webpage.