Write a program to initialize large number of strings?

1 Answer

Answer :

Strings are used as a constant and it helps in creation of the procedure and for the initialization  process.  
- Find the strings and assign it to the variable string. Then create a special string type that will  help in initialization process.  
- A custom procedure is required to initialize the string and use it to show some output and it is  as follows:  
const  
strlen = 250; { our "big" string }  
cstlen = 12; { our constant strings }  
type  
string = packed array [1..strlen] of char;  
cstring = packed array [1..cstlen] of char;  
var s: string;  
procedure inistr(var s: string; c: cstring);  
begin  
for i := 1 to strlen do s[i] := ' '; { clear result }  
for i := 1 to cstlen do s[i] := c[i] { place string }  
end;

Related questions

Description : What is the procedure to perform string operations in Pascal?

Last Answer : Pascal can't handle the string of characters and it is one of the disadvantages of the language. - String of characters uses lots of data elements and characters and there need to be character displacement ... string = 'hello, world'; - The length of the string should be 100-200 characters.

Description : What are the features that make Pascal a good language in modern programming?

Last Answer : Pascal is a very structured language and uses the control structures like if-else, repeat-until statements, etc. - It is having different data structures that are included with the records, arrays, ... and operators to perform on them. It provides a way to process and use the efficient code.

Description : What is generalization? Give an example of generalization

Last Answer : A generalization is an object class, which is a superset of another object class (or classes). Generalization models the is a relationship set since members of the specialization class (or ... is used when two classes are similar, but have some differences. Look at the generalization below

Description : What is Software Development Life Cycle? (SDLC) and draw a diagram for pure waterfall life cycle.

Last Answer : System Development Life Cycle (SDLC) is the overall process of developing information systems through a multi-step process from investigation of initial requirements through analysis, design, implementation and maintenance.

Description : Mention some of the process models appropriate for the software to be engineered?

Last Answer :  Linear sequential or waterfall model  Prototyping model  Rad model  Incremental model  Spiral model  Winwin spiral model  Component based development model

Description : How spiral model works?

Last Answer :  The spiral model is an evolutionary software process model that couples the iterative nature of prototyping with the controlled and systematic aspects of the waterfall lifecycle model.  It also has an emphasis on the use of risk management techniques.

Description : What are case tools?

Last Answer :  Computer Aided Software Engineering - CASE tools assist software engineering managers and practitioners in evey activity associated with the software process.  They automate project management activities ... process and assist the engineers in their analysis, design, coding and test work.

Description : Write a C++ program to declare a class student with members as roll no, name and department. Declare a parameterized constructor with default value for department as ‘CO’ to initialize members of object. Initialize and display data for two students.

Last Answer : write a C plus plus program to declare a class which accept and display student information such as roll number division and percentage use get data and put data with required parameters

Description : Write a C++ program to declare a class addition with data members as x and y. Initialize values of x and y with constructor. Calculate addition and display it using function ‘display’.

Last Answer : #include<iostream.h> #include<conio.h> class addition { int x,y; public: addition(int,int); void display(); }; addition::addition (int x1,int y1) { x=x1; y=y1; } void addition: ... y); } void main() { addition a(3,4); a.display(); getch(); }

Description : Write a program to declare class student having data members name and percentage. Write constructor to initialize these data members. Accept and display this data for one object.

Last Answer : #include<iostream.h> #include<conio.h> #include<string.h> class student { char name[20]; float per; public: student(char n[],float p) { strcpy(name,n); per=p; } ... { student S("Sachin",78.00); clrscr(); S.putdata(); getch(); }

Description : Write a program in C++ to declare a class measure having data members as add 1, add 2, add 3. Initialize the values of two data members using constructor and display their addition using function.

Last Answer : #include<iostream.h> #include<conio.h> class measure { public: int add1,add2,add3; measure(int a,int b) { add1=a; add2=b; } void cal() { add3=add1+add2; } void display() ... ;>a>>b; measure m1(a, b); m1.cal(); m1.display(); getch(); }

Description : Give a method to create, declare and initialize structure also develop a program to demonstrate nested structure.

Last Answer : Declaration of structure:- struct structure_name { data_type member 1; data_type member 2; . . . data_type member n; } structure variable 1, structure variable 2,..., structure variable n ... .collegeid); printf("\n College name=%s",s.c.collegename); getch(); }

