



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
it provides description of the cat that was sat on by fellow students
Typology: Exercises
1 / 5
This page cannot be seen from the preview
Don't miss anything!




DATE: 16 - 10 - 2023 TIME : 1 Hour a) Highlight three applications of application programming in the current world and also in the future use. (3 Marks) a. Smart Grids: i. Smart grids use advanced electronics and software to optimize electricity generation, distribution, and consumption, enhancing efficiency and reliability. b. Electric Vehicles (EVs): i. EVs incorporate complex electrical systems and software to manage power delivery, battery charging, and vehicle control, reducing carbon emissions. c. Home Automation Systems: i. Smart home systems employ electronics and programming to automate and control lighting, HVAC, security, and appliances for energy efficiency and convenience. d. Wearable Electronics: i. Wearable devices, like fitness trackers and smartwatches, integrate sensors and software to monitor health and collect data for user insights. e. Industrial Automation: i. In manufacturing and industrial settings, automation systems leverage electronics, sensors, and software to optimize production processes, ensuring efficiency and quality. Correct explanation earns full marks b) Using a relevant Python code snippet, differentiate between the arithmetic operators in Python: %, / and // ( 3 Marks) i. % (Modulus Operator): The modulus operator % calculates the remainder of a division operation. It returns the remainder when one number is divided by another. ii. / (Division Operator):
The division operator / performs regular division and returns a floating-point result (a decimal number). iii. // (Floor Division Operator): The floor division operator // also performs division but rounds down the result to the nearest whole number (integer division). It discards the decimal part. Each correct explanation earns two marks with a correct code snippet earns two marks. c) Explain the difference between a local variable and a global variable (2 Marks)
Correct code with proper explanation earns full marks h) Using relevant programming languages examples, differentiate between compilers and interpreters. (4 Marks) Compilers and interpreters are both tools used in the field of programming to translate and execute code, but they do so in different ways. Translation Process :
Correct code with proper explanation earns full marks