Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Tips
- //
- // You are at a restaurant and the waiter brings you the bill. You will have to calculate how much the tip must be. The tips are different in different countries, but here we will use 10%.
- // Input
- // On the first line you will receive the price of the meal you ordered.
- // Output
- //
- // You should print the total sum you have to pay (including the tip: 10%)
- //
- // Constraints
- //
- // The final sum will be always a whole number. You don't have to print anything after the decimal point.
- //
- // Input
- //
- // 10
- //
- // Output
- // sample input
- // each line should consist of single string and a comma right after
- let input = ['20'];
- let print = this.print || console.log;
- let gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
- // Price of the meal you ordered
- let price = Number(gets()); //number
- //total sum you have to pay (including the tip: 10%)
- let bill = price + (price * 0.1);
- //print
- console.log(bill);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement