Free Essay

Essay

In:

Submitted By shreemaa
Words 6793
Pages 28
Minimum Shelf
Problem Description
At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E ……..
All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with these names could be kept in that shelf as in this example: bottom of shelf ---> [AAAJKRDFDEWAAYFYYKK]-----Top of shelf.

All these packets are to be loaded on cars.

The cars are lined in order, so that the packet could be loaded on them. The cars are also named [A, B, C, D, E,………….].

Each Car will load the packet with the same alphabet. So, for example, car ‘A’ will load all the packets with name ‘A’.

Each particular car will come at the loading point only once.

The cars will come at the loading point in alphabetical order. So, car ‘B’ will come and take all the packets with name ‘B’ from the shelf, then car ‘C’ will come.

No matter how deep in the shelf any packet ‘B’ is, all of the ‘B’ packets will be displaced before the ‘C’ car arrives.

For that purpose, some additional shelves are provided. The packets which are after the packet B, are kept in those shelves.

Any one of these shelves contains only packets, having the same name. For example, if any particular shelf is used and if a packet with name X is in it, then only the packets having names X will be kept in it. That shelf will look like [XXXXXXX].

If any shelf is used once, then it could be used again only if it is vacant.

Packets from the initial shelf could be unloaded from top only.

Write a program that finds the minimum total number of shelves, including the initial one required for this loading process.
Instruction to work with Open PBT Client: 1. Specify the work directory path in the 'Work directory Path' field. The path should correspond to your solution Work directory. 2. Download the support files by clicking the Get Support Files. 3. You will find the problem directories containing: * problem.h file * problem.c file in your project directory. 4. Code the solution in .c file inside the problem directory 5. All required files will be downloaded to your work directory. Creating additional files is strongly discouraged.
Step 1:
In your Solution File: * Implement your logic in function int shelfCount(char* packet) * char* packet : is the string as packets are kept in the shelf. * You can create more functions if required, but those functions should be in the same file.

Step 2:
Your solution needs to consider the following constraints. 1. In this problem you have to write a program, that finds the minimum total number of shelves, including the initial one, required for this loading process. 2. The packets are named A, B, C, D, E …….. 3. Any numbers of packets with these names could be kept in the shelf, as in this example: [ZZLLAAJKRDFDDUUGGYFYYKK]. 4. All packets are to be loaded on cars. The cars are lined in order, so that the packets could be loaded on them. The cars are also named [A, B, C, D, E,………….]. 5. Each Car will load the packets with the same alphabet. So, for example, car ‘A’ will load all the packets with name ‘A’. 6. Each particular car will come at loading point only once. For example, car A will come only once at the loading point. 7. The cars will come at the loading point in alphabetical order. So, car ‘B’ will come and take all the packets with name ‘B’ from the shelf, then car ‘C’ will come. 8. No matter how deep in the shelf any packet ‘B’ is, all of the packets ‘B’ will be displaced before the ‘C’ car arrives. 9. For that purpose, some additional shelves are provided. The packets that are after the packet B, are kept in those shelves. 10. Any one of these shelves contains only packets, having the same name. For example, if any particular shelf is used and if a packet with name S is in it, then only packets having names S will be kept in it. That shelf will look like [SSSSSSS]. 11. If any shelf is used once, then it could be used again only if it is vacant. 12. The names of the packets in the shelf should be upper case; otherwise return -1
The Prototype of the function is int shelfCount(char* packet)
This function takes following arguments. * packet is the string as packets are kept in the shelf. * This method returns an integer, which is the minimum number of shelves needed.
Constraints
1. Name of the packets in shelf should be in upper case else return -1.
Example 1
Input

bottom of shelf --->DDDDDD<-----Top of shelf
Output

1

Explanation:
One shelf will be needed because Car A, Car B and Car C will come and go only Car D will come and collect the packet with the initial shelf.
Example 2
Input

ZYXZYXZYXZYX
Output

3
Example 3
Input

ZYXZYmmmXZYXZYX
Output

-1
For C solutions Header File | : | minimumshelf.h | Function Name | : | int shelfCount(char* packet) | File Name | : | minimumshelf.c |
For C++ solutions Header File | : | minimumshelf.h | Class Name | : | Shelf | Function Name | : | int shelfCount(char* packet) | File Name | : | minimumshelf.c |
General Instructions * | The file / class names, functions, method signatures, header files are to be used as mentioned in the problem statement. Do not use your own names or change the method signatures and fields. You can add any number of additional methods. | * | For C solutions, change the value of "C_OR_CPP" macro in header file as 1 and for C++ solutions change the value as 2. | * | Incase of iostream.h specify as iostream only. | * | Command line options for the main() function are not supported currently. |
Decode the Code
Problem Description
Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another.
In their new technology, they are sending their messages in a number format. This format represents the way that numbers and characters are padded on mobile’s keypad. One smuggler sends a text message to the second smuggler, using the numbers corresponding to the letters on the keypad. When the receiving smuggler gets the message, he simply opens the “create text message” function in his mobile and types the number string. This way the receiver finally reads the original message.
For Example: -
6999066263304447777077766622337778 -----> message sent by the first smuggler. my name is robert---------> message decoded by the second smuggler.
Where ‘0’ denotes the "space".

