5) a. Default Argument Values Examples




An agent asked you to help him solve the hardest case in his life. You have to solve a quiz for what you need to create the first few elements of the Fibonacci set with the two given starting numbers. Write a program to calculate the first few elements of the Fibonacci set with the given starting and store them into a list.If no starting point is given use 0 and 1.

test

1
Output:




You are in the base of the Andorian species and you need to distract them to be able to defeat their army. You need to hack their system and override a function that operates their troops. The function has as input parameters the number of the troops, the possibility of each troop survival (between 0 and 1) and the number of the human soldiers from that battle. Usually an Andorian squad is made of 100 soldiers and the human is made of 50 soldiers. The possibility of an Andorian survival is 0.378. Create an additional input parameter and use that to calculate the survival rate of the Andorians by multiplying the given survival with the number of Andorian soldiers and dividing this number with the number of human troops. Choose wisely the initial number of humans to terrify the enemy with small survival probabilities.

test

1
Output:




You are working for the International Assassin Association and you need to choose your next target from some people. You need to create a program that chooses randomly a target from a given data set with 10 people but be aware, sometimes you need to choose targets whose name starts with a specific character.If no character is given you can choose anybody.

test

1
Output:




You are in the Great War. Provide software that decodes a message. The message can be decoded by shifting the characters between 1 and 15 places. You must rotate the first n characters. If the shifted space is 3 then the letters a, b, c are representing the decoded letters x, y, z. Write a program that decodes a message. If no shift number is provided using 1.

test

1
Output:




You are working on a research base with a large amount of data. You need to calculate tons of operation with the data by your hand.To be able to keep the short deadlines you need a program that applies an operation to a set of data. Note that the operation can be changed daily, so you need to make your program “interactive”. Write a program that applies a function to a data set. If no function is provided sum the set.

test

1
Output: