Posts

Lexicographic Increasing Order

Lexicographic increasing order refers to arranging elements or objects in ascending order based on their lexicographic order. In lexicographic order, elements are compared character by character, and the order is determined by the alphabetical or numerical value of each character. For example, consider a list of strings: ["apple", "banana", "cherry", "apricot"]. When arranged in lexicographic increasing order, the list would be ["apricot", "apple", "banana", "cherry"]. The comparison starts with the first character of each string, and if the characters are equal, the comparison moves to the next character. In this case, "apricot" comes before "apple" because 'p' comes before 'p' and 'r' comes before 'p'. Similarly, "apple" comes before "banana" because 'a' comes before 'b'. The concept of lexicographic increasing order

Java program to take two string as command line arguments and check that they are equal or not.

Image
  /* Do not use '==' operator for comparing strings in java.  Because '==' checks if both objects point to the same memory address or location  and .equals() compares values in the objects. This program is made using library functions and without using library functions. Here in this program I am using string library functions .equals() and .equalsIgnoreCase() which gives output as boolean values true or false. */ import java.util.*; public class str_cmp_cmd_line {      public static void main(String[] args)      {      System.out.println("First Input String ="+args[0]);       //Commmand line arguments always starts from 0 i.e. args[0]       System.out.println("Second Input String ="+args[1]);      System.out.println("By using string library function of equals()");      System.out.println("Input string1= "+args[0]+" & string2= "+args[1]+" are equal :"+args[0].equals(args[1]));      // Here equals() check

Different Types of Computer Programming Languages

Image
Following are the different types of Computer Programming Languages:   1) Procedural languages :  These are used to execute a sequence of statements that lead to a result. They use multiple variables, heavy loops, and other elements.  Examples: BASIC, C, Fortran, Pascal, etc.  2) Functional languages :  These languages avoid loops in favor of recursive functions. The primary focus is on the return values of functions and side effects are discouraged.  Examples: Lisp, Python, Erlang, Haskell, Clourje, etc.  3) Object-Oriented languages :  These languages view the world as a group of objects that have internal data and external accessing parts of that data and offer services that can be used to solve problems.   Examples: Simula, Java, C++, Ruby, Python, etc.  4) Logic-Based languages :  These languages let programmers make declarative statements and then allow the machine to reason about the consequences of those statements.  Examples: Prolog, XSB, Oz, ALF, Mercury, etc.  5) Script

New Nokia 150 (2020)

Image
Nokia 150  In 2016, HMD Global launched a feature phone  Nokia 150  is now rebooted and relaunched on 12th May 2020. The price of the  Nokia 150  is set at  $29 (i.e. roughly  around R.s. 2200 ). The availability of this feature phone in India is still a mystery.     Nokia 150 Ergonomic Keypad. The battery lasts a week. Classic Snake Xenzia game included External body made of high-quality polycarbonate Nokia 150  Specification :   Design Colors  Cyan, Red, Black Size  132 x 50.5 x 15 mm Weight  90.54 g    Performance Operating system  Series 30+ RAM  4 MB CPU  MTK    Connectivity Cable type  Micro USB (USB 2.0) SIM cards  Dual SIM SIM card type  Mini-SIM    Camera Camera  VGA with flash    Battery Battery  Removable 1020 mAh 4     Storage Internal storage  4 MB 5 Micro SD card slot  Support for up to 32 GB    Display Size and type  2.4” QVGA    Audio 3.5 mm headphone jack FM radio receiver MP3 player     Network and connectivity   Network bands  GSM 900/1800 Bluetoo

Implement the following class hierarchy: Student: id, name, StudentExam (derived from Student): with n subjects (n can be variable) StudentResult (derived from StudentExam): with percentage, grade. Define a parameterized constructor for each class and appropriate functions to accept and display details. Create n objects of the StudentResult class and display the marklist using suitable manipulators.| CPP programs |

Image
  /* Cpp Manipulators used are endl and setw(). These manipulators require inclusion of header file <iomanip> endl : It is used for ending of line in an output. setw(): This manipulator sets the character spacing in an output i.e         for e.g. cout<<"Hello"<<setw(3)<<"World";         here setw(3) will set 3 character spacing between "Hello   World". */ #include<iostream> #include<iomanip> #include<string.h> using namespace std; class student { protected: int rno; char name[20]; public: student(int r,char name1[]) { rno=r; strcpy(name,name1); } void display() { cout<<"\n Student rno="<<rno; cout<<"\n Student name="<<name; } }; class student_exam:public student { protected: int *ptr; int no; public: student_exam(int r,char nm[],int n):student(r,nm) { no=n; ptr=new int[no]; } void acc

Popular posts from this blog

Implement the following class hierarchy: Student: id, name, StudentExam (derived from Student): with n subjects (n can be variable) StudentResult (derived from StudentExam): with percentage, grade. Define a parameterized constructor for each class and appropriate functions to accept and display details. Create n objects of the StudentResult class and display the marklist using suitable manipulators.| CPP programs |

Lexicographic Increasing Order

Different Types of Computer Programming Languages