Artificial Intelligence and Computer Science Exam Notes
Artificial Intelligence and Computer Science Exam Notes
Introduction to Artificial Intelligence
- Artificial Intelligence (AI) is the simulation of human intelligence processes by machines, especially computer systems.
- It involves learning, reasoning, problem-solving, perception, and language understanding.
- We are all part of the AI revolution, reflecting on its impact on individual and societal levels.
Marks Distribution
- Assessment Breakdown:
- Quiz:
- Marks: 4
- Frequency: 3.5
- Total Marks: 14
- Assignment:
- Marks: 4
- Frequency: 4
- Total Marks: 16
- Mid Term:
- Marks: 1
- Total Marks: 30
- Final:
- Marks: 1
- Total Marks: 40
- Overall Total Marks: 100
Class Rules
- Mobile Phones: Not allowed during class.
- Attendance: Late comers can attend but won't be marked present.
- Food Policies: Eating during class is prohibited.
- Assignments: Late submissions will not be accepted.
- Quizzes/Assignments: Announced in advance; no retakes allowed. Missing will be scored as zero.
- Academic Integrity: Both parties will receive zero for any copied work.
Fundamentals of Programming
Basic Introduction to Computers
- Computers are programmable electronic devices that:
- Accept data
- Perform prescribed operations rapidly
- Display results effectively.
What Does a Computer Do?
- Input: Accepts data and instructions.
- Processing: Executes the instructions.
- Output: Displays the processed results.
- Storage: Saves data temporarily or permanently.
Hardware Components
- Central Processing Unit (CPU): The brain of the computer, which includes:
- Control Unit (CU): Directs data flow.
- Arithmetic Logic Unit (ALU): Performs calculations and logic operations.
- Main Memory (RAM): Temporary storage location for executing programs and data.
Computer Organization
- Six Logical Units:
- Input Unit
- Output Unit
- Memory Unit
- Arithmetic/Logic Unit
- Central Processing Unit
- Secondary Storage Unit
Operating System (OS)
- An OS is software that:
- Communicates with hardware
- Manages resources
- Allows programs to run.
- Services Provided by OS:
- Memory Management
- I/O Operations
- Program Execution
Computer Program
- A computer program is a complete set of instructions for a computer to complete a task.
- Programming: The process of developing these instructions using a programming language.
Programming Languages
Three Types:
- Machine Languages:
- Composed of 0s and 1s (binary).
- Example: 11110100.
- Assembly Languages:
- Uses human-readable symbols (e.g., LOAD, STORE).
- Translated to machine language using assemblers.
- High-Level Languages:
- Closer to human language.
- Examples: C/C++, Java, Python.
Programming Paradigms
- Procedural Programming: Follows a sequence of steps systematically (e.g., C, FORTRAN).
- Structured/Modular Programming: Breaks problems into smaller, manageable modules; easier to test and debug.
- Object-Oriented Programming: Organizes code into objects that contain both data and methods.
Flowcharts
- Used to visually represent algorithms and program logic.
- Symbols in Flowcharts:
- Oval: Start/End
- Parallelogram: Input/Output
- Rectangle: Process
- Diamond: Decision point (if-then-else).
- Flow Line: Direction of flow between steps.
Example Flowcharts
Adding Four Marks:
- Marks: M = E, M, P, C
- Flow: Start ➜ Add = E + M + P + C ➜ Print Add ➜ End
Calculating Average Marks:
- Flow: Start ➜ Avg = (E + M + P + C) / 4 ➜ Decision ➜ Print "Pass" or "Fail" ➜ End
C++ Programming Language
- Developed from C language to support Object-Oriented approach.
- Standard Library provides reusable functions and classes.
- Basic structure of a C++ program includes:
#include <iostream>
using namespace std;
void main() {
cout << "Hello World" << endl;
}
Program Explanation
- Header File:
#include <iostream>- includes I/O functions. - Namespace:
using namespace std;- avoids naming conflicts in code. - Main Function: where program execution begins; can return void or an integer.
- Output Statement:
cout << "Hello World" << endl;– displays output to the console.
Conclusion
- Mastering programming concepts, flowcharts, and languages is essential for a robust understanding of computer science and AI. Familiarize with practical coding skills and theoretical knowledge to excel in exams.