question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Eli makes lemonade for his friends. He has 8 lemons and 12 cups of water. He needs 1 lemon and 2 cups of water for every 4 cups of lemonade. How much lemonade can he make and how many lemons will he have leftover?
def solve() -> int: lemonade_lemons = 8 * 4 lemonade_water = 12 * 2 lemonade = min(lemonade_lemons, lemonade_water) lemons_used = lemonade // 4 lemons_leftover = 8 - lemons_used result = (lemonade, lemons_leftover) return result
At a restaurant, there were 50 customers. There were 30 plastic plates, 40 glass plates, and 60 porcelain plates. Two-third of the guests used plastic plates, one-fifth of them used glass plates, and half of the porcelain plates were used. How many plates were used in total?
def solve() -> int: plastic_plates = 30 glass_plates = 40 porcelain_plates = 60 total_customers = 50 plastic_plate_users = total_customers * (2/3) glass_plate_users = total_customers * (1/5) porcelain_plate_users = porcelain_plates / 2 total_plates_used = (plastic_plate_users *...
Jack has 36 candy bars and he eats 4 each day. He also gives away 2 candy bars every 3 days. How many candy bars does he have left after 9 days?
def solve() -> int: eaten = 4 * 9 times_given = 9 // 3 given = 2 * times_given remaining = 36 - eaten - given result = remaining return result
Student: In a school library, there are 39 books in total. 22 of these books are science books. What is the percentage of science books in the library?
def solve() -> int: total_books = 39 science_books = 22 percentage = (science_books / total_books) * 100 result = percentage return result
ome possible questions and programs are: A bottle of juice has 6 servings with 80 calories each. Lucy drinks one third of the bottle. How many calories did she drink?
def solve() -> int: total_calories = 6 * 80 fraction = 1 / 3 calories = fraction * total_calories result = calories return result
A hardware store sells drill machines at $25 each and adds a tax of 10%. If a customer buys 2 drill machines, how much does the customer pay for them?
def solve() -> int: quantity = 2 machine_price = 25 tax = 0.1 total_price = (quantity * machine_price) + (quantity * machine_price * tax) result = total_price return result
A store is having a 25% off sale. If a dress is originally priced at $80, what is the sale price?
def solve() -> int: original_price = 80 discount_rate = 0.25 discount_amount = original_price * discount_rate sale_price = original_price - discount_amount result = sale_price return result
A rectangle has a length of 12 meters and a width of 8 meters. What is its area in square meters?
def solve() -> int: length = 12 width = 8 area = length * width result = area return result
If the population of a town increases by 1.5% every year and the current population is 20,000, what will be the population after 12 years?
def solve() -> int: population = 20000 increase = 1.015 for year in range(12): population *= increase result = population return result
An airport has 20 flights scheduled in a day. After 4 flights are delayed, the airport receives news that 6 more flights will be landing by the end of the day. Later on, 5 passengers get off a plane with each carrying 2 pieces of checked luggage. At the baggage claim area, 10 bags are lost and sent to the lost and foun...
def solve() -> int: scheduled_flights = 20 delayed_flights = 4 additional_flights = 6 total_flights = scheduled_flights - delayed_flights + additional_flights passengers_per_flight = 150 total_passengers = total_flights * passengers_per_flight passengers_lost_lu...
If there are 15 blue fish and 11 yellow fish, how many total fish are there?
def solve() -> int: number_blue_fish = 15 number_yellow_fish = 11 total_fish = number_blue_fish + number_yellow_fish result = total_fish return result
andy swims 10 hours over 8 days. She can swim 30 laps per hour. Assuming she swims the same amount every day how many laps does she swim in 5 days?
def solve() -> int: laps_swam_in_8_days = 10 * 30 hours_swam_in_5_days = 5 * 10 laps_swam_in_5_days = hours_swam_in_5_days * 30 result = laps_swam_in_5_days return result
Student: A recipe for brownies calls for 2 cups of flour, 1/4 cup of sugar, and 1/2 cup of chocolate chips. If Jenna wants to make triple the recipe, how many cups of flour does she need?
def solve() -> int: original_flour = 2 original_sugar = 0.25 original_chocolate_chips = 0.5 triple_flour = original_flour * 3 triple_sugar = original_sugar * 3 triple_chocolate_chips = original_chocolate_chips * 3 result = triple_flour + triple_sugar + triple_chocolate_chips return resu...
A teacher has 32 students and wants to split them into groups of 5, 4, and 3. How many students will be left?
def solve() -> int: total_students = 32 group1 = 5 group2 = 4 group3 = 3 students_left = total_students - (group1 + group2 + group3)*(total_students // (group1 + group2 + group3)) result = students_left return result
Possible math questions and codes: Jaden has a collection of comic books and graphic novels; in total he has 32 comic books and 16 graphic novels. One third of the comic books and half of the graphic novels are in mint condition. If the rest are worn out, how many comic books and graphic novels in total are worn out?
def solve() -> int: comic_books = 32 graphic_novels = 16 mint_comic_books = 1/3 mint_graphic_novels = 1/2 worn_out_comic_books = 1 - mint_comic_books worn_out_graphic_novels = 1 - mint_graphic_novels worn_out_comic_books_count = comic_books * worn_out_comic_books worn_out_graphic_novels_...
Emily is currently five years older than her brother Eric. In four years, the sum of their ages will be 25. How old is Emily now?
def solve() -> int: total_age_in_4_years = 25 emily_age_in_4_years = total_age_in_4_years - 4 - 5 eric_age_in_4_years = total_age_in_4_years - 4 - emily_age_in_4_years emily_age = emily_age_in_4_years - 4 result = emily_age return result
Zoe has $50. She spends $10 on food and $20 on a toy. She then earns $15 from doing chores. How much money does Zoe have now?
def solve() -> int: money = 50 money -= 10 money -= 20 money += 15 result = money return result
Tom has 18 shirts. He has 3 pairs of matching shirts and the others don't match. How many shirts don't match?
def solve() -> int: shirts_total = 18 matching_pairs = 3 shirts_dont_match = shirts_total - (matching_pairs * 2) result = shirts_dont_match return result
Jack is trying to grow a vegetable garden. He plants 10 seeds every day for 2 weeks, but 5 of the seeds do not grow. How many healthy seedlings does Jack have after 2 weeks?
def solve() -> int: seeds_planted_per_day = 10 days = 14 seeds_not_grown = 5 seeds_planted = seeds_planted_per_day * days healthy_seedlings = seeds_planted - seeds_not_grown result = healthy_seedlings return result
Student: Tom has $50. He buys a book for $7 and spends half of the remaining money. How much money does he have left?
def solve() -> int: money = 50 money = money - 7 money = money / 2 result = money return result
A pizza has a diameter of 12 inches. What is the area of the pizza?
def solve() -> int: diameter = 12 radius = diameter / 2 area = 3.14 * (radius ** 2) result = area return result
What is the probability of rolling a total of 8 when two dice are thrown?
def solve() -> int: combinations = 0 for i in range(1,7): if (i + 3) == 8: combinations += 1 for i in range(1,7): if (i + 4) == 8: combinations += 1 probability = combinations / (6 ** 2) result = probability return result
Student: A company has 630 employees. If 75% of them work full-time and the rest work part-time, how many employees work part-time?
def solve() -> int: total_employees = 630 full_time_percentage = 0.75 full_time_employees = total_employees * full_time_percentage part_time_employees = total_employees - full_time_employees result = part_time_employees return result
Student: Tom travelled East 15 miles, then turned South and travelled for 20 more miles than the distance he travelled East. If he turned West and travelled twice the distance he had travelled South, calculate the total distance his journey took.
def solve() -> int: distance_east = 15 distance_south = distance_east + 20 distance_west = distance_south * 2 total_distance = distance_east + distance_south + distance_west result = total_distance return result
1. Jack paid for a candy bar with 2 quarters, 6 dimes, and a nickel. He got 18 cents back in change. How many cents did the candy bar cost?
def solve() -> int: total_paid = 25 change = 18 result = total_paid - change return result
A recipe calls for 3/4 cups of sugar. If the recipe needs to be doubled, how many cups of sugar will be needed?
def solve() -> int: original_sugar = 0.75 recipe_multiplier = 2 new_sugar = original_sugar * recipe_multiplier result = new_sugar return result
Ben has 40 books that he wants to donate to a library. The library accepts books that are in good condition and pays $0.5 for each book. Ben finds out that 12 of his books are damaged and cannot be donated. He decides to sell the damaged books to a recycle shop that pays $0.1 for each book. How much money does Ben get ...
def solve() -> int: donate = 40 - 12 donate_money = donate * 0.5 sell_money = 12 * 0.1 total_money = donate_money + sell_money result = total_money return result
Student: Amy has $2000 saved up for her dream trip to Japan. If the trip costs $3500, how much more money does she need to save up?
def solve() -> int: saved = 2000 cost = 3500 difference = cost - saved result = difference return result
Maya writes articles that take her 45 minutes to complete. It takes her 60% more time to fact-check and edit the articles. If she publishes 3 articles every week, how many hours will she spend fact-checking and editing in one month?
def solve() -> int: articles_per_week = 3 minutes_per_article = 45 percentage_increase = 60 total_minutes_per_week = articles_per_week * minutes_per_article additional_minutes_per_week = total_minutes_per_week * percentage_increase / 100 total_minutes_per_month = total_minutes_per_week * 4 ...
A pizza restaurant offers a pepperoni pizza with a diameter of 16 inches for $14. If each topping costs an additional $1.50 and sales tax is 8%, how much would a customer pay for the pizza with mushrooms and peppers as additional toppings?
def solve() -> int: radius = 16 / 2 base_price = 14 addition_cost = 1.5 * 2 price_with_additions = base_price + addition_cost total_cost = price_with_additions * 1.08 result = total_cost return result
Possible new questions and programs: Leo and Maya collected seashells at the beach. They want to make necklaces and need 12 seashells per necklace. Leo collected 36 seashells and Maya collected 24 more than Leo. Together, how many necklaces can they make?
def solve() -> int: leo = 36 maya = leo + 24 per_necklace = 12 total = leo + maya necklaces = total // per_necklace result = necklaces return result
Student: Leslie has $68 and wants to buy a purse at $32. To complete the total cost tax is 5%. How much of the money would be left?
def solve() -> int: leslie_money = 68 purse_price = 32 tax_rate = 0.05 total_cost = purse_price * (1 + tax_rate) money_left = leslie_money - total_cost result = money_left return result
Student: Sarah needs to buy 5 packs of gum for her friends at $0.75 per pack. She also wants to buy a $2.50 candy bar for herself. If she has $5.00, how much change will she get back?
def solve() -> int: gum_packs = 5 gum_price = 0.75 candy_bar_price = 2.50 total_money = 5.00 total_cost = gum_packs * gum_price + candy_bar_price change = total_money - total_cost result = change return result
Student: A store sells grapes for $3.50 per pound. If Jamie wants to buy 2 pounds of grapes and has $10, how much change will she receive?
def solve() -> int: price_per_pound = 3.50 pounds_of_grapes = 2 amount_paid = 10 total_cost = price_per_pound * pounds_of_grapes change = amount_paid - total_cost result = change return result
A recipe calls for 1/3 cup of sugar. If you need to make 4 batches of the recipe, how many cups of sugar will you need in total?
def solve() -> int: amount_per_batch = 1/3 num_batches = 4 total_amount = amount_per_batch * num_batches result = total_amount return result
Student: A grocery store sells apples for $0.50 each and oranges for $0.80 each. If a customer buys 7 apples and 3 oranges, how much do they pay in total?
def solve() -> int: cost_apple = 0.50 cost_orange = 0.80 num_apple = 7 num_orange = 3 total_cost = cost_apple * num_apple + cost_orange * num_orange result = total_cost return result
If Juan can walk at four times the speed that he can crawl, and his friend Maria can run at double the speed that Juan can walk, and Maria always runs at a speed of 12 miles per hour, how many miles can Juan crawl in one hour?
def solve() -> int: juan_walk_speed = 0 juan_crawl_speed = 0 maria_run_speed = 12 juan_walk_speed = 4 * juan_crawl_speed juan_walk_speed = maria_run_speed / 2 juan_crawl_speed = juan_walk_speed / 4 distance_juan_crawl = juan_crawl_speed * 1 result = distance_juan_craw...
A store is having a sale where they are offering 25% off all items. If Marie buys a shirt that originally costs $20, how much will she pay with the discount?
def solve() -> int: original_price = 20 discount_percentage = 25 amount_off = original_price * (discount_percentage / 100) discounted_price = original_price - amount_off result = discounted_price return result
Mr. Brown shared his holiday bonus between his two sons, Jeremy and Alex. Jeremy received $5000, and Alex got $3000 less than Jeremy. How much was the money shared?
def solve() -> int: jeremy = 5000 alex = jeremy - 3000 total = jeremy + alex result = total return result
A rectangle has a length of 57cm and a width of 28cm. Find the area of the rectangle and the length of a diagonal from one of its corners to another.
def solve() -> int: length = 57 width = 28 area = length * width diagonal_length = ((length**2)+(width**2))**0.5 result = round(area, 2), round(diagonal_length, 2) return result
David needs a new pair of shoes and he has some money. He can afford one product with a sale price of 55 dollars and another product with a regular price of 65 dollars and no sale. His cousin's birthday is coming up and he was offered a 15% discount. What is the total amount of money David needs for both products?
def solve() -> int: discount = 0.15 * 65 result = discount + 55 + 65 return result
Student: Justin has 19 candies. He ate 3 candies last week and 6 this week. How many candies does he have now?
def solve() -> int: candies = 19 candies = candies - 3 candies = candies - 6 result = candies return result
Craig has a pizza party at his house. He serves 12 people with 6 pizzas. Each pizza has 8 slices. How many slices will each person get?
def solve() -> int: people = 12 pizzas = 6 slices_per_pizza = 8 total_slices = people * pizzas * slices_per_pizza slices_per_person = total_slices/ people result = slices_per_person return result
Result: 21 Emma has $152 and Sam has $87. If they buy ten books for $11 each, how much money do they have left?
def solve() -> int: Emma_money = 152 Sam_money = 87 book_price = 11 total_books = 10 total_cost = book_price * total_books total_money = Emma_money + Sam_money money_left = total_money - total_cost result = money_left return result
A room is 20 feet long, 16 feet wide, 10 feet high. What is the total cubic area in the room?
def solve() -> int: length=20 width=16 height=10 total_area=length * width * height result = 3200 return result
David earns 60000$ annually as a sales representative. He pays 18% in taxes, 8% for healthcare, and 2000$ for travel expenses. How much does David take home?
def solve() -> int: annual_salary = 60000 taxes = 0.18 * annual_salary healthcare = 0.08 * annual_salary travel_expenses = 2000 take_home_salary = annual_salary - taxes - healthcare - travel_expenses result = take_home_salary return result
A recipe calls for 2 1/2 cups of flour. If each cup equals 8 fluid ounces, how many fluid ounces of flour will be needed for the recipe?
def solve() -> int: cups_of_flour = 2.5 fluid_ounces = cups_of_flour * 8 result = fluid_ounces return result
Mark bought 3 shirts, each costing £10, and a pair of shoes priced at £50. What was his total cost?
def solve() -> int: shirt_price = 10 num_shirts = 3 shoe_price = 50 total_cost = (shirt_price*num_shirts) + shoe_price result = total_cost return result
Student: A triangle has a base of 10 cm and a height of 6 cm. What is its area?
def solve() -> int: base = 10 height = 6 area = 0.5 * base * height result = area return result
Student: If a consultant earns $150 for a 4-hour session and $50 for every additional hour, and he worked 11 hours last week, calculate his total income.
def solve() -> int: base_income = 150 additional_income = 50 hours_worked = 11 total_income = base_income + (hours_worked - 4) * additional_income result = total_income return result
Will and Cindy both have the same amount of money. Will has 5 $20 bills and 10 $1 bills. Cindy only has 10 $5 bills. How much money do they both have?
def solve() -> int: will_twenty_bills = 5 will_one_bills = 10 cindy_five_bills = 10 will_amount = (will_twenty_bills * 20) + (will_one_bills * 1) cindy_amount = cindy_five_bills * 5 result = will_amount + cindy_amount return result
Student: Brooke has 5 movies. Each movie is 2 hours long. She watches two and one half movies in a day. How many minutes does Brooke watch each day?
def solve() -> int: movies = 5 movie_length = 2 movies_watched = 2.5 total_minutes = movies_watched * movie_length * 60 result = total_minutes return result
Nathan's morning jog is 3 miles. If Nathan ran the first mile in 10 minutes, and the next 2 miles in 16 minutes, what was his average speed in (m/s) for the entire jog?
def solve() -> int: first_mile_distance = 1 first_mile_time = 10 next_two_miles_distance = 2 next_two_miles_time = 16 total_distance = first_mile_distance + next_two_miles_distance total_time = first_mile_time + next_two_miles_time average_speed = total_distance / total_time ...
Student: You buy 3 shirts that cost $15 each and a pair of pants that cost $40. If there is a 10% sales tax, what is the total cost?
def solve() -> int: shirt_cost = 3 * 15 pants_cost = 40 total_cost_before_tax = shirt_cost + pants_cost sales_tax = total_cost_before_tax * 0.1 total_cost_after_tax = total_cost_before_tax + sales_tax result = total_cost_after_tax return result
Grace has seven times as many stickers as Henry, and Henry has four times fewer stickers than Isla. If Isla has 56 stickers, how many stickers does Grace have?
def solve() -> int: henry_stickers = 56 / 4 grace_stickers = henry_stickers * 7 result = grace_stickers return result
Cora has 8 plates and 3 bowls. How many dinnerware pieces does she have in total?
def solve() -> int: plates = 8 bowls = 3 total_dinnerware = plates + bowls result = total_dinnerware return result
Student: Jack walked 10 blocks from his house to the mall. He rode the bus 4 blocks to the grocery store. Later, he went back home the same way. How many blocks did Jack travel in all?
def solve() -> int: blocks_to_mall = 10 blocks_to_grocery = 4 total_blocks = blocks_to_mall + blocks_to_grocery + blocks_to_mall result = total_blocks return result
In a forest, there are seven more squirrels than birds. If there are 23 birds, how many squirrels and birds are there in total?
def solve() -> int: squirrels = 23 + 7 birds = 23 total = squirrels + birds result = total return result
A rectangular box has a length of 12 cm, a width of 8 cm, and a height of 6 cm. What is the volume of the box?
def solve() -> int: length = 12 width = 8 height = 6 volume = length*width*height result = volume return result
Student: In a zoo, there are 500 animals. 40% of them are lions, 20% are tigers, 15% are bears, and rest are zebras. How many zebras are in the zoo?
def solve() -> int: lions = 500 * 0.4 tigers = 500 * 0.2 bears = 500 * 0.15 zebras = 500 - lions - tigers - bears result = zebras return result
Sam, Anna, and Ben are playing a game. Sam has 15 points, Anna has 12 points, and Ben has 9 points. Each round, the winner gets 3 points and the loser loses 2 points. After 4 rounds, Sam has 21 points. How many points does each player have?
def solve() -> int: sam = 15 anna = 12 ben = 9 for i in range(4): if sam > anna and sam > ben: sam = sam + 3 if anna < ben: anna = anna - 2 else: ben = ben - 2 elif anna > sam and anna > ben: anna = anna + 3 if sam < ben: ...
Possible math questions and programs: A train has 12 carriages, each with 40 seats. If three-quarters of the seats are occupied, how many passengers are on the train?
def solve() -> int: total_seats = 12 * 40 occupied_seats = total_seats * (3 / 4) result = int(occupied_seats) return result
A train traveling at a constant speed passes a pole in 8 seconds. How long will it take to pass a bridge that is 600 meters long?
def solve() -> int: distance = 600 speed = distance/8 time = distance/speed result = time return result
If Ken has walked 5 km in 4 hours, how far will he walk in 15 hours?
def solve() -> int: distance = 5 distance_15_hours = distance * 15 / 4 result = distance_15_hours return result
Every 15 seconds, a faucet fills a bucket with 2 liters of water, and every 25 seconds, a hole leaks 1 liter of water from the bucket. How much water is in the bucket after 5 minutes?
def solve() -> int: buckets_filled = 300 // 15 liters_leaked = 300 // 25 liters_added = buckets_filled * 2 water_in_bucket = liters_added - liters_leaked result = water_in_bucket return result
Yesterday, Tom picked 70 apples while his sister picked 20 more apples. Today, Tom picked 60 apples while his sister picked 80 apples. How many more apples did Tom's sister pick today than yesterday?
def solve() -> int: tom_yesterday = 70 sister_yesterday = tom_yesterday + 20 tom_today = 60 sister_today = 80 sister_more_today = sister_today - sister_yesterday result = sister_more_today return result
In a bakery, there are cupcakes and donuts. Each cupcake costs $2 and each donut costs $3. There are 30 cupcakes in the bakery. Altogether all baked goods cost $84. How many donuts are in the bakery?
def solve() -> int: cupcake_cost = 2 donut_cost = 3 cupcake_quantity = 30 total_cost = 84 cupcake_total_cost = cupcake_cost * cupcake_quantity donut_total_cost = total_cost - cupcake_total_cost donut_quantity = donut_total_cost / donut_cost result = donut_quantity ...
A company had a revenue of $500,000 last quarter. After expenses, they had a profit of $75,000. What was the profit margin as a percentage?
def solve() -> int: revenue = 500000 profit = 75000 profit_margin = profit / revenue * 100 result = profit_margin return result
Student: Ella earns $8 per hour babysitting. She wants to buy a new dress that costs $60. She also has to pay 10% tax on the dress. How many hours does she need to babysit to afford the dress?
def solve() -> int: hourly_wage = 8 dress_cost = 60 tax_rate = 0.1 total_cost = dress_cost + dress_cost * tax_rate hours_needed = total_cost / hourly_wage result = hours_needed return result
Sam had $800 in his bank account, but he spent one-fourth of it on buying a new phone. He then lent half of the remaining money to his friend, and was left with $150. How much money did Sam lend to his friend?
def solve() -> int: initial_amount = 800 amount_spent = initial_amount / 4 remaining_amount = initial_amount - amount_spent lent_amount = remaining_amount / 2 final_amount = remaining_amount - lent_amount result = lent_amount return result
A company produces 360 toys in a day. 1/5 of them are defective. How many toys are not defective?
def solve() -> int: produced = 360 defective = (1/5) * produced not_defective = produced - defective result = not_defective return result
``` In a game, a die is thrown 5 times. What is the probability that at least 1 six is thrown?
def solve() -> int: total_outcomes = 6**5 no_six = 5**6 at_least_one_six = total_outcomes - no_six prob_at_least_one_six = at_least_one_six/total_outcomes result = round(prob_at_least_one_six, 3) return result
A salesperson earns 5% commission on all sales. If she sells $2000 worth of product, how much commission does she earn?
def solve() -> int: commission = 2000 * 0.05 result = commission return result
If one bag of flour makes 15 pancakes and John wants to make 150 pancakes, how many bags of flour does he need to buy?
def solve() -> int: pancakes_per_bag_of_flour = 15 pancakes_to_make = 150 bags_of_flour_needed = pancakes_to_make // pancakes_per_bag_of_flour result = bags_of_flour_needed return result
Student: A triangle has a base of 12 cm and a height of 9 cm. What is its area?
def solve() -> int: base = 12 height = 9 area = 0.5 * base * height result = area return result
Lisa is a dog walker and she charges $15 for a 30-minute walk. On Monday, she walked 2 dogs. Tuesday, she walked 3 dogs. Wednesday and Thursday she walked 5 dogs each day, and on Friday she walked 1 dog. How much money did Lisa make this week?
def solve() -> int: monday_dogs = 2 tuesday_dogs = 3 wednesday_dogs = 5 thursday_dogs = 5 friday_dogs = 1 rate = 15 total_pay = ((monday_dogs * 2) + (tuesday_dogs * 2) + (wednesday_dogs * 2) + (thursday_dogs * 2) + (friday_dogs * 2)) * rate result = total_pay return result
Katy Perry buys 4 packs of gum that have 12 pieces each and 3 packs of candy that have 20 pieces each. She gives away 6 pieces of gum and 10 pieces of candy to her friends. How many pieces of gum and candy does she have left?
def solve() -> int: total_gum = 4 * 12 total_candy = 3 * 20 gum_left = total_gum - 6 candy_left = total_candy - 10 result = gum_left + candy_left return result
Henry deposits $1,500 in a savings account for 2 years. It earns 9% interest. He then withdraws a fifth of the money to pay for tuition fees. The remaining money earns 7% interest. How much is now in the account?
def solve() -> int: initial_deposit = 1500 interest_earned = initial_deposit * 0.09 * 2 total_amount = initial_deposit + interest_earned tuition_fees = total_amount / 5 remaining_amount = total_amount - tuition_fees interest_earned_remaining = remaining_amount * 0.07 ...
If the cost of 3 chocolate bars is $12, how many chocolate bars can be bought for $48?
def solve() -> int: cost_of_three_bars = 12 cost_of_one_bar = cost_of_three_bars / 3 number_of_bars_for_48_dollars = 48 // cost_of_one_bar result = number_of_bars_for_48_dollars return result
The pizza delivery boy delivered 60 pizzas to a party. The party organizer wants to divide all the pizzas equally to the 12 guests in the party. What is the number of pizzas one guest will get?
def solve() -> int: num_pizzas = 60 num_guests = 12 pizzas_per_guest = num_pizzas / num_guests result = pizzas_per_guest return result
An online bookstore offers free e-book download for a minimum purchase of $10. Maria bought 2 novels for $5.50 each and 1 poetry collection for $6. How much more worth of e-books should she purchase to get the free download?
def solve() -> int: novel_price = 5.50 poetry_price = 6 novel_quantity = 2 poetry_quantity = 1 total_purchase = (novel_price * novel_quantity) + (poetry_price * poetry_quantity) minimum_purchase = 10 ebook_purchase_needed = minimum_purchase - total_purchase result = ebook_purchase_needed...
Emily has 10 apples. She gave away 3 apples to her friend and then received 5 more apples. How many apples does Emily have now?
def solve() -> int: apples = 10 apples = apples - 3 apples = apples + 5 result = apples return result
The price for 4 cubes of beef from the market is $5. How much does Simon need to pay for 80 cubes?
def solve() -> int: price_per_cube = 5 number_of_cubes = 80 cost = price_per_cube * number_of_cubes result = cost return result
Joey is driving on the highway at an average speed of 50 miles per hour. After 20 minutes of driving, he stops for 15 minutes for lunch. If his final destination is 90 miles away from his current location, what time will he arrive?
def solve() -> int: time = 20 speed = 50 distance_covered_so_far = speed * (time/60) remaining_distance = 90 - distance_covered_so_far time_to_cover_remaining_distance = remaining_distance * 60/speed total_time = time + 15 + time_to_cover_remaining_distance arrival_time = (total_time/6...
Possible new questions: Lisa buys 12 apples and 8 oranges at the market. She pays 75 cents for each apple and 50 cents for each orange. She gives the cashier a 20-dollar bill and gets some change back. How much change does she get?
def solve() -> int: price_apple = 0.75 price_orange = 0.5 quantity_apple = 12 quantity_orange = 8 total_cost = price_apple * quantity_apple + price_orange * quantity_orange bill = 20 change = bill - total_cost result = change return result
Some possible questions are: Leah bought a pack of 16 pencils for $6.40. She gave 1/4 of the pencils to her friend Erin and 1/8 of the pencils to her brother Ben. How much did each pencil cost Leah?
def solve() -> int: total_pencils = 16 pencils_to_erin = total_pencils // 4 pencils_to_ben = total_pencils // 8 pencils_left = total_pencils - pencils_to_erin - pencils_to_ben total_cost = 6.4 cost_per_pencil = total_cost / pencils_left result = cost_per_pencil return result
John bought 25 books and each book costs $10. He also bought 15 dictionaries and each dictionary costs $5. How much did John spend in total?
def solve() -> int: total_cost = 0 books_cost = 25 * 10 dictionaries_cost = 15 * 5 total_cost = books_cost + dictionaries_cost result = total_cost return result
A recipe for a batch of cookies calls for 2 cups of sugar for every 3 cups of flour. If you want to make 24 cookies, how much sugar do you need?
def solve() -> int: cookies = 24 sugar_ratio = 2/3 flour = (3/2) * cookies sugar = sugar_ratio * flour result = sugar return result
haun pays $36 for 3 footballs and 4 soccer balls. If he wanted to buy an extra soccer ball, how much would he spend in total?
def solve() -> int: football_price = 36 / (3+4) additional_soccerball = 1 total = football_price * 3 + football_price * (4 + additional_soccerball) result = total return result
Student: David invested $6,000 and earned 7% interest compounded annually. He then invested more until he had twice as much invested. The next year, he got a 9% return on his investment. How much money does he have now?
def solve() -> int: principal = 6000 interest_rate = 0.07 additional_investment = (2 * principal) - principal interest_earned = (principal + additional_investment) * interest_rate result = principal + additional_investment + interest_earned return result
Student: Leo and Mia go to a candy shop. They buy 4 chocolate bars and 3 lollipops. The price of a chocolate bar is $2 more than the price of a lollipop. The total cost of their purchase is $21. What is the price of a lollipop?
def solve() -> int: chocolate_bar_price = 0 lollipop_price = 0 total_cost = 21 lollipop_price = total_cost / (4 + 3) chocolate_bar_price = lollipop_price + 2 result = lollipop_price return result
Emily and Daniel went shopping and had a total of $35. They decided to buy a necklace for $20 and split the cost equally. How much did each of them spend in total?
def solve() -> int: total_money = 35 necklace_cost = 20 remaining_money = total_money - necklace_cost each_spent = remaining_money / 2 result = each_spent + necklace_cost return result
2. A car travels for half the distance at 20 km/h and the other half at 40 km/h. It takes the car 30 minutes to cover a distance of 36 km. What is the total distance between the starting and ending points?
def solve() -> int: distance = 36 time = 30 speed1 = 20 speed2 = 40 result = (time * (speed1 + speed2))/2 result = 144 return result
Ella collects 4 coins every day from her piggy bank. She has collected 120 coins so far. How many days will it take her to collect 200 coins?
def solve() -> int: result = (200 - 120) / 4 return result
Martin orders 4 pizzas and usually finds that one out of every six slices is burnt. If each pizza has 8 slices and he orders 2 more pizzas, how many burnt slices will he have on average?
def solve() -> int: pizzas_ordered = 4 slices_per_pizza = 8 burnt_slices_ratio = 1 / 6 total_slices = pizzas_ordered * slices_per_pizza total_burnt_slices = total_slices * burnt_slices_ratio additional_pizzas = 2 additional_slices = additional_pizzas * slices_per_pizza addition...
Chloe and Alex shared a sum of money in the ratio 7:3. If Alex received $90 (which is the smaller share), what was the total amount they shared?
def solve() -> int: chloe_share = 7 alex_share = 3 alex_amount = 90 total_share = chloe_share + alex_share chloe_amount = (chloe_share / total_share) * (alex_amount + alex_share) total_amount = chloe_amount + alex_amount result = total_amount return result
Sam needs 10 pounds of ground turkey for his recipe. He learns that 1 pound of ground turkey can make 4 burgers. How many burgers can Sam make with his ground turkey? Emma has 36 cupcakes and she gives away one third of them to her friends. Tom has 48 cupcakes and he gives away one fifth of them to his family. How many...
def solve() -> int: needed_turkey = 10 turkey_to_burgers = 4 total_burgers = needed_turkey * turkey_to_burgers emma_cupcakes = 36 emma_gives_away = emma_cupcakes / 3 emma_left = emma_cupcakes - emma_gives_away tom_cupcakes = 48 tom_gives_away = tom_cupcakes / 5 tom_left = t...
Michael is ordering pizza for his party. He orders 6 large pizzas for $15 each and also pays $10 for delivery. How much does Michael pay in total?
def solve() -> int: num_pizzas = 6 pizza_cost = 15 delivery_cost = 10 total_cost = num_pizzas * pizza_cost + delivery_cost result = total_cost return result
Kevin bought a book for $7.50 and a pencil case for $3.75. He paid with a $20 bill and received some change. How much change, in dollars, did Kevin receive?
def solve() -> int: book = 7.50 pencil_case = 3.75 bill = 20 cost = book + pencil_case change = bill - cost result = change return result
Mia has 12 stickers and 8 pencils. She wants to share them equally with her 4 friends. How many stickers and pencils will each friend get?
def solve() -> int: stickers = 12 pencils = 8 friends = 4 stickers_per_friend = stickers // friends pencils_per_friend = pencils // friends items_per_friend = stickers_per_friend + pencils_per_friend result = items_per_friend return result