SDD+String+Handling

media type="custom" key="28251263"


 * Questions**

1. General stores have a program which stores each transaction in a string as follows: "G1001830.95" "S24400155.77" "B554353.56" "-9542312.45"

The first character of the string represents the customer loyalty card (G)old, (S)ilver, (B)ronze or a "-" for no loyalty card Characters 2 to 6 represent the customer number, so in the above example the customer number is 10018 The final set of characters represent the amount spent, so in the above example the amount spent is 30.95

(a) Write pseudocode to accept a string as input and display the type of loyalty card the customer has (b) Write pseudocode to accept a string as input and display the customer number

2. A program stores the details of an athletics track race in a string, with 2 characters used to represent the nationality of the runner in each lane as follows: "GBUSUSGBSPFRITCZ"

So lane 1 is Great Britain, lane 2 is USA, lane 3 is USA, lane 4 is Great Britain, 5 is Spain, 6 is France, 7 is Italy and 8 Czech Republic

Write pseudocode to accept a string as input and display the lane or lanes (if any) that has a runner from Great Britain.