C# Program to Find All Substrings in a String

Samual Sam
Updated on 19-Jun-2020 10:57:17

2K+ Views

Use the substring() method in C# to find all substrings in a string.Let’s say our string is −XyzLoop through the length of the string and use the Substring function from the beginning to the end of the string −for (int start = 0; start

Count Upper and Lower Case Characters in a Given String in C#

karthikeya Boyini
Updated on 19-Jun-2020 10:52:36

1K+ Views

To count uppercase characters in a string, check the following condition −myStr[i]>='A' && myStr[i]='a' && myStr[i]

C# Program to Find Node in Linked List

Samual Sam
Updated on 19-Jun-2020 10:52:04

590 Views

Firstly, create a new linked list −LinkedList myList = new LinkedList();Now add some elements in the linked list −// Add 6 elements in the linked list myList.AddLast("P"); myList.AddLast("Q"); myList.AddLast("R"); myList.AddLast("S"); myList.AddLast("T"); myList.AddLast("U");Let’s now find a node and add a new node after that −LinkedListNode node = myList.Find("R"); myList.AddAfter(node, "ADDED");ExampleYou can try to run the following code to find a node in the linked list.Live Demousing System; using System.Collections.Generic; class Program {    static void Main() {       LinkedList myList = new LinkedList();       // Add 6 elements in the linked list       myList.AddLast("P");   ... Read More

Data Warehousing and Data Mining

David Meador
Updated on 19-Jun-2020 10:51:23

11K+ Views

Data WarehousingData warehousing is a collection of tools and techniques using which more knowledge can be driven out from a large amount of data. This helps with the decision-making process and improving information resources. Data warehouse is basically a database of unique data structures that allows relatively quick and easy performance of complex queries over a large amount of data. It is created from multiple heterogeneous sources.Characteristics of Data WarehousingIntegratedTime variant Non-volatileThe purpose of Data warehouse is to support the decision making process. It makes information easily accessible as we can generate reports from the data warehouse. It usually contains historical data ... Read More

Object-Based Data Models

Alex Onsman
Updated on 19-Jun-2020 09:52:17

15K+ Views

In object based data models, the focus is on how data is represented. The data is divided into multiple entities each of which have some defining characteristics. Moreover, these data entities are connected with each other through some relationships.So, in object based data models the entities are based on real world models, and how the data is in real life. There is not as much concern over what the data is as compared to how it is visualised and connected.Some examples of object based data models areEntity Relationship Data ModelObject Oriented Data ModelSemantic Data ModelFunctional Data ModelOut of these models, ... Read More

Comparison between E-R Model and Object-Oriented Model

Alex Onsman
Updated on 19-Jun-2020 09:49:05

7K+ Views

The detailed comparison on the E- R model and Object Oriented Model is given as follows −E-R ModelER model is used to represent real life scenarios as entities. The properties of these entities are their attributes in the ER diagram and their connections are shown in the form of relationships. An ER model is generally considered as a top down approach in data designing.An example of ER model is −Advantages of E - R modelThe data requirements are easily understandable using an E - R model as it utilises clear diagrams.The E-R model can be easily converted into a relational database.The ... Read More

Representation of Class Hierarchy in DBMS

Alex Onsman
Updated on 19-Jun-2020 09:42:14

6K+ Views

Class hierarchy can be viewed one of two waysSpecialization (Top Down Approach)Generalization (Bottom Up Approach)SpecializationSpecialization is a process of identifying subsets of an entity that shares different characteristics. It breaks an entity into multiple entities from higher level (super class) to lower level (subclass). The class vehicle can be specialized into Car, Truck and Motorcycle ( Top Down Approach)Hence, vehicle is the superclass and Car, Truck, Motorcycle are subclasses. All three of these inherit attributes from vehicle. Moreover, these three share those attributes among themselves while containing some other attributes which make them different.GeneralizationGeneralization is a process of generalizing an entity which ... Read More

Convert Decimal to Octal Number in C#

Samual Sam
Updated on 19-Jun-2020 09:36:15

772 Views

Set the decimal number −int decVal = 40;Now take a variable and set the decVal in it. Find the remainder with 8 since octal has base-8 number system and evaluate it in a loop like the following code snippet.while (quot != 0) {    octalVal[i++] = quot % 8;    quot = quot / 8; }ExampleYou can try to run the following code to convert decimal to octal number.Live Demousing System; class Demo {    public static void Main() {       int decVal, quot, i = 1, j;       int[] octalVal = new int[80];     ... Read More

Count Vowels and Consonants in a String Using C#

karthikeya Boyini
Updated on 19-Jun-2020 09:35:14

857 Views

You need to check for both the vowels and consonants, but do not forget to check for both the uppercase as well lowercase.For counting vowels, check for “aeiou” characters separately i.e.if (myStr[i] == 'a' || myStr[i] == 'e' || myStr[i] == 'i' || myStr[i] == 'o' || myStr[i] == 'u' || myStr[i] == 'A' || myStr[i] == 'E' || myStr[i] == 'I' || myStr[i] == 'O' || myStr[i] == 'U') {    vowel_count++; }For counting consonants, check for other characters in elseif condition −else if ((myStr[i] >= 'a' && myStr[i] = 'A' && myStr[i]

C# Program to Count the Number of 1's in the Entered Numbers

Samual Sam
Updated on 19-Jun-2020 09:33:57

608 Views

I have added the numbers using an array −int[] num = new int[] {1, 25, 1, 55, 1};Now loop through and find for 1, if 1 is there, 6 then increment the variable that counts the occurrence −foreach(int j in num) {    if (j == 1) {       cal++;    } }ExampleThe following is the code to count the number of 1’s in the entered number.Live Demousing System; public class Demo {    public static void Main() {       int cal = 0;       int[] num = new int[] {1, 25, 1, 55, ... Read More

Advertisements