Daily Challenge #83

Hello. Today we are going to have an easy daily challenge.
You and several friends are in a party. You are asked to buy items in store. They will pay you back after all.
Each person only want one item in the store, but not everybody wants the same thing.
Mainly two input:

  1. Name of your friends, what they want and how many
  2. Items in the store and the price of them

Output:
Name of them and how much they need to pay you back.

For example:
Input:
“John”; “item 1”; “5”
“Chloe”; “item 3”; “3”

“item 1; 12, item 2; 51, item 3; 38”

Output:
John: 60
Chloe: 114

Good luck!

2 Likes

Forgot to say, all input should be text block.

1 Like

Here is my solution

Blocks

1 Like

Good :+1: but i think u have misunderstood my question. The output should be
(Name): (amount of $)
And it should be a list of various people
For the items, it is not fixed so you have to make an input for items in the store too.

2 Likes

Second attempt :blush:

My Blocks

2 Likes

That’s better! I don’t want to frustrate you, but the input and output should be a string :blush:
I am sure it can be done by adding a very few blocks :+1:
Btw, why didn’t u use any input variable in the procedure, instead u use the global variables? Just a minor thing

2 Likes

Cuz I didn’t add this to the question. My mistakes :sweat_smile:

1 Like

1 day past, here is my solution

My solution

Input
John,apples,8;Peter,orange,13
apples:11.8,orange:9.34

Output
John: 94.4
Peter: 121.42

Since @dora_paz has the closest and is the only one to ans so the solution belongs to dora

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.