Explanation:
By pressing ‘6’ (i.e. key’6’ one time) on the keypad, the mobile shows ‘m’ on display screen in write text message area.
By pressing ‘999’ (i.e. key ‘9’ three times) on the keypad, the mobile shows ‘y’ on display screen in write text message area.
By pressing ‘0’ (i.e. key ’0’ one time) on the keypad, the mobile shows ‘space’ on display screen in write text message area.
By pressing ‘66’ (i.e. key’6’ two times) on the keypad, the mobile shows ‘n’ on display screen in write text message area.
By pressing ‘2’ (i.e. key ’2’ one time) on the keypad, the mobile shows ‘a’ on display screen in write text message area.
By pressing ‘6’ (i.e. key '6'one time) on the keypad, the mobile shows ‘m’ on display screen in write text message area.
By pressing ‘33’ (i.e. key ‘3’ two times) on the keypad, the mobile shows ‘e’ on display screen in write text message area.
By pressing ‘0’ (i.e. key ‘0’ one time) on the keypad, the mobile shows ‘space’ on display screen in write text message area.
By pressing ‘444’ (i.e. key’4’ three times) on the keypad, the mobile shows ‘i’ on display screen in write text message area.
By pressing ‘7777’ (i.e. key ’7’ four times) on the keypad, the mobile shows ‘s’ on display screen in write text message area.
By pressing ‘0’ (i.e. key ‘0’ one time) on the keypad, the mobile shows ‘space’ on display screen in write text message area.
By pressing ‘777’ (i.e. key ’7’ three times) on the keypad, the mobile shows ‘r’ on display screen in write text message area.
By pressing ‘666’ (i.e. key ’6’ three times) on the keypad, the mobile shows ‘o’ on display screen in write text message area.
By pressing ‘22’ (i.e. key ‘2’ two times) on the keypad, the mobile shows ‘b’ on display screen in write text message area.
By pressing ‘33’ (i.e. key ‘3’ two times) on the keypad, the mobile shows ‘e’ on display screen in write text message area.
By pressing ‘777’ (i.e. key ’7’ three times) on the keypad, the mobile shows ‘r’ on display screen in write text message area.
By pressing '8' (i.e. key ’8’ one time) on the keypad, the mobile shows ‘t’ on display screen in write text message area.
But for word monkey
6#666#665533999 this string will be sent by the smuggler one
Here ‘# ‘ denotes that if smuggler watches ‘#’ then it means character previous to # is on the same key to the character after the ‘#’ and smuggler has to wait for 2 seconds and then press the same key.
Explanation:
By pressing ‘6’ i.e. key’6’ one time on the keypad, the mobile shows ‘m’ on display screen.
For '#' wait for 2 seconds, and then press next.
By pressing ‘666’ i.e. key’6’ three times on the keypad, the mobile shows ‘o’ on display screen.
For ‘#’ wait for 2 seconds, and then press next.
By pressing ‘66’ i.e. key’6’ two times on the keypad, the mobile shows ‘n’ on display screen.
By pressing ‘55’ i.e. key’5’ two times on the keypad, the mobile shows ‘k’ on display screen.
By pressing ‘33’ i.e. key’3’ two times on the keypad, the mobile shows ‘e’ on display screen.
By pressing ‘999’ i.e. key’9’ three times on the keypad, the mobile shows ‘y’ on display screen.
*Here lower case doesn’t matter.
*Assuming that the smuggler one will not send any numeral characters in the original message. For example smuggler will not send any message like "I need 1000 bucks" as it contains numerals.

So policemen need your help to track the smugglers. You have to write a program that decodes the sending smuggler’s string (from the number format into plain text).
Instructions to work with Open PBT Client: 1. Specify the work directory path in the 'Work directory Path' field. The path should correspond to your solution Work directory. 2. Download the support files by clicking the Get Dev Files. 3. You will find the problem directories containing: * problem.h file * problem.c file in your project directory. 4. Code the solution in .c file inside the problem directory 5. All required files will be downloaded to your work directory. Creating additional files is strongly discouraged.
Step 1:
In your Solution File: * Implement your logic in function char* decodeCode(char* encodedString) * char* encodedString : is string which is sent by the smuggler1. * You can create more functions if required, but those functions should be in the same file.

Step 2:
In your solution keep in mind the following constraints. 1. In this problem you have to write a program that decodes the string, which is sent by the first smuggler. 2. The function decodeCode() takes the string encodedString as an argument. That string is what the first smuggler sends to the second smuggler. 3. The function decodeCode() returns a string, which is the decoded string in plain text. 4. If encodedString is empty then returns empty string. 5. encodedString should only contain integers, and the special character '#' (if needed). 6. encodedString should not have any alphabetic character (e.x. 'a','b') else return empty string 7. encodedString should not have any special character except '#' else return empty string
The Prototype of the function is char* decodeCode(char* encodedString)
This function takes following argument. * char* encodedString: which represents the string which is send by the smuggler1. * function decodeCode() will return a string which is the decoded string of that string which is send by the smuggler1.
The constraints are: 1. encodedString should only contain integers, and the special character '#' (if needed). 2. encodedString should not contain any alphabetical characters (e.x. 'a', 'b'); otherwise return empty string 3. encodedString should not contain any special characters, except '#'; otherwise return empty string 4. encodedString is empty then returns empty string.
Example 1
Input

char* encodedString = 6999066263304447777077766622337778
Output

my name is robert

Explanation: when you will type the given string in the mobile in create text message area then my name is robert message will be displayed.
Example 2
Input

char* encodedString =777733663084433072#222552433
Output

send the package
Example 3
Input

char* encodedString =777733663T084L43m30@72#222552433
Output

" "

Explanation:
Input string encodedString is having character other than numeric and special character other than # so returning " "(empty string)
For C solutions Header File | : | decodethecode.h | Function Name | : | char* decodeCode(char* encodedString) | File Name | : | decodethecode.c |
For C++ solutions Header File | : | decodethecode.h | Class Name | : | DecodeTheCode | Function Name | : | char* decodeCode(char* encodedString) | File Name | : | decodethecode.c |
General Instructions * | The file / class names, functions, method signatures, header files are to be used as mentioned in the problem statement. Do not use your own names or change the method signatures and fields. You can add any number of additional methods. | * | For C solutions, change the value of "C_OR_CPP" macro in header file as 1 and for C++ solutions change the value as 2. | * | Incase of iostream.h specify as iostream only. | * | Command line options for the main() function are not supported currently. |

Area Under Curve
Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.
The area under a curve between two points can be found by doing a definite integral between the two points.
Instructions to work with Open PBT Client: 1. Specify the work directory path in the 'Work directory Path' field. The path should correspond to your solution Work directory. 2. Download the support files by clicking the Get Support Files. 3. You will find the problem directories containing: * problem.h file * problem.c file in your project directory. 4. Code the solution in.c file inside the problem directory 5. All required files will be downloaded to your work directory. Creating additional files is strongly discouraged.
The Prototype of the Function is : double getAreaUnderCurve (struct Term* equation, int noOfTerms, int limit1,int limit2) * Where equation represents number of Term in a equation with x_pow and coeff of X * Where noOfTerms is the number of terms in the equation * Where limit1 and limit2 are the 2 given points to find the area. * The function getAreaUnderCurve() return the area of type double corrected to 4 decimal places.(eg : 5.2704. )
Example 1
Input :

