A minivan has two sliding doors. Each door can be opened by either a dashboard switch, its inside handle, or its outside handle. However, the inside handles do not work if a child lock switch is activated. In order for the sliding doors to open the gear shift must be in park, and the master unlock switch must be activated. Your task is to simulate a portion of the control software for the vehicle. The input is a sequence of values for the switches and the gear shift, in the following order. • Dashboard switches for left and right sliding door, child lock, and master unlock (0 for off or 1 for activated) • inside and outside handles on left and right sliding doors (0 or 1) • The gear shift setting (one of P N D 1 2 3 R). A typical input would be 0 0 0 1 0 1 0 0 P. Print ”left door opens” and/or ”right door Opens” as appropriate. If neither door opens, print ”both doors are closed”.
Describe the basic elements of an instruction cycle and the role of interrupts
Create a class named Marks with data members for roll number, name and totalmarks. Create another class inheriting the Marks class, namely Physics which is used to define marks in physics of each student. Display all data using member functions. The number of students in the class is 3.
BOOKS BookID BookName YearOfPublication AuthorID Price Bk1 Databases 2007 A1 1000 Bk2 Programming 2020 A2 500 II. III. Author Author ID Name Gender email phone city A1 A2 ... II. From the tables given above, write the following in form of relational algebra 1. Selects rows from the table Books where Book Name is 'History' and 'price' is 1000 or those books published after 2015 2. show the name of Authors who live in city is ‘Islamabad'. 3. Show the names of the authors who either live in city 'Islamabad' or Gender is 'Male
Write a program which will ask the user to enter the size and elements for 6 different square matrices.
And then tell the user that is these symmetrical matrices or not? (A matrix (M) is said to be
symmetrical if MT = M).
Hints
• Code a function which will ask the user to enter the elements of a 2D array with R rows and C
columns. (Dynamic memory allocation will be useful here).
Class to class conversion can be done in source as well as destination class. write a program to support this.
Write a program that gets a choice from user if choice is ‘R’ program should calculate area of a rectangle and display it, if the choice is ‘T’ then it shall calculate area of circle and display it.
Consider a file “data.txt” which contains several records. Each record contains ID(7chars), 1 space, First name (10 chars),1 space, Second name (8 chars), 1space, marks in physics( 3chars), 1space, marks in chemistry(3 chars), 1space, marks in mathematics(3 chars) and anewline character. Sample file content is as shown below:
71723 Ram Sen 70 72 75
91924 Raghubir Yadav 82 73 80
53425 Ram Chauhan 93 81 86
44917 Ratan Yadav 95 79 91
ii) If the programis run with numeric argument ($./info.sh 44917), it will assume it as ID of student and will output ID, first name, second name and the average score of that student. If ID does not match, the program should display “record not found”.