arefin_hossain's blog

By arefin_hossain, history, 21 month(s) ago, In English

Hello, friends!

Still i am not able to solve in div2 a,b ,, div3 a,b and div4 c,d.

Also, when I solve a problem like 900-1000 rated, I have to also struggle it and too much time need for approaching the problem solution, even don't came the idea.

Now, what can i do now>>?

arefin_hossain

Full text and comments »

  • Vote: I like it
  • +12
  • Vote: I do not like it

By arefin_hossain, history, 3 years ago, In English

Language using with: C

  1. Datatype resource
  2. BASIC OF VARIABLE & CONSTANT resource
  3. OPERATOR resource
  4. TYPECASTING resource
  5. LIBRARY-FUNCTION resource
  6. RELATIONAL AND- LOGICAL OPERATORS resource
  7. IF-ELSE STATEMENT resource
  8. TYPE-CASTING resource
  9. POST & PRE-INCREMENT resource
  10. TERNARY-OPERATOR resource
  11. PATTERN PRINTING resource Youtube
  12. BASIC DATATYPES{*char} class
  13. SWITCH-CONTINUE- GOTO-DO.WHILE class
  14. ARRAY class:1D class:2D Youtube
  15. STRING Youtube class:2D
  16. FUNCTION resource
  17. RECURSSION class:1 class:2
Try to solve this problem using with Loop:

219432Y-Easy Fibonacci

Code

219432J-Primes from 1 to n

Code

219432G-Factorial

Code

219432I-Palindrome

Code

219432L-GCD

Code

---------------------------------------------------------------

Try to solve this proble using with Array:

219774D-Positions in array

Code

219774E-Lowest Number

Code

219774F-Reversing

Code

219774H-Sorting

Code

219774L-Max Subarray

Code

219774M-Replace MinMax

Code

219774S-Search In Matrix

Code

219774V-Frequency Array

Code

219774Z-Binary Search

Code

--------------------------------------------------------------------

Try to solve this proble using with String:

219856C-Compare

Code

219856F-Way Too Long Words

Code

219856H-Good or Bad

Code

219856J-Count Letters

Code

219856K-I Love strings

Code

219856L-String Functions

Code

219856O-Sort String

Code

219856R-String Score

Code

--------------------------------------------------------------------

Try to solve this proble using with Function:

223205D-Prime Function

Code

22320E-Swap

Code

22320G-Max and MIN

Code

22320K-Shift Right

Code

---------------------------------------------------------------

Try to solve this proble using with Recurssion:

223339C-Print from N to 1

Code

223339D-Print Digits using Recursion

Code

223339E-Base Converssion

Code

223339J-Factorial

Code
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: (~a,2022-01-15)
   NOT(~)  ---If both of them is similar than write=’0’ else =’1’

Full text and comments »

  • Vote: I like it
  • -63
  • Vote: I do not like it