Description : Python : Efficient way to initialize a very large array -Web-Development

Last Answer : answer:

Description : Write a C++ program to overload binary operator ‘+’ to concatenate two strings.

Last Answer : #include<iostream.h> #include<conio.h> #include<string.h> class opov  { char str1[10]; public: void getdata() { cout<<"\nEnter a strings"; cin>>str1; } ... ,o2; clrscr(); o1.getdata(); o2.getdata();  o1+o2; getch();  }

Description : Write a program to read two strings and find whether they are equal or not.

Last Answer : #include<stdio.h> #include<conio.h> #include<string.h> void main() { char st1[20],st2[20]; printf( enter string 1 ); scanf( %s ,st1); printf( enter second string ); ... 0) printf( \nboth strings are equal ); else printf( \nstrings are not equal ); }

Description : Write a program to overload ‘+’ operator to concatenate two strings.

Last Answer : #include #include #include class string1 { char str[20]; public: void getdata() { coutstr; } void display() { cout

Description : Write a C++ program to overload = = operator to check equality of two strings.

Last Answer : #include<iostream.h> #include<conio.h> #include<string.h> class string { char str1[20]; public: void get() { cout<<"Enter string:"; cin>>str1; } void operator = =( ... ; string s,s1; s.get(); s1.get(); s==s1; getch(); }

Description : How to initialize all the key's values in a Python dictionary -Web-Development

Last Answer : answer:

Description : Why is it important to initialize the loop control variable for WHILE loops?

Last Answer : Uninitialised variables take on whatever value happens to resideat the memory address to which the variable was allocated at thepoint of instantiation. It is a "garbage value" because we cannotpredict ... loop and ultimately tells us how many characters wereread into the buffer (such that index

Description : Define a class circle having data members pi and radius. Initialize and display values of data members also calculate area of circle and display it.

Last Answer : class abc {  float pi,radius; abc(float p, float r) { pi=p; radius=r; } void area() { float ar=pi*radius*radius; System.out.println("Area="+ar); } void display() { System.out.println("Pi="+pi ... void main(String args[]) { abc a=new abc(3.14f,5.0f); a.display(); a.area(); } }

Description : Message passing is a principle to initialize an action by means of a  A) method B) object C) class D) attributes

Last Answer : Message passing is a principle to initialize an action by means of a method

Description : Micro-program consists of a set of microinstructions which are strings of 0s and 1s. a) True b) False

Last Answer : Answer: a Explanation: The computer understands only binary language. So, the microprogram should have instructions which are in the form of 0s and 1s. Each output line of the micro-program corresponds to one control signal

Description : How can I recover large text strings Excel changed into # symbols?

Last Answer : I think I’d use a simple text program like Notepad to open the files and see if the URLs are stored in the file. If not, you are well and truly screwed would be my guess.

Description : The number of strings of length 4 that are generated by the regular expression (0|∈) 1+2* (3|∈), where | is an alternation character, {+, *} are quantification characters, and ∈ is the null string, is: (A) 08 (B) 10 (C) 11 (D) 12

Last Answer : (D) 12

Description : The number of strings of length 4 that are generated by the regular expression (0+1 +|2+3 + )*, where | is an alternation character and {+, *} are quantification characters, is: (A) 08 (B) 09 (C) 10 (D) 12

Last Answer : (C) 10

Description : Which of the following are not regular? (A) Strings of even number of a's. (B) Strings of a's, whose length is a prime number. (C) Set of all palindromes made up of a's and b's. (D) Strings of a's whose length is a ... ) (A), (B) and (C) only (3) (B), (C) and (D) only (4) (B) and (D) only

Last Answer : (B), (C) and (D) only

Description : Do you strip away the strings on the outside of celery before eating it?

Last Answer : Nope. I trim the ends, right below the line where the leaves start, and most of the white part too. But that’s it, then I fill with almond butter.

Description : Can mp3s be purchased online with "no strings attached"?

Last Answer : You can buy mp3s from amazon without having to use any special app or device.

Description : How to display all permutations of Strings in Java?

Last Answer : Well, how would you go about finding these permutations yourself, if you didn’t have the help of a computer program? Let’s think about this with the example of an easy, short word: test. You might start by fixing the beginning of the word in place, and only swapping the remaining letters… t

Description : Do quantum strings vibrate in one direction?

Last Answer : String theory has been left to the annuls of ‘things that didn’t pan out’ in quantum theory.

Description : Do you tie your shoes, or tuck the strings?

Last Answer : Double knot as strings are usually too long for me.

Description : What strings should I get for my Rickenbackerc360/12c63?

Last Answer : Why not get new Rickenbacker strings?

Description : Guitarists: Can you help me find some really thick acoustic strings?

Last Answer : Martin

Description : What are those winter hats called with two strings coming off of the sides?

Last Answer : It’s just a style of toque. You can see several with the string and pompoms at the link.

Description : To all violinists out there, can you clean your strings?

Last Answer : Yes, you can. Here is how.

Description : Putting flat wound strings on my guitar, how will it sound?

Last Answer : The flatwound strings are a thicker gauge and therefore create more tension. So you will have to have the guitar set up for them. Their sound is not as bright as Gibson brite wires or GHS boomers, etc.

Description : When I knit the first row after I cast on the middle strings long. What do I do so the middle string won't get long when I am knitting the first row?

Last Answer : Sorry for spamming here, I don’t know the answer now, but when I was 8–10 I used to knit for some reason, I had a fascination with it, as well as sewing. I’m sure I would have known the answer then. :)

Description : Whats the difference between thongs and g-strings?

Last Answer : A g-string is a thong, but a thong isn’t necessarily a g-string. A g-string usually has a band around the hips.

Description : Why do I keep breaking guitar strings?

Last Answer : Temperature shifts, per chance?

Description : Why does C++ not allow me to use strings in a class header file?

Last Answer : OK, I think I’ve got this figured out! I already declared “using namespace std;” in my main.cpp file, but in the .h, I did not, so technically I was supposed to be calling std::string. What a stupid mistake!

Description : Outlook rules and short strings?

Last Answer : I gave up on rules; now, I file everything manually. No creative workaround, just a pain in the butt.

Description : What is the best gauge of acoustic guitar strings for a beginner?

Last Answer : Do you have a nylon or steel-stringed guitar? Do you generally play hard with a thick pick or soft with your fingers? The type/gauge of strings depends on your actual type of guitar, playing style, ... seem to be able to do both ends of the spectrum well (light finger picking and heavy strumming).

Description : How to let go of someone who strings you along?

Last Answer : It depends… If you value him more than you value yourself, continue to be strung along. If you value yourself more let him go. As hard as it is to believe, you WILL feel better!

Description : How can I make jewellery out of my old guitar strings?

Last Answer : I’m wondering if you couldn’t use them to make an “illusion” necklace or bracelet. Good idea & good luck!

Description : what is the name for skinny,black 1/2 inch black worms that hang from long strings from apple trees?

Last Answer : Need Answer

Description : What has strings, drums and keys? -Riddles

Last Answer : A piano!

Description : If you like pretty gems that sparkle and shine, I invite you to dig in my virtual mine. My first is purple, fit for a king, My second is green where Dorothy did her thing. My third is red, July's ... gem, one letter in its turn, And you will find the stuff for which even the god's yearn. -Riddles

Last Answer : Ambrosia The gems are: Amethyst Emerald ( Emerald City in the Wizard of Oz ) Ruby Pearl Diamond Tiger's eye Cubic Zirconium (Fake diamond) Black Opal Taking the first letter of Amethyst, second of Emerald, etc.. gives Ambrosia - The food of the gods.

Description : I move without wings, between silken strings, I leave as you find, my substance behind.What am I? -Riddles

Last Answer : A Spider.

Description : Did you know instrument strings were made from animals? -Do You Know?

Last Answer : Gut strings are the only animal-derived product still commonly used in the creation of musical instruments. However, even gut strings—most commonly found on very expensive tennis rackets, guitars, violins, and other stringed instruments—can easily be replaced with synthetics like nylon or steel.

Description : Python: _csv.Error: iterator should return strings -Web-Development

Last Answer : answer: