Create a Mad-Lib:
What are Mad-Libs? You are given a prompt (e.g. Enter a name) and the user themselves must fill this in. There will be multiple prompts given for multiple different objects (e.g. colour, verb) and the user must also input the corresponding values (e.g. if the prompt is ‘Enter a number’ do not put ‘Apple’) After these prompts are given, add them all into one string to output (print).
Essentially, your code should be able to output this. The input is in bold:
Welcome to Mad Libs! What is your name? Julia Enter an adjective (describing word): cool Enter a verb: cook Enter a place: home Enter a food: cake Enter a vehicle: car Julia is a very cool person to be around. They love to cook in home. Their favourite food is cake which they eat in a car.
Note that the underlined words are actually your variables. Your sentence is supposed to not make sense as well! (Note the bad grammar).
1. Convert Minutes into Seconds
Have the user input an integer in minutes, and then convert this into seconds. Make sure the input and output are just the same as the samples.
Sample Input 1
30
Sample Output 1
1800 seconds
Sample Input 2
5
Sample Output 2
300 seconds
2. Birthday Cards
Jane always gets at least twice as many birthday cards as her older sister Cruella. Write a program that tells you how many cards Jane gets as a minimum. Input will be a positive integer representing how many cards Cruella received for her last birthday.
Sample Input 1
7
Sample Output 1
Jane receives at least 14 cards.
Sample Input 2
59
Sample Output 2
Jane receives at least 118 cards.
3. Age to Days
Let the user take their age (in years) and convert this to the equivalent number of days. Note: Use 365 days as the length for a year
Ignore leap years and days between last birthday and now. (So they just turned the age they inputted)
Sample Input 1
Enter your age in years: 65
Sample Output 1
You are 23725 days old.
Sample Input 2
Enter your age in years: 20
Sample Output 2
You are 7300 days old.
3.1 Expand this further by telling the user (i.e. output) how many days it will take for the user to reach 100 years old.
Sample Input 1.1
Enter your age in years: 65
Sample Output 1.1
You are 23725 days old. In 12775 days you will be 100 years old!