Term equation = x + 3(x^2); int noOfTerms = 2; int limit1 = 4; int limit2 = 8; where, struct Term* equation => { equation[0].exponent = 1; equation[0].coefficient = 1; equation[1].exponent = 2; equation[1].coefficient = 3; }
Output :

The function getAreaUnderCurve() returns 472.0.
Explanation :

Example 2
Input :

Term[] equation = x; int noOfTerms = 1; int limit1 = 1; int limit2 = 1;
Output :

The function getAreaUnderCurve() returns 0.0
Example 3
Input :

Term equation = x; int noOfTerms = 1; int limit1 = 2; int limit2 = 1;
Output :

The function getAreaUnderCurve() returns 1.5
For C solutions Header File | : | areaundercurve.h | Function Name | : | double getAreaUnderCurve (struct Term* equation, int noOfTerms, int limit1,int limit2) | | File Name | : | areaundercurve.c | |
For C++ solutions Header File | : | areaundercurve.h | Class Name | : | AreaUnderCurve | Function Name | : | double getAreaUnderCurve (struct Term* equation, int noOfTerms, int limit1,int limit2) | FileName | : | areaundercurve.c |
General Instructions * | The file / class names, functions, method signatures, header files are to be used as mentioned in the problem statement. Do not use your own names or change the method signatures and fields. You can add any number of additional methods. | * | For C solutions, change the value of "C_OR_CPP" macro in header file as 1 and for C++ solutions change the value as 2. | * | Incase of iostream.h specify as iostream only. | * | Command line options for the main() function are not supported currently. |

Genetic Diseases
Problem Description
Many human diseases could be controlled by the knowledge of the gene’s structure and pattern. The human gene could be represented by four nucleotides. Each nucleotide is represented by a character - ‘J’, ’S’, ’M’, and ’F’. The string pattern of these nucleotides helps us understand the genes. The functions of the genes are based on these strings.

Some biologists want to discover the medicine for the diseases, which could be controlled with the help of these genes. So they decided to compare the two genes and find the problem, so they could make the cure.

Let’s have two genes JMFMJFM and MFFJM.

One of the methods to get the problem of these two genes is called alignment comparison. In the alignment comparison, spaces are inserted (if necessary) in some positions of the genes. These spaces make them equally long and then we could score these resulting genes according to the scoring matrix (shown below).

For example, one space is inserted into JMFMJFM to result in JMFMJF-M, and three spaces are inserted into MFFJM to result in -MF--FJM. A space is denoted by the sign (-). The two genes are now equal in length. These two strings are aligned: JMFMJF-M -MF--FJM

In this alignment, there are four matches - M in the second position, F in the third, F in the sixth, and M in the eighth. Each pair of aligned characters is assigned a score according to the above scoring matrix.

The score of the alignment above is (-3)+5+5+(-2)+(-3)+5+(-3)+5=9.

Many other alignments are also possible. One is shown below (a different number of spaces is inserted into different positions): JMFMJFM -MFFJ-M

This alignment gives a score of (-3)+5+5+(-2)+5+(-1) +5=14.

So, this one is better than the previous one, and this one is also the optimal. No other alignment could give a higher score.
Then, the similarity of the two genes is 14.

This way the max score will result in the least problems.

SCORE | GRADE | 0 => score | 0 | 0 <= score <= 10 | A | 10 < score <= 20 | B | 20 < score <= 30 | C | 30 < score <= 40 | D | 40 < score <= 50 | E |
On the basis of this grade the biologists could make the cure .
Instructions to work with Open PBT Client: 1. Specify the work directory path in the 'Work directory Path' field. The path should correspond to your solution Work directory. 2. Download the support files by clicking the Get Dev Files. 3. You will find the problem directories containing: * problem.h file * problem.c file in your project directory. 4. Code the solution in .c file inside the problem directory 5. All required files will be downloaded to your work directory. Creating additional files is strongly discouraged.
Step 1:
In your Solution File: * Implement your logic in function char rectifyDiseases(char* pattern1 , char* pattern2) * char* pattern1 : represents the pattern of first gene. * char* pattern2 : represents the pattern of second gene. * You can create more functions if required, but those functions should be in the same file.

Step 2:
Your solution needs to consider the following constraints. 1. In this problem you have to write a program that helps the biologists to get an accurate grade. 2. The human gene could be represented by four nucleotides. Each nucleotide is represented by a character - ‘J’, ’S’, ’M’, and ’F’. 3. The string pattern of these nucleotides helps us understand the genes. 4. The functions of the genes are based on these strings. 5. The cure could be prepared only by comparing the two strings. 6. One of the methods for comparison is called alignment comparison. 7. You have to compare the strings’ characters to the Scoring matrix. 8. String length should not be greater than 10 else return \0. 9. String should be consisting of only given four characters else return \0. 10. Characters being returned by the method should be in capital letters.
The Prototype of the function is char rectifyDiseases(char* pattern1 , char* pattern2) This method takes following arguments. * pattern1 which represents the pattern of first gene. * pattern2 which represents the pattern of second gene. * This method returns a character which is grade.
Constraints
* String length should not be greater than 10 else return \0. * String should be consist of only given four characters else return \0. * Characters being returned by the method should be in capital letters.
Example 1
Input

String pattern1=JMFMJFM
String pattern2=MFFJM
Output

B
Example 2
Input

String pattern1=JMFKMJFM
String pattern2=MFFJBM
Output

\0
Explanation: Input string contains other than ‘J’,’S’,’M’ & ’F’ characters.
Example 3
Input

String pattern1=JMFMFFFFFFFFFFFJFM
String pattern2=MFFJJJJJJJJJJFFFFFMMMMM
Output

\0
Explanation: Length of the input string is greater than 10.
For C solutions Header File | : | geneticdiseases.h | Function Name | : | char rectifyDiseases(char* pattern1 , char* pattern2); | File Name | : | geneticdiseases.c |
For C++ solutions Header File | : | geneticdiseases.h | Class Name | : | GeneticDiseases | Function Name | : | char rectifyDiseases(char* pattern1 , char* pattern2); | File Name | : | geneticdiseases.c |
General Instructions * | The file / class names, functions, method signatures, header files are to be used as mentioned in the problem statement. Do not use your own names or change the method signatures and fields. You can add any number of additional methods. | * | For C solutions, change the value of "C_OR_CPP" macro in header file as 1 and for C++ solutions change the value as 2. | * | Incase of iostream.h specify as iostream only. | * | Command line options for the main() function are not supported currently. |

Padovan String
Problem Description

A Padovan string P(n) for a natural number n is defined as:

P(0) = ‘X’

P(1) = ‘Y’

P(2) = ‘Z’

P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation.
For a string of the characters ‘X’ , ‘Y’ and ‘Z’ only, and given value of n, write a program that counts the number of occurrences of the string in the n-th Padovan string P(n).

An example is given below.

For n = 6 and the string ZY, the program should count the occurrences of ZY in P(6).

P(0) = ‘X’

P(1) = ‘Y’

P(2) = ‘Z’

P(n) = P(n-2) + P(n-3), n>2

P(3) = P(1)+P(0)

P(3) = YX

P(4) = P(2)+P(1)

P(4) = ZY

P(5) = P(3)+P(2)

P(5) = YXZ

P(6) = P(4)+P(3)

P(6) = ZYYX

So, the number of occurrences of the string ZY in P(6) is 1.
Instruction to work with Open PBT Client: 1. Specify the work directory path in the 'Work directory Path' field. The path should correspond to your solution Work directory. 2. Download the support files by clicking the Get Dev Files. 3. You will find the problem directories containing: * problem.h file * problem.c file in your project directory. 4. Code the solution in .c file inside the problem directory 5. All required files will be downloaded to your work directory. Creating additional files is strongly discouraged.
Step 1:
In your Solution File: * Implement your logic in function int stringOccurrences(int n, char* str) * int n :n is an integer represents n(th) for which full main string has to formed, from which occurrence of string str has to be found. * char* str :str is a string represents sub string whose occurrence has to be found in the main string. * You can create more functions if required, but those functions should be in the same file.

Step 2:
In your solution keep in mind the following constraints:. 1. In this problem you have to write a program that counts the number of occurrences of the string in the n-th Padovan string P(n). 2. Padovan formula is P(n) = P(n-2) + P(n-3) where n>2 and n is the integer. 3. In the above Padovan formula + sign means string concatenation. 4. For the Padovan formula value of P(0),P(1) and P(2) is given. You have to use those value only. 5. n should not be greater than 40 otherwise return -1 6. string str should be consist of only X,Y and Z in upper case otherwise return -1
The Prototype of the function is int stringOccurrences(int n, char* str)
This function takes following arguments. * n is the value for which full main string has to formed, from which occurrence of string str has to be found. * str represents sub string whose occurrence has to be found in the main string. * This function returns a number of occurrence of string str in the main string.
The constraints are: 1. n should not be greater than 40 otherwise return -1 2. string str should be consist of only X,Y and Z in upper case otherwise return -1
Example 1
Input

int n = 6 string str = ZY
Output

1
Explanation : This question is explained in problem description.
Example 2
Input

int n = 6
String str = ZYmm
Output

-1
Explanation :
String str is containing character other than X, Z and Y.
Example 3
Input

int n = 8
String str = XZ
Output

1
For C solutions Header File | : | padovanstring.h | Function Name | : | int stringOccurrences(int n, char* str) | File Name | : | padovanstring.c |
For C++ solutions Header File | : | padovanstring.h | Class Name | : | PadovanString | Function Name | : | int stringOccurrences(int n, char* str) | File Name | : | padovanstring.c |
General Instructions * | The file / class names, functions, method signatures, header files are to be used as mentioned in the problem statement. Do not use your own names or change the method signatures and fields. You can add any number of additional methods. | * | For C solutions, change the value of "C_OR_CPP" macro in header file as 1 and for C++ solutions change the value as 2. | * | In case of iostream.h specify as iostream only. | * | Command line options for the main() function are not supported currently. |

Pebble Merchant
Problem Description
There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that and the mistakes result in losses. So, he comes to you, and asks you to make a small intelligent car, which could run along the room’s walls and calculate their length. The car has to come back from where it’s started. This means the starting point is the same as the ending one. When the car gives the length of the room’s walls, you could calculate the surface area of the floor. Knowing the surface area, you could calculate the price for covering the whole floor with pebbles.

3 kilograms of pebbles are needed for covering an area of 1 square meter .
The rate of the pebbles is $5 per kilogram.

For example

The car’s measurements are illustrated, using two arrays.

Array 1 = {L, R, L, R, R, L, R, R, L, R, R, L, R, L, L, R, Z}

Where

L denotes, that the car turned Left.
R denotes, that the car turned Right.
Z denotes, that the finishing point is after the last turn.

The following picture will clear any misunderstandings (on this example Array 1 = {L,R,R,R,Z})

Array 2 = {3, 4, 2, 3, 2, 4, 5, 4, 2, 3, 2, 1, 2, 2, 2, 1, 2}

An element of Array 2 denotes the length (in meters), covered by the car, after taking the corresponding turn.

{3L, 4R, 2L, 3R, 2R, 4L, 5R, 4R, 2L, 3R, 2R, 1L, 2R, 2L, 2L, 1R, 2Z}

In this representation it is clearly visible that the direction from entry turning point is measured, along with the distance to the next turning point.

The last element Z in Array 1 represents that the corresponding length in the Array 2 is the final distance and the car will be at finishing point after covering this length.

The area of the given picture is 63 square meters and the cost for covering it is $945.
Instructions to work with Open PBT Client: 1. Specify the work directory path in the 'Work directory Path' field. The path should correspond to your solution work directory. 2. Download the support files by clicking the Get Dev Files. 3. You will find the problem directories containing: * problem.h file * problem.c file in your project directory. 4. Code the solution in .c file inside the problem directory 5. All required files will be downloaded to your work directory. Creating additional files is strongly discouraged.
Step 1:
In your Solution File: * Implement your logic in the function int * findCost(char direction[],int length[]). * char direction[] : is a character array which represents turning direction of car. * int length[] : is an integer array, which represents the length, traveled by the car, in each direction. * You can create more functions if required, but those functions should be in the same file.

Step 2:
Your solution needs to consider the following constraints. 1. In this problem you have to make a program for the pebble merchant. 2. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that and the mistakes result in losses. 3. So, he comes to you and asks you to make a small intelligent car, which could run along the room’s walls and calculate their length. 4. The car has to come back from where it started. 5. This means the starting point is the same as the ending one. 6. The direction array contains only L, R and Z in UPPER CASE; otherwise return {0,0}
The Prototype of the function is int * findCost(char direction[],int length[]).
This method takes the following arguments: * direction is a character array, which represents the turning directions of the car. * length is an integer array, which represents the length, traveled by the car, in each direction.

* This method returns an integer array having two elements first is the calculated area and second is the estimated cost.
The constraints are: 1. The direction array contains only L, R and Z in UPPER CASE; otherwise return {0,0} 2. The direction array's last element should be Z; otherwise return {0,0} 3. Each element in the length array should be greater than 0; otherwise return {0,0}
Example 1
Input

direction[] = {L,R,R,L,L,R,R,R,R,L,Z} length[]= {2,2,1,1,1,2,5,2,2,3,1}
Output

{18,270}
Explanation : The area of the resultant figure is 18 square meters and the cost for covering it is $270.
Example 2
Input

direction[] = {L,L,R,R,L,R,R,L,R,L,R,R,L,R,L,R,R,L,Z} length[]= {1,1,1,1,2,2,2,2,1,2,1,2,2,1,1,1,1,2,2}
Output

{24,360}
Example 3
Input

direction[] = {L,R,L,R,R,L,R,R,L,R,A,L,Z} length[]= {1,2,2,2,2,2,5,2,1,2,3,2,2}
Output

{0,0}
For C solutions Header File | : | pebblemerchant.h | Function Name | : | int * findCost(char direction[],int length[]) | File Name | : | pebblemerchant.c |
For C++ solutions Header File | : | pebblemerchant.h | Class Name | : | PebbleMerchant | Function Name | : | int * findCost(char direction[],int length[]) | File Name | : | pebblemerchant.c |
General Instructions * | The file / class names, functions, method signatures, header files are to be used as mentioned in the problem statement. Do not use your own names or change the method signatures and fields. You can add any number of additional methods. | * | For C solutions, change the value of "C_OR_CPP" macro in header file as 1 and for C++ solutions change the value as 2. | * | Incase of iostream.h specify as iostream only. | * | Command line options for the main() function are not supported currently. |

Padovan String
Problem Description

A Padovan string P(n) for a natural number n is defined as:

P(0) = ‘X’

P(1) = ‘Y’

P(2) = ‘Z’

P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation.
For a string of the characters ‘X’ , ‘Y’ and ‘Z’ only, and given value of n, write a program that counts the number of occurrences of the string in the n-th Padovan string P(n).

An example is given below.

For n = 6 and the string ZY, the program should count the occurrences of ZY in P(6).

P(0) = ‘X’

P(1) = ‘Y’

P(2) = ‘Z’

P(n) = P(n-2) + P(n-3), n>2

P(3) = P(1)+P(0)

P(3) = YX

P(4) = P(2)+P(1)

P(4) = ZY

P(5) = P(3)+P(2)

P(5) = YXZ

P(6) = P(4)+P(3)

P(6) = ZYYX

So, the number of occurrences of the string ZY in P(6) is 1.
Instruction to work with Open PBT Client: 1. Specify the work directory path in the 'Work directory Path' field. The path should correspond to your solution Work directory. 2. Download the support files by clicking the Get Dev Files. 3. You will find the problem directories containing: * problem.h file * problem.c file in your project directory. 4. Code the solution in .c file inside the problem directory 5. All required files will be downloaded to your work directory. Creating additional files is strongly discouraged.
Step 1:
In your Solution File: * Implement your logic in function int stringOccurrences(int n, char* str) * int n :n is an integer represents n(th) for which full main string has to formed, from which occurrence of string str has to be found. * char* str :str is a string represents sub string whose occurrence has to be found in the main string. * You can create more functions if required, but those functions should be in the same file.

Step 2:
In your solution keep in mind the following constraints:. 1. In this problem you have to write a program that counts the number of occurrences of the string in the n-th Padovan string P(n). 2. Padovan formula is P(n) = P(n-2) + P(n-3) where n>2 and n is the integer. 3. In the above Padovan formula + sign means string concatenation. 4. For the Padovan formula value of P(0),P(1) and P(2) is given. You have to use those value only. 5. n should not be greater than 40 otherwise return -1 6. string str should be consist of only X,Y and Z in upper case otherwise return -1
The Prototype of the function is int stringOccurrences(int n, char* str)
This function takes following arguments. * n is the value for which full main string has to formed, from which occurrence of string str has to be found. * str represents sub string whose occurrence has to be found in the main string. * This function returns a number of occurrence of string str in the main string.
The constraints are: 1. n should not be greater than 40 otherwise return -1 2. string str should be consist of only X,Y and Z in upper case otherwise return -1
Example 1
Input

int n = 6 string str = ZY
Output

1
Explanation : This question is explained in problem description.
Example 2
Input

int n = 6
String str = ZYmm
Output

-1
Explanation :
String str is containing character other than X, Z and Y.
Example 3
Input

int n = 8
String str = XZ
Output

1
For C solutions Header File | : | padovanstring.h | Function Name | : | int stringOccurrences(int n, char* str) | File Name | : | padovanstring.c |
For C++ solutions Header File | : | padovanstring.h | Class Name | : | PadovanString | Function Name | : | int stringOccurrences(int n, char* str) | File Name | : | padovanstring.c |
General Instructions * | The file / class names, functions, method signatures, header files are to be used as mentioned in the problem statement. Do not use your own names or change the method signatures and fields. You can add any number of additional methods. | * | For C solutions, change the value of "C_OR_CPP" macro in header file as 1 and for C++ solutions change the value as 2. | * | In case of iostream.h specify as iostream only. | * | Command line options for the main() function are not supported currently. |

Board Coloring
Problem Description

In this problem you are given a board in which some of the elements are placed as shown in diagram below. Each element represents a color.
Fill the other elements in the board, such that none of the adjacent elements (vertically, horizontally and diagonally) should be of the same color.
Find out the minimum number of colors that should be used to fill the blank spaces in the board, so that the above condition is met.
Color representation is -: 0, 1, 2, 3, 4, 5, 6, 7…………………….
There is sample board:

For Example:
Given Board :

Matrix representation of board is :
[ _ 1 _ _ ]
[ 2 _ _ _ ]
[ _ _ 2 _ ]
[ 2 _ _ _ ] here blank space is represented by '_' .
Minimum colors to fill this board (given in the picture)is 4.
Instruction to work with Open PBT Client: 1. Specify the work directory path in the 'Work directory Path' field. The path should correspond to your solution Work directory. 2. Download the support files by clicking the Get Dev Files. 3. You will find the problem directories containing: * problem.h file * problem.c file in your project directory. 4. Code the solution in.c file inside the problem directory 5. All required files will be downloaded to your work directory. Creating additional files is strongly discouraged.
Step 1:
In your Solution File: * Implement your logic in function int color(char board[4][4]) * char board[4][4]board is 2 dimensional matrix of order M X M where M = 4. * You can create more functions if required, but those functions should be in the same file.

Step 2:
In your solution keep in mind the following constraints. 1. In this problem you have to write a program that finds the minimum number of colors needed to fill a board in which some of the elements are placed in advance. 2. Function color() will take 2 dimension board as a input. 3. Function color() returns the minimum number of colors that could fill the board meeting the given condition. 4. Board is a 2 dimensional of M X M where M = 4 else return 0 5. Fill the other elements in the board, such that none of the adjacent elements (vertically, horizontally and diagonally) should be of the same color.
The Prototype of the function is int color(char board[4][4])
This function takes following arguments. * board is 2 dimensional matrix of order M X M where M = 4. * This function returns minimum no of color by which board can be filled.
The constraints are: 1. Board is a 2 dimensional of M X M where M = 4 else return 0 2. Fill the other elements in the board, such that none of the adjacent elements (vertically, horizontally and diagonally) should be of the same color.
Example 1
Input

{ 2 0 _ 1 }
{ _ 1 _ _ }
{ _ 2 _ 0 }
{ _ _ _ 1 }
Output

5
Explanation:
We need a minimum 5 different colors to complete the board.
Example 2
Input

{ 2 0 _ 1 3}
{ _ 1 _ _ 2}
{ _ 2 _ 0 1}
{ _ _ _ 1 2}
{ _ _ _ _ 0}
Output

0

Explanation:
Size of the board is greater than 4X4.
Example 3
Input

{ _ 0 }
{ 1 _ }
Output

0

Explanation:
Size of the board is less than 4X4.
For C solutions Header File | : | boardcoloring.h | Function Name | : | int color(char board1[4][4]) | File Name | : | boardcoloring.c |
For C++ solutions Header File | : | boardcoloring.h | Class Name | : | BoardColoring | Function Name | : | int color(char board1[4][4]) | File Name | : | boardcoloring.c |
General Instructions * | The file / class names, functions, method signatures, header files are to be used as mentioned in the problem statement. Do not use your own names or change the method signatures and fields. You can add any number of additional methods. | * | For C solutions, change the value of "C_OR_CPP" macro in header file as 1 and for C++ solutions change the value as 2. | * | Incase of iostream.h specify as iostream only. | * | Command line options for the main() function are not supported currently. |

Similar Documents

Premium Essay

Essay

...1 Overview of How to Write an Essay Writing essays is a major element of your education at the university level. Effective writing gives you the ability to express your ideas, theories, arguments, and projects clearly. The skills you acquire at the university level through writing essays will be aimed at practical business applications that you will be able to use in the workplace. The following information provides a succinct overview of the elements you need to know to begin writing an essay. It will help you on your writing journey. Types of Essays Narrative A narrative essay is a story told by a narrator. Generally, a narrative discusses the personal experience of the author (the first person point of view), but it can also be written about things that happen to others (third person point of view). A narrative typically involves characters, a setting, specific and vivid details, and a series of events that can include current incidents, flashbacks, or dialogue. Cause and Effect A cause and effect essay explores why events, actions, or conditions occur (cause) and examines the results of those events, actions, or conditions (effect). For example, a cause could be purchasing a new expensive home. The effect might be fewer family vacations, more time spent on upkeep, or less time with family because of extra work hours to pay for the home. Comparison and Contrast A comparison and contrast essay shows the relationship between two or more elements. The items can be compared...

Words: 6215 - Pages: 25

Premium Essay

Essay

...How to determine custom essay editing company that is legitimate This is the company you will find great editors to provide you with custom essay editing service. Students whose first language is not English may find speaking and writing in English as a difficult task for them. Most of these students are international students who have enrolled in various universities in America and in the UK. The main teaching language is English, American and Standard English respectively. It is essential for students to master well the language of instruction because it is a medium through which they are required to write their assignments and speak in classroom. Competence and fluency in English language will help students to read and understand the teaching material provided to them. It is important therefore for students to ask for support from custom essay editing services which deal with the tips of writing good essays among other academic papers and also to write for them assignment essays. Our writing and editing services is created both for students and professionals. We deal with both the non academic and academic editing and writing services to fulfill your needs. At our custom essay editing, you will find editors who are qualified in linguistics and English language. We are ready to provide you the custom essay editing service at any time of the day or night because we operate as a 24/7 service. Our custom essay editing service comprises of creative thinkers, skillful editors...

Words: 574 - Pages: 3

Premium Essay

Essay

...An essay is usually a short piece of writing. It is often written from an author's personal point of view. Essays can be literary criticism, political manifestos, learned arguments, observations of daily life, recollections, and reflections of the author. The definition of an essay is vague, overlapping with those of an article and a short story. Almost all modern essays are written in prose, but works in verse have been dubbed essays (e.g. Alexander Pope's An Essay on Criticism and An Essay on Man). While brevity usually defines an essay, voluminous works like John Locke's An Essay Concerning Human Understanding and Thomas Malthus's An Essay on the Principle of Population provide counterexamples. It is very difficult to define the genre into which essays fall. Aldous Huxley, a leading essayist, gives guidance on the subject: Like the novel, the essay is a literary Abstract This article will examine the reasons why it is important both linguistically and psychologically to build a vocabulary quickly when learning a foreign language. The article asserts that very little can be achieved or learned in a foreign language with a small vocabulary and that by building a sizable vocabulary quite quickly one can soon be able to function adequately. You may also wish to look at http://www.jalt-publications.org/tlt/files/95/feb/meara.html   Introduction   It is obvious that in order to learn a foreign language one needs to learn many many words. But how many? Educated...

Words: 332 - Pages: 2

Premium Essay

Essay

...There are some teachers who are going to require you to write a 250 word essay. Actually, it is a very short essay for that matter but for some students, it may also be a burden to have a word limit in writing. Let us take a look at the scenarios that you need to understand to compose a well developed essay. For some students, it may be limiting to have a word factor quota in writing an article. There are some individuals who can tell more out of a topic and that having 250 words will not suffice to tell everything in their minds. That is why you need to have the skills in budgeting the words that you have to write without sacrificing the ideas that you have to deliver. There are different essay types that you also need to consider so having a word limit cannot simply be an easy task. Still for some students, a 250 word essay may mean too much because there are also some people who do not want to waste their time writing. No matter what the essay structure may be, these types of people are not really eager to translate their thoughts to written form so they think 250 words simply equates to too much work. Anyway, you need to understand that having this kind of limit will eventually benefit the students as they improve their discipline, being responsible and being resourceful individuals. We can offer you to buy essays from us so you do not have to worry about the number of words in writing. Let our writers make your life easier...

Words: 273 - Pages: 2

Free Essay

Essay

...I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real essay I’m sorry this is not a real...

Words: 256 - Pages: 2

Premium Essay

Essay

...This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is my essay. This is...

Words: 401 - Pages: 2

Premium Essay

Essay

...Process and Procedure Essay Samples are Helpful Guides in Writing Saturday, June 20th, 2009 Process and Procedure Essay Samples will Assist You in Understanding this Essay Format First of all let’s find out what essay is called process and procedure essay. It is an essay which sometimes called “how to” essay for it guides in certain activities or gives instructions as how to do some job (procedure) or complete a certain task. When you feel difficulty with this essay type, you can find process and procedure essay samples which can give you useful tips into creating an essay which will be have high rating. Process and procedure essay outlining certain procedures or directions to perform certain activity is an important task if one needs to learn how to compile clear instructions to serve the needs of professionals in different fields. These can be helpful for engineers, teachers, doctors and even housewives when it concerns cook books which are also some kind of instructive writing. Procedure essay writing is a useful skills for managerial personnel as they need to organize people and direct them toward certain activities. Process and procedure essay samples can be found online in abundance. Through these essay examples one can get some notion about procedure writing and take some notes how to complete a good piece of process essay. One may note that procedure can include descriptions, warnings and recommendations to the procedures described. To provide guidelines for...

Words: 539 - Pages: 3

Premium Essay

Essay

...Essay Writer can provide students with the exact answers to their essay assignments through our free essay section as well as our custom essay writing services. All of Essay Writer’s free essays are uploaded to our site by some college and university students in the UK to serve as informative guides and comparative templates to help you finish your own essay writing tasks with greater ease and clarity. These sample essays are readily downloadable and very easily accessible; just simply select a subject area or topic from our list of available subjects. You can then go through our list of available essay titles under that subject. Welcome to Essay Writer’s free essays section! You can now access our very extensive collection of free essays. These essays are all original and previously not made available to anyone, and are excellently written and submitted by some well meaning college students who wish to share their knowledge to help you do better in writing your own essays. Below is the list of the subject areas we cover in our free essays section. Simply select the subject that corresponds to your need. You will then be shown a list of all the essay titles available for that specific subject. Essay Writer regularly updates its free essay database. Keep checking back for additional subjects or topics. You may also bookmark our Free Essays page to make it easier to check back on the availability of our free essays. To bookmark this page, simply click on the bookmark...

Words: 314 - Pages: 2

Premium Essay

Essays

...HOW TO READ ESSAYS YOU MUST ANALYZE 1. Take a pencil in your hand. 2. Read the essay over once, quickly, looking for the main idea, for what the essay is about in general, and for what the author seems to be saying. Don't get bogged down in details. (If you come to an unfamiliar word, circle it but go on reading). 3. Check the meaning of unfamiliar words. If they seem to be key words, i.e., if the author uses them more than once, scribble a brief definition at the bottom of the page or at the end of the essay. 4. Now re-read more slowly and carefully, this time making a conscious attempt to begin to isolate the single most important generalization the author makes: his thesis. Follow his line of thought; try to get some sense of structure. The thesis determines the structure, so the structure, once you begin to sense it, can lead you to the thesis. What is the main point the author is making: Where is it? Remember, examples or "for instances" are not main points. The thesis is the generalization the author is attempting to prove valid. Your job, then is to ask yourself, "What is the author trying to prove"? Another way of identifying the thesis is to ask yourself, "What is the unifying principle of this essay"? or "What idea does everything in this essay talk about"? or "Under what single main statement could all the subdivisions fit"? If the author has stated his thesis fully and clearly and all in one place, your job is easier. The thesis is apt to be stated...

Words: 971 - Pages: 4

Premium Essay

Essay

...to write A Level Sociology Essay Assessment With reference to the present AEB syllabus, there are three main skills being assessed in your essays. 1. Knowledge and Understanding (9 marks) 2. Interpretation and Application (9 marks) 3. Evaluation (9 marks) What Does This Mean? What this means is that for writing an essay is that the content (studies, names of researcher, dates, figures, concepts, although important need to be organised coherently, applied to a variety of social situations and interpreted, and expressed in a critical fashion. You must be aware of the skills being highlighted in the question in order to use the appropriate skills in your essays. You should also practice writing essays regularly and develop a technique which addresses the skills required so that you can actually answer the question set. I hope that this handout should allow you to achieve this. Stage One Many students are too quick into diving into an answer. They have focused on certain key terms and ‘assumed’ what the essay requires from a quick look at the question. Instead, the question should be read a number of times. Task One With the title provided. Analyze the question by underlining the key features in the essay title Double underline the skills being assessed, e.g., describe and explain Identify any terms or concepts contained in the question. These terms will need to be defined, i.e. concepts such as interactionists. Essay questions will also include...

Words: 1452 - Pages: 6

Premium Essay

Essay

...from these events? How have they affected your personality or how you deal with situations now? Remember the focus of the essay is on the contrasting impacts of these events in your life. These events do not have to be major events, they could be minor in nature but their impact on you could be great and long lasting. Undertake the task of pre writing for this topic. Select your two events. Describe them in point form. Consider their diverse impacts on your life. By the end of this class you should have completed your pre writing and make sure you get your sheet signed by me. You have the week to work on your first draft. Those of you who would like to show me the first draft are free to submit it to me online and I shall hand them back to you online. I will tell you whether you are on the right track, however this is optional and you will not be penalized if you do not show me your first draft. You need to give me Draft 1 by Tuesday, Feb 26. This will be an online submission under Assignments on ilearn. I will correct it and give it back to you by Sunday March 3, and then you will work on changing the draft according to my corrections and bring it to class on Tuesday, March 5 when we will have a peer review session. So after our class today you need to upload your first drafts of the essay in a week, by Feb 26 in an area marked out as Essay 1 under Assignments on Ilearn. You need to exchange your second drafts with two of your classmates on Tuesday, March...

Words: 547 - Pages: 3

Premium Essay

Essay

...tutorial x 13 weeks)     Level: Foundation/Matriculation     Lecturers: Ms Fazidah Abdul Jamil., Mdm Goh Wan Chen, Ms Saratha Thevi Ramasamy, Ms Norzaireen Shamsul Kamar Synopsis: This course is designed for students who require the necessary skills for tertiary studies. Some basic grammatical concepts are taught and students are to apply them in their writing. Writing will focus on the development of coherent paragraphs. Reading skills will cover such strategies as scanning, skimming, main ideas, contextual clues and inferences. Learning Outcomes: Upon completion of this subject, student will be able to: 1. write summaries as well as process, comparison-contrast and cause-effect essays 2. apply basic grammatical concepts in writing 3. answer questions based on academic texts 4. give oral presentations Textbook: 1. Daise, D., Norloff, C., and Carne, P., (2011). Q: Skills for Success 4 : Reading and Writing Oxford University Press, UK 2. Paterson, K, and Wedge, R., (2013). Oxford Grammar for EAP. Oxford University Press, UK Recommended References: Cambridge International Dictionary of English (1997), Cambridge University Press, UK Mode of Assessment: [1] Class participation 5% [2] Quiz 1 15% [3] Quiz 2 10% [4] Oral Presentation 10% [5] Mid-Term Examination 20% [6] Final Examination 40% Syllabus – FDENG001 |Week |UNIT |Topics ...

Words: 469 - Pages: 2

Premium Essay

Essay

...Define Your Thesis For essays that are part of an Early Years Care & Education Degree, it is important to clearly define a thesis statement within the first paragraph of the essay. Even if you are given a topic to write, such as the importance of preschool classes in low-income neighborhoods, you need to develop a strong thesis in your own words. Here is an example: "Preschool classes in low-income neighborhoods are a crucial step in helping all children enter elementary school at the same educational level, regardless of the income of the family." Once you have defined a clear thesis, you can proceed to the rest of your essay. However, without a clear thesis, your essay will not hold up. Use Examples The majority of your essay should be a careful and clear argument that supports your thesis statement. Do research and cite as many examples as possible to prove your point. For an essay about the merits of all-day educational opportunities for preschool-aged children, check trustworthy sources such as the National Association for the Education of Young Children and national PTA. Provide each point in a strong and complete paragraph. Each paragraph should have a main statement, supporting information and a conclusion. Tie In Conclusion After you have made your argument, state your conclusion in a clear and concise manner. Whether you have proven that the teacher ratio in a preschool setting should be lower than 4 to 1 or made a case for more national funding for the education...

Words: 281 - Pages: 2

Free Essay

Essay

...Carmen Hollow Mr. Beurskens College English Critique Essay: The Morals of the Prince May 3, 2011 The Grey Area between Good and Evil: A Critique of “The Morals of the Prince” by Niccolo Machiavelli Introduction We’ve all made a promise that we couldn’t keep and we have all felt bad about breaking those promises. Whether it was a promise to our parents, our children or a co-worker, we don’t feel good about it, but sometimes it can’t be helped. Usually if we couldn’t keep a promise it was for a good reason and not a selfish one. To the person that we made the promise to, we may be viewed as uncaring or unreliable, but to ourselves we know that we had to make a decision that could hurt someone but at the same time our decision could help that same person or persons. Making a promise and not being able to keep it for one reason or another, is one of the few topics that Machiavelli writes of in his essay “The Morals of the Prince”. He also tells why he believes a prince should be feared rather than loved, and why a prince should be stingy and not generous. He wants us to know how a “perfect” prince should act and behave so that the prince will be viewed upon as a great prince. Summary Machiavelli writes about how he believes a prince should act and behave to be considered a successful prince, one that is loved and feared, liberal and stingy, one that knows when to keep his word and when to break it. In his essay, Machiavelli writes “a prince who wants to keep his post...

Words: 1138 - Pages: 5

Premium Essay

Essay

...Basic techniques for generating ideas. Brainstorming. Brainstorming consists in writing series of words or sentences just as they flow from our mind, although they have no logical order or connections. Once the words are written down, we have to establish relationships among them. This is the embryo of the future text. Free writing. Free writing is a similar technique to the brainstorming. Consists in writing a text without previous decisions or ideas about how we want to write it. Just choosing a topic and writing about it, and then we can summarise the main ideas. Organisation of information. There are some basic rules for writing a well - structured text. The text should be organised in a clear way; it must not be a twisted or an incomprehensible lot of ideas. We have to try to write according to certain conventions about hoe the text is organised. We have to structure our text in paragraphs. Each paragraph must express one idea. Some rules referring to the paragraphs: A paragraph must be clearly separated from other paragraphs, either by an empty line or by indenting the first line, or both. There must be no blank spaces or half-empty lines inside the paragraph. A paragraph in academic prose does not begin with a dot, a line or a kind of mark, except in special circumstances. Each body paragraph must normally have a topic sentence, and more than one sentence. Types of paragraphs. The introductory paragraph. There must be at least one...

Words: 1285 - Pages: 6