Posts

Showing posts from March, 2023
Unit 1: ARTIFICIAL INTELLIGENCE What is Artificial intelligence? Artificial intelligence is the ability of a computer (or machine) that is programmed to think, perceive, sense and act so as to accomplish tasks associated with human intelligence (or tasks done by human beings). Some of the applications of AI are self driving cars, robotic arms, Computer vision (like face detector, traffic cameras), expert system, price / stock price / loan prediction to mention but few. python dictionary A dictionary is an unordered and changeable sequence datatype that stores mappings of unique keys to values. Dictionary does not allow duplicates. Dictionaries elements are stored within curly brackets ({}), including key-value pairs separated by commas (,). In a dictionary, you can add, change or remove elements, also you can loop, copy and nest a dictionary. PROGRAM EXAMPLES Lab1 # a python program to display the position number (key) and reward (value) # using dictionary position
 SURVEY OF PROGRAMMING LANGUAGES UNIT 4 SELECTION STATEMENT USING PJC (Pascal, Java, C++) Selection statement or selection construct or selection structures is also called conditional or decision statement. The purpose is to make your program select a result from an option or from a list of options, when a specified condition is met. 4.1        PROGRAMS LAB EXAMPLES 4.1.1    Simple If Statement In simple if statement, only a single condition is evaluated, the if-block is executed, if the condition is true. Syntax: Pascal if condition then     //statements   Java if condition {     //statements }   C++ if condition {     //statements }     4.1.2    Lab 1 – program to test the age of a student, if he eligible to vote Pascal program lab1; var //declare variables     age : integer; begin //display action for the user and accept input   writeln('Enter your age&#