Language using with: C
- Datatype resource
- BASIC OF VARIABLE & CONSTANT resource
- OPERATOR resource
- TYPECASTING resource
- LIBRARY-FUNCTION resource
- RELATIONAL AND- LOGICAL OPERATORS resource
- IF-ELSE STATEMENT resource
- TYPE-CASTING resource
- POST & PRE-INCREMENT resource
- TERNARY-OPERATOR resource
- PATTERN PRINTING resource Youtube
- BASIC DATATYPES{*char} class
- SWITCH-CONTINUE- GOTO-DO.WHILE class
- ARRAY class:1D class:2D Youtube
- STRING Youtube class:2D
- FUNCTION resource
- RECURSSION class:1 class:2
Try to solve this problem using with Loop:
219432Y-Easy Fibonacci
219432J-Primes from 1 to n
219432G-Factorial
219432I-Palindrome
219432L-GCD
---------------------------------------------------------------
Try to solve this proble using with Array:
219774D-Positions in array
219774E-Lowest Number
219774F-Reversing
219774H-Sorting
219774L-Max Subarray
219774M-Replace MinMax
219774S-Search In Matrix
219774V-Frequency Array
219774Z-Binary Search
--------------------------------------------------------------------
Try to solve this proble using with String:
219856C-Compare
219856F-Way Too Long Words
219856H-Good or Bad
219856J-Count Letters
219856K-I Love strings
219856L-String Functions
219856O-Sort String
219856R-String Score
--------------------------------------------------------------------
Try to solve this proble using with Function:
223205D-Prime Function
22320E-Swap
22320G-Max and MIN
22320K-Shift Right
---------------------------------------------------------------
Try to solve this proble using with Recurssion:
223339C-Print from N to 1
223339D-Print Digits using Recursion
223339E-Base Converssion
223339J-Factorial
Try to solve this proble using with File,Structure:
FILEHANDLING
Part1: https://drive.google.com/file/d/1CruWbmNeGhlfzkotfXkc7q_9ALrOPhkK/view
Part2: https://drive.google.com/file/d/1ctQXf2IVzYLHxy9eD_ICwR_P--EFaAu-/view
Part3: https://drive.google.com/file/d/1NJ-r6u-hQ_5mdfgOvVPNDmgaPo3EEoOY/view
Suppose, you are a software engineer at Google and responsible for creating a basic version of Google Classroom. There could be information of thousands of courses. Each course may contain several students and only one instructor/teacher. For each course, you have to keep a record of its Course Code, Course Name, Section, Instructor’s Name, Number of Enrolled Students and a list of the IDs of the enrolled students. You have to save the information of all the courses in a file named “classDB.txt”. Here is a sample for the “classDB.txt” file. We will refer to this in question 1, 2.
CSE-1121
Computer Programming 1
B
JAA
4
C213050 C213052 C213055 C213063
MATH-1107
Mathematics 1
C
MRI
3
C213091 C213092 C213099
CSE-2311
Data Structure
A
MSA
5
C211001 C211010 C211015 C211021 C211030
CSE-4875
Pattern Recognition and Fuzzy System
A
JAA
0
CSE-1121
Computer Programming 1
C
JAA
3
C213091 C213092 C213099
Following is an explanation for a particular course information. Consider the first one:
CSE-1121
Computer Programming 1
B
JAA
4
C213050 C213052 C213055 C213063
Here the first string “CSE-1121” represents the Course Code of the course.
The second, third and fourth lines represent the Course Name, Section and
Instructor’s Name of the course respectively.
The fifth line contains an integer representing the number of enrolled students that
this particular course has (in this case 4 students have enrolled for CSE-1121,
Section-B). And next line is a list containing the student IDs of the enrolled
students.
If there are no enrolled students then the fifth line should contain 0 and the nextline will be the beginning of another record [See the record of “CSE-4875”, forexample].
Now build a system where you will be given information of several courses. You have tosave information of all the courses in a file named “classDB.txt”.
1. a) Create a structure called Course which will contain necessary fields to hold theinformation of a particular Course. Use an array of type of this structure to solve theproblems in questions 1-b and 1-c.
b) Show Course Code, Course Name, Section and Number of Enrolled Students of all courses taken by a particular teacher.
Suppose you are given “JAA” as input. Considering the file “classDB.txt”, the following should be the output:
Code: CSE-1121
Name: Computer Programming 1
Section: B
Number of Students: 4
Code: CSE-4875
Name: Pattern Recognition and Fuzzy System
Section: A
Number of Students: 0
Code: CSE-1121
Name: Computer Programming
Section: C
Number of Students: 3
c) Add information of a new course to the “classDB.txt” file. Make a function named
addInfo() to do so. If the “classDB.txt” file doesn’t exist on the machine, create
a new file with this name.
This function should take all the necessary inputs i.e. Course Code, Course Name,
Section, Instructor’s Name from the keyboard. Initially the Number of Enrolled
Students should be 0.
2. a) Suppose you are given the matric ID of a student, a particular Course Code and
Section as input. Now add this student to this particular course i.e. the matric ID
should now appear on the enrolled student ID list of this course and the total
number of enrolled students should increase by 1.
For the following input “C213070 CSE-1121 B”, the first course info in the
“classDB.txt” file should change into:
CSE-1121
Computer Programming 1
B
JAA
5
C213050 C213052 C213055 C213063 C213070
b) Delete information of all the courses that has no students enrolled yet.
Considering the “classDB.txt” file only the information of the course CSE-4875
will be deleted in this case.
**POINTER**
Agenda: 1.Pointer and its basics 2. Benefits of pointer — swap function and using & in scanf function 3. Pointer Arithmetic 4. Arrays are pointers!! (But less powerful.
*pointer with address check:
Explaination: •(int *p) is a pointer, where (&c) is located it. •(*p /*p==p[0] /p[0]) both of them denote is simillar. •[+]symbol denoted backward address; [-]>>frontward. •int pointer allocated -4 byte of memory, char=1 byte,double=8byte.
*Array is one of pointer.
*String is one kind of char Array. So, its deserves a address hold. So that, we write: (“%s”, str) …no necessary write: &str! *We know, str cnt in [0]-index. If we need [1] index to it starting than write this approach: (str+1)=[1-index]. *(&str[1])..hcce atr alternative notation! *Normal array has less power as a pointer! If array we don’t directly exchange one var it for others. But, pointer is it plus point!
**BITWISE OPERATOR**
https://www.tutorialspoint.com/cprogramming/c_bitwise_operators.htm *Binary Operator work with around of two-operand: AND(&)---If both of them Var is 1, than write=’1’ else =’0’ OR(||) ---If both of them Var has One value is 1, than write=’1’ else =’0’ XOR(^) ---If both of them is similar than write=’0’ else =’1’ *Unary operator work with 1 var. Ex: () NOT(~) ---If both of them is similar than write=’0’ else =’1’