question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A store is having a 15% off sale. Eric wants to buy a pair of shoes for $40. If he buys the shoes during the sale, how much will he save?
def solve() -> int: original_price = 40 discount_percent = 0.15 discount_amount = original_price * discount_percent amount_saved = discount_amount result = amount_saved return result
A group of 25 students took a math test. If the average score of the class was 85%, what was the total score of the class?
def solve() -> int: num_students = 25 average_score = 0.85 total_score = num_students * 100 * average_score result = total_score return result
A basket had 12 lemons and some oranges. A kid took the same number of lemons and oranges from the basket. There are only 3 lemons and 2 oranges left in the basket. How many fruits were in the basket initially?
def solve() -> int: lemons_initial = 12 oranges_initial = lemons_initial + 3 + 2 fruits_initial = lemons_initial + oranges_initial result = fruits_initial return result
Clara collects stickers and wants to exchange them with her friends. She has 20 flower stickers, 15 animal stickers, and 10 star stickers. She can exchange 4 flower stickers for 3 animal stickers, or 6 animal stickers for 5 star stickers. How many star stickers can she get if she exchanges all her flower and animal sti...
def solve() -> int: animal_by_flower = 20 * (3 / 4) animal_total = animal_by_flower + 15 star_by_animal = animal_total * (5 / 6) result = star_by_animal + 10 return result
8 years ago, Michael turned 22. In 10 years, Rachel will be twice Michael's age. How old is Rachel now?
def solve() -> int: michael_age_8_years_ago = 22 michael_age_now = michael_age_8_years_ago + 8 rachel_age_in_10_years = 2 * michael_age_now - 10 rachel_age_now = rachel_age_in_10_years - 10 result = rachel_age_now return result
Student: A class has 24 students and the teacher wants to divide them equally into 4 groups. How many students will be in each group?
def solve() -> int: num_students = 24 num_groups = 4 num_students_per_group = num_students // num_groups result = num_students_per_group return result
A store is having a sale with a 40% discount on all items. If a dress normally costs $80, what will be the sale price?
def solve() -> int: original_price = 80 discount_percentage = 40 discount_amount = original_price * discount_percentage / 100 sale_price = original_price - discount_amount result = sale_price return result
If you have a cube with a side length of 5 inches, what is the volume of the cube?
def solve() -> int: side_length = 5 volume = side_length**3 result = volume return result
A chef has 30 eggs to prepare for three different recipes. The first recipe requires 6 eggs, the second recipe requires 8 eggs, and the third recipe requires 10 eggs. How many eggs will the chef have left for future dishes?
def solve() -> int: eggs_total = 30 eggs_recipe1 = 6 eggs_recipe2 = 8 eggs_recipe3 = 10 eggs_used = eggs_recipe1 + eggs_recipe2 + eggs_recipe3 eggs_left = eggs_total - eggs_used result = eggs_left return result
John is paid $900 per week. If he works 45 hours a week, what is his hourly wage?
def solve() -> int: weekly_pay = 900 hours_per_week = 45 hourly_wage = weekly_pay / hours_per_week result = hourly_wage return result
Mark is shipping a package of 10 kg and needs to make sure it is over 11kg in order for the package to be shipped using express mail. How much extra weight does Mark need to add to the package?
def solve() -> int: weight_of_package = 10 target_weight = 11 extra_weight_needed = target_weight - weight_of_package result = extra_weight_needed return result
Kaitlyn can paint 5 walls per hour. If she works for 3 hours and 45 minutes, how many walls can she paint?
def solve() -> int: time_in_hours = 3.75 walls_per_hour = 5 total_walls = time_in_hours * walls_per_hour result = total_walls return result
Jake got 3 pizzas delivered to his house every day for $10 each. At the end of two months, he sold them for $700. How much did he lose?
def solve() -> int: pizzas_per_day = 3 price_per_pizza = 10 days_in_two_months = 2 * 30 total_cost = pizzas_per_day * price_per_pizza * days_in_two_months total_revenue = 700 loss = total_cost - total_revenue result = loss return result
Sophie can run at a speed of 6 miles per hour on a track and 7 miles per hour on a trail. Over the past year, she ran a total of 200 miles, with 40% of the distance on a track and 60% on a trail. Her longest run was 30 miles and the shortest was 5 miles. How much time did she spend running?
def solve() -> int: distance_track = 0.4 * 200 distance_trail = 0.6 * 200 time_track = distance_track / 6 time_trail = distance_trail / 7 total_time = time_track + time_trail result = total_time return result
Student: A shopkeeper marks up the price of a product by 20%. If the original price was $100, what is the new price?
def solve() -> int: original_price = 100 markup_percentage = 20 markup_amount = original_price * (markup_percentage/100) new_price = original_price + markup_amount result = new_price return result
A jar contains 100 marbles, some are blue and some are green. If the ratio of blue marbles to green marbles is 2:3, how many green marbles does it contain?
def solve() -> int: total_marbles = 100 ratio_blue_to_green = 2/3 num_green_marbles = total_marbles * (ratio_blue_to_green / (1 + ratio_blue_to_green)) result = num_green_marbles return result
Joe decides to buy a new TV for his living room. His old TV was 30 inches in size, but this new one is 43 inches in size. How much bigger is the new TV than the old one in square inches?
def solve() -> int: old_TV = 30 new_TV = 43 difference_in_inches = new_TV - old_TV result = difference_in_inches return result
Rachael purchased 250 books and wanted to distribute them equally between her four cousins. However, 30% of the books were damaged, and she had to keep them aside. How many books did each cousin receive?
def solve() -> int: books_purchased = 250 books_damaged = books_purchased * 0.30 books_available = books_purchased - books_damaged cousins = 4 books_per_cousin = books_available / cousins result = books_per_cousin return result
A construction site is building a rectangular swimming pool that measures 10 meters by 5 meters. If the pool is 2 meters deep, what is the total volume of water that the pool can hold?
def solve() -> int: pool_length = 10 pool_width = 5 pool_depth = 2 total_volume = pool_length * pool_width * pool_depth result = total_volume return result
Jake wants to buy a new laptop. The laptop costs $800 and he will pay 12 monthly payments with an interest rate of 5% per year compounding monthly. What is his monthly payment?
def solve() -> int: total_cost = 800 annual_interest_rate = 0.05 monthly_interest_rate = annual_interest_rate / 12 num_months = 12 monthly_payment = total_cost * ((monthly_interest_rate * (1 + monthly_interest_rate)**num_months) / ((1 + monthly_interest_rate)**num_months - 1)) result = monthly_p...
I went to the candy store and saw chocolate bars for $1, gummy bears for $0.5, and lollipops for $0.2 on the rack. If I bought 10 chocolate bars, 20 gummy bears, and 30 lollipops to treat myself, what's the total amount of money I spent in the candy store?
def solve() -> int: chocolate = 1 gummy = 0.5 lollipop = 0.2 chocolate_bought = 10 gummy_bought = 20 lollipop_bought = 30 chocolate_cost = chocolate * chocolate_bought gummy_cost = gummy * gummy_bought lollipop_cost = lollipop * lollipop_bought total_cost = chocola...
A grocery store sells apples and bananas. The number of apples sold is thrice the number of bananas sold. If 30 bananas are sold, how many apples are sold?
def solve() -> int: bananas_sold = 30 apples_sold = 3 * bananas_sold result = apples_sold return result
Student: John sells handmade soap and candles at a local market. He sold 6 soaps and 9 candles for a total of $66. If each soap costs $5, how much does each candle cost?
def solve() -> int: soaps = 6 candles = 9 total = 66 soap_price = 5 soaps_price = soaps * soap_price candles_price = total - soaps_price candle_price = candles_price / candles result = candle_price return result
If the wages of 10 workers for 8 days is $4000. What would be the wages for 15 workers for 12 days?
def solve() -> int: workers_1 = 10 days_1 = 8 wages_1 = 4000 workers_2 = 15 days_2 = 12 wages_2 = (wages_1/workers_1)*workers_2*(days_2/days_1) result = wages_2 return result
If Ethan has 5 markers and Sophia has 8 times as many markers as Ethan, but 6 fewer markers than Emma, how many markers do they have altogether?
def solve() -> int: ethan_markers = 5 sophia_markers = 8 * ethan_markers emma_markers = sophia_markers + 6 total_markers = ethan_markers + sophia_markers + emma_markers result = total_markers return result
Jack made muffins for his coworkers. He ate 2 of them and gave his boss 1 muffin. His first coworker then took 3 muffins, the second coworker took 4 muffins and the third coworker took 2 muffins. If there are 9 muffins left, how many did Jack make?
def solve() -> int: jack_muffins = 2 boss_muffins = 1 first_coworker_muffins = 3 second_coworker_muffins = 4 third_coworker_muffins = 2 total_muffins = jack_muffins + boss_muffins + first_coworker_muffins + second_coworker_muffins + third_coworker_muffins + 9 result = total_muffins...
John bought 10 kg of celeries and 3 kg of tomatoes. The celeries were two times more expensive than the tomatoes. How much did John spend for 1 kg of tomatoes?
def solve() -> int: price_celery = 10 * 2 price_tomato = 3 price_1kg_tomato = price_celery/3 result = price_1kg_tomato return result
A restaurant has 32 tables. Each table can sit 4 people. Currently, there are 102 people in the restaurant. How many more tables does the restaurant need to accommodate all the customers?
def solve() -> int: tables_available = 32 max_customers = tables_available * 4 total_customers = 102 tables_needed = (total_customers - max_customers) // 4 + 1 result = tables_needed return result
A teacher has 24 students in her class. If each student raises $10 for a charity event, and the school receives 25% of the total, how much money is raised altogether?
def solve() -> int: num_students = 24 donation_per_student = 10 total_donation = num_students * donation_per_student school_share = 0.25 * total_donation total_money_raised = total_donation + school_share result = total_money_raised return result
A garden has a rectangular shape. It measures 20 meters in length and 10 meters in width. The owner wants to increase the length by 50% while keeping the width constant. What is the new area of the garden?
def solve() -> int: length = 20 width = 10 new_length = length*1.5 area = length*width new_area = new_length*width result = new_area return result
Emma is 24 years old and her cousin is 12. In how many years will Emma be twice her cousin's age?
def solve() -> int: emma_age = 24 cousin_age = 12 years = 0 while emma_age!= 2 * cousin_age: emma_age += 1 cousin_age += 1 years += 1 result = years return result
Maya and Ryan are making cookies for a bake sale. Maya makes 3 batches of chocolate chip cookies, each batch has 24 cookies. Ryan makes 2 batches of oatmeal raisin cookies, each batch has 18 cookies. They sell each cookie for 50 cents. How much money do they make in total?
def solve() -> int: total_cookies = 3 * 24 + 2 * 18 total_earnings = total_cookies * 50 / 100 result = total_earnings return result
Alex bought a backpack for $27. He also bought 3 pencils that cost $2.50 each. How much money did Alex spend in total?
def solve() -> int: backpack = 27 num_pencils = 3 price_pencils = 2.50 total_cost = backpack + num_pencils * price_pencils result = total_cost return result
Anushka is cycling to a nearby town. On the straight road, she can ride at a pace of 24 kilometers per hour. Riding downhill, she can ride at a pace 4 kilometers per hour faster than usual. While riding uphill, she can ride at a pace which is 8 kilometers per hour slower than usual. If she spends one-fifth of her time ...
def solve() -> int: usual_pace = 24 downhill_pace = usual_pace + 4 uphill_pace = usual_pace - 8 downhill_time = 1/5 straight_uphill_time = 4/5 average_pace = (downhill_time * downhill_pace) + (straight_uphill_time * ((usual_pace + uphill_pace)/2)) result = average_pace ...
Student: A recipe calls for 2 cups of sugar to make 24 cookies. How much sugar is needed to make 36 cookies using the same recipe?
def solve() -> int: cups_of_sugar_per_cookie = 2/24 cups_of_sugar_for_36_cookies = cups_of_sugar_per_cookie * 36 result = cups_of_sugar_for_36_cookies return result
A teacher graded the tests of all of her 30 students. The average score of the girls was 85. The average score of the boys was 92. If there are 10 girls in the class, how many boys are there?
def solve() -> int: girls_total_score = 85 * 10 total_score = 30 * 88 boys_total_score = total_score - girls_total_score boys_count = (boys_total_score/92) result = boys_count return result
If Sarah works for $14 an hour for the first 50 hours of work and $21 an hour for any additional hours above 50 hours, and she worked 66 hours last week, calculate her total income.
def solve() -> int: hourly_pay = 14 overtime_pay = 21 regular_hours = 50 total_hours = 66 if total_hours <= regular_hours: total_pay = total_hours * hourly_pay else: overtime_hours = total_hours - regular_hours regular_pay = regular_hours * hourly_pay overtime_pay = ...
Patrick had already cleaned 22 windows when his co-worker, Maria, joined in and cleaned them at a rate of 4 every 10 minutes. When Maria stopped, there were 54 windows cleaned. For how many minutes did Maria clean windows? Mrs. Meadow has 8 horses, some pigs, and 3 llamas. She has twice as many horses as pigs and 4 tim...
def solve() -> int: patrick_cleaned = 22 maria_cleaned = 54 - patrick_cleaned rate = 4 / 10 time = maria_cleaned / rate result = time return result
How many oranges can be divided into 16 identical baskets, if there are 120 oranges in total?
def solve() -> int: num_oranges = 120 num_baskets = 16 oranges_per_basket = num_oranges // num_baskets result = oranges_per_basket return result
A man's arms are two-fifths the length of his body. If he is 6 feet tall, how long are his arms?
def solve() -> int: height = 6 body_length = height arm_length_ratio = 2/5 arm_length = arm_length_ratio * body_length result = arm_length return result
Maria is twice as old as her sister who is 9 years old. What is the sum of their ages?
def solve() -> int: sister = 9 maria = 2 * sister age_sum = sister + maria result = age_sum return result
Student: John found 16 coins under his bed this morning. If he already had 22 coins, how many coins did he have yesterday?
def solve() -> int: coins_today = 16 + 22 coins_yesterday = coins_today - 16 result = coins_yesterday return result
The radius of a circle is 5 cm. What is the circumference of the circle?
def solve() -> int: pi = 3.14159 circumference = 2 * pi * 5 result = circumference return result
A store is having a sale for 25% off all items. If a shirt is originally $20, what is the sale price?
def solve() -> int: shirt_price = 20 percent_off = 25 sale_price = shirt_price - (percent_off/100)*shirt_price result = sale_price return result
If a school has 15 classrooms, and each classroom has 25 students, how many students are there in total?
def solve() -> int: classrooms = 15 students_per_classroom = 25 total_students = classrooms * students_per_classroom result = total_students return result
Lucas is organizing his comic books in a box to keep them neat and tidy. He can fit 300 comic books in the box, unless they are his special edition comics which are twice as big as the regular ones. He has already filled the box with 20 special comics and 60 regular comics. How many regular comics can he fit into the e...
def solve() -> int: box_capacity = 300 special_comics_size = 2 special_comics_count = 20 regular_comics_count = 60 special_comics_space = special_comics_size * special_comics_count regular_comics_space = regular_comics_count total_comics_space = special_comics_space + regular_...
A pizza restaurant gives a 20% discount on all pizzas during happy hour. If a pizza costs $16 normally, how much will it cost during happy hour?
def solve() -> int: pizza_price = 16 discount_percentage = 20 discount_amount = (discount_percentage / 100) * pizza_price price_after_discount = pizza_price - discount_amount result = price_after_discount return result
Jared is a part-time car washer who earns $12 per hour. He works for 6 hours a day and 7 days a week. If he decides to take a vacation day, how much will his monthly earnings amount to?
def solve() -> int: hourly_rate = 12 daily_hours = 6 weekly_days = 7 vacation_days = 1 weekly_earnings = hourly_rate * daily_hours * (weekly_days - vacation_days) monthly_earnings = weekly_earnings * 4 result = monthly_earnings return result
A swimming pool has a length of 30 meters, a width of 20 meters, and a depth of 3 meters. How many cubic meters of water can the pool hold?
def solve() -> int: length = 30 width = 20 depth = 3 volume = length * width * depth result = volume return result
A room has a length of 6 meters, a width of 4 meters, and a height of 3 meters. What is the total area of the walls that need to be painted?
def solve() -> int: area = 2*6*3 + 2*4*3 result = area return result
A carpenter needs 17 nails for a project. Each bag of nails contains 50 nails. How many bags of nails does the carpenter need for the project?
def solve() -> int: nails_needed = 17 number_in_bag = 50 bags_needed = nails_needed / number_in_bag result = bags_needed return result
At a restaurant, the average number of pizzas sold per hour is 20. If each pizza is cut into 8 slices and each table has 4 people, how many pizzas would need to be sold to feed 60 people in 2 hours?
def solve() -> int: people = 60 time = 2 ppl_per_pizza = 4 slices_per_pizza = 8 pizzas_per_hour = 20 pizzas_needed = (people / ppl_per_pizza) * (time * pizzas_per_hour) result = pizzas_needed return result
A rectangular garden is 12 feet long and 8 feet wide. If it costs $2 per square foot to install grass in the garden, how much will it cost to install grass in the garden?
def solve() -> int: length = 12 width = 8 cost_per_square_foot = 2 total_cost = length * width * cost_per_square_foot result = total_cost return result
Alice and Bob collect stamps and stickers. Alice has 120 stamps and 80 stickers. Bob has 90 stamps and 60 stickers. They decide to trade some of their stamps and stickers with each other. Alice gives Bob 20 stamps and receives 30 stickers. Bob gives Alice 15 stickers and receives 10 stamps. After the trade, what percen...
def solve() -> int: alice_stamps_initial = 120 alice_stickers_initial = 80 bob_stamps_initial = 90 bob_stickers_initial = 60 alice_stamps_traded = 20 alice_stickers_traded = 15 bob_stamps_traded = 10 bob_stickers_traded = 30 alice_stamps_final = alice_stamps_initial - alice_s...
At the basketball game, there were 45 attendees including 18 females and 5 more males than females. If each person receives 1 slice of pizza, and Janna bought boxes of pizza where each box costs $10 and contains 8 slices of pizza, how much did Janna spend on pizzas?
def solve() -> int: total_attendees = 45 female_count = 18 male_count = female_count + 5 pizza_cost = 10 slices_per_box = 8 total_slices_needed = total_attendees total_boxes_needed = total_slices_needed / slices_per_box total_cost = total_boxes_needed * pizza_cost ...
Daphne has collected 56 notes from playing the piano. If she plays 4 notes at a time, how many times has she played those notes?
def solve() -> int: total_notes = 56 notes_per_time = 4 total_times = total_notes / notes_per_time result = total_times return result
Jake had 120 marbles that he won in a game. He decided to give 20% of them to his sister, who also liked to play with marbles, and 10% of them to his friend, who wanted to try the game. He then put the rest of the marbles in three jars, filling each jar with the same number of marbles. How many marbles did Jake put in ...
def solve() -> int: marbles = 120 sister = 0.2 * marbles marbles = marbles - sister friend = 0.1 * marbles marbles = marbles - friend marbles = marbles / 3 result = marbles return result
A hardware store charges $5 for a hammer, $10 for a saw and $25 for a drill. John bought 2 hammers, 3 saws and 1 drill. How much did he pay?
def solve() -> int: hammer_price = 5 saw_price = 10 drill_price = 25 hammers = 2 saws = 3 drills = 1 total_cost = (hammer_price * hammers) + (saw_price * saws) + (drill_price * drills) result = total_cost return result
A shopping cart has 10 cans of soup and four times as many cans of beans as soup. If each can of soup serves 2 people and each can of beans serves 4 people, how many people can be fed with the cart's contents?
def solve() -> int: soup = 10 beans = 4 * soup soup_serves = 2 beans_serves = 4 total_serves = (soup * soup_serves) + (beans * beans_serves) result = total_serves return result
There are 24 students in a class and each student has 3 pens. How many pens are there in total?
def solve() -> int: students = 24 pens_per_student = 3 total_pens = students * pens_per_student result = total_pens return result
In a store, for every shirt there are four pants, and for every pant there are 10 socks. If there are 50 million socks in the store, what is the shirt population of the store, in millions?
def solve() -> int: pants_per_shirt = 4 socks_per_pant = 10 total_socks = 50000000 pants = total_socks / socks_per_pant shirts = pants / pants_per_shirt result = shirts / 1000000 return result
A triangle has a base of 10 units and a height of 8 units. What is the area of the triangle?
def solve() -> int: base = 10 height = 8 area = 0.5 * base * height result = area return result
A store has 50 t-shirts in stock. They want to sell all the t-shirts in packs of 5. How many packs of t-shirts can they make?
def solve() -> int: tshirts = 50 pack_size = 5 packs = tshirts // pack_size result = packs return result
A pack of pencils contains 12 pencils and costs $1.80. If Sally needs 36 pencils for her class, how many packs of pencils does she need to buy? How much does she pay for the pencils? How much change does she get if she pays with a $10 bill?
def solve() -> int: pencils_per_pack = 12 pack_price = 1.8 pencils_needed = 36 bill = 10 packs_needed = pencils_needed // pencils_per_pack pencil_cost = packs_needed * pack_price change = bill - pencil_cost result = change return result
Debby has a cupcake delivery business. She charges $2 for each cupcake she delivers. If she delivers 125 cupcakes in one week, how much money does Debby make in one week?
def solve() -> int: cupcakes = 125 cupcakes_pay = 2 total_pay = cupcakes * cupcakes_pay result = total_pay return result
Tom is twice as old as Harry. Harry is 14. In 5 years, Tom will be three times as old as Harry. How old is Tom now?
def solve() -> int: age_harry = 14 age_tom = age_harry*2 age_tom_5 = age_tom + 5 age_harry_5 = age_harry + 5 while age_tom_5!= age_harry_5*3: age_tom += 1 age_tom_5 = age_tom + 5 result = age_tom return result
am has 12 siblings and he wants to give every one of then a birthday present. If the present cost 6 dollars and he has 72 dollars, how much money will he have left after he gives all his siblings presents?
def solve() -> int: num_siblings = 12 cost = 6 total_start = 72 total_end = total_start - num_siblings * cost result = total_end return result
Student: Alex has three containers with capacities of 5, 8, and 10 liters, respectively. He fills the 10-liter container with juice and pours as much as he can into the 5-liter container. Then, he pours the remainder into the 8-liter container. How much juice, in liters, is in the 8-liter container?
def solve() -> int: container_5 = 5 container_8 = 8 container_10 = 10 juice_10 = container_10 juice_5 = min(juice_10, container_5) juice_8 = juice_10 - juice_5 result = juice_8 return result
Student: Rachel wants to buy a dress that costs $80. She has a coupon that offers a 20% discount. How much does she pay for the dress?
def solve() -> int: cost = 80 discount = 0.2 discount_amount = cost * discount final_price = cost - discount_amount result = final_price return result
Student: How much of a bog's cranberries would remain if 12000 cranberries were eaten by elk and 27% were harvested by humans?
def solve() -> int: total_cranberries = 50000 harvested_cranberries = total_cranberries * 0.27 eaten_cranberries = 12000 remaining_cranberries = total_cranberries - harvested_cranberries - eaten_cranberries result = remaining_cranberries return result
Ava wants to buy a new dress for $80. Her parents give her a monthly allowance of $30 and she can earn $10 per hour by cleaning her neighbor’s pool. If she has saved $55 already, how many hours does she need to spend cleaning the pool before she can buy the dress?
def solve() -> int: monthly_allowance = 30 hourly_earning = 10 dress_price = 80 saved_money = 55 remaining_money = dress_price - saved_money hours_needed = remaining_money / hourly_earning result = hours_needed return result
A rectangular plot has a length of 40 meters and a width of 20 meters. If fencing costs $5 per meter, how much will it cost to fence the plot?
def solve() -> int: perimeter = 2*40 + 2*20 fence_cost = perimeter*5 result = fence_cost return result
Lucy decided to swim laps at the pool. It takes her 30 minutes to swim 20 laps. She then takes 1.5 times as long to relax in the hot tub as it took her to swim. How much time did Lucy spend at the pool?
def solve() -> int: swim_time = 30 laps = 20 lap_time = swim_time / laps relax_time = 1.5 * swim_time total_time = swim_time + relax_time result = total_time return result
Sally has 4 bags of oranges to make juice that require 2 oranges each. Tim has 5 more bags of oranges that need to be juiced altogether. How many oranges do they need altogether?
def solve() -> int: sally_bags = 4 tim_bags = sally_bags + 5 oranges_per_juice = 2 total_oranges = (sally_bags + tim_bags) * oranges_per_juice result = total_oranges return result
The cost of a pencil is $0.35 and the cost of a pen is $2.25. What is the cost of 6 pencils and 4 pens?
def solve() -> int: pencil_cost = 0.35 pen_cost = 2.25 num_pencils = 6 num_pens = 4 total_cost = pencil_cost * num_pencils + pen_cost * num_pens result = total_cost return result
A company ordered 500 more than twice as many chairs as it did tables at $50 each. If the price of a table was $30, and the company ordered 10 sets, each having 6 tables, calculate the total amount of money they paid for the furniture.
def solve() -> int: tables_in_set = 6 table_price = 30 sets_ordered = 10 chairs_ordered = 500 + 2 * tables_in_set * sets_ordered chair_price = 50 total_chair_cost = chairs_ordered * chair_price total_table_cost = tables_in_set * sets_ordered * table_price ...
6. If Jan has 2000 stamps, and each box can contain 45 stamps, how many boxes does Jan need to use to store all of those stamps?
def solve() -> int: stamps = 2000 stamps_per_box = 45 total_boxes = stamps / stamps_per_box result = total_boxes return result
A farmer wants to build a fence around a triangular field with a base of 30 yards and a height of 15 yards. He also wants to enclose a rectangular pen inside the field with dimensions of 10 yards by 8 yards. What is the total length of fencing he needs to do this?
def solve() -> int: base = 30 height = 15 rect_length = 10 rect_width = 8 tri_perimeter = base + height + ((base**2 + height**2)**0.5) rect_perimeter = 2 * (rect_length + rect_width) total_length = tri_perimeter + rect_perimeter result = total_length return result...
A crafty car dealer is adding additional charges without customers realizing. If a car cost $20,000, and the sales tax is 8%, and the customer also purchased a car stereo for $500 and paint protection for $1000, how much additional charges did the dealer sneak in?
def solve() -> int: car_cost = 20000 sales_tax = 0.08 car_stereo_cost = 500 paint_protection_cost = 1000 additional_charges = (car_cost * sales_tax) + car_stereo_cost + paint_protection_cost result = additional_charges return result
A company generated revenue of $10,000 in a year ten years ago. If the company's revenue has increased six times since then, and it is predicted to increase by 70% in the next ten years, what will be the company's revenue in ten years?
def solve() -> int: revenue_10_years_ago = 10000 revenue_now = revenue_10_years_ago * 6 revenue_next_10_years = revenue_now * 1.7 result = revenue_next_10_years return result
Tim started saving $50 at the beginning of each month. If he can earn an annual interest rate of 4%. How much money will he have by the end of the year?
def solve() -> int: monthly_savings = 50 annual_interest_rate = 0.04 total_savings_by_end_of_year = monthly_savings * 12 * (1 + annual_interest_rate) result = total_savings_by_end_of_year return result
Joe walks around the park every day for exercise. Today, he walk 60 meters and then 120 meters and then 30 meters. How many meters has Joe walked in total?
def solve() -> int: walk1 = 60 walk2 = 120 walk3 = 30 total_walk = walk1 + walk2 + walk3 result = total_walk return result
A shopkeeper who has been in business for 20 years earns $4,000 a month. If her salary increases by 15%, what will be her new monthly salary?
def solve() -> int: initial_salary = 4000 percentage_increase = 15 increase_amount = initial_salary * percentage_increase / 100 new_salary = initial_salary + increase_amount result = new_salary return result
Student: Casey has 18 cucumber seeds and 6 pots. How many seeds will be in each pot if she wants to plant them evenly?
def solve() -> int: seeds = 18 pots = 6 seeds_per_pot = seeds / pots result = round(seeds_per_pot) return result
David is delivering newspapers and earns $0.30 per paper. He can deliver 50 papers in an hour. His gasoline cost is $5 per hour. If he delivers for 7 hours, how much money can he expect to make in profit?
def solve() -> int: papers_per_hour = 50 hourly_pay = 0.30 * papers_per_hour gasoline_cost_per_hour = 5 total_hours = 7 total_pay = hourly_pay * total_hours total_gasoline_cost = gasoline_cost_per_hour * total_hours profit = total_pay - total_gasoline_cost result = profit ...
William is paying his cleaning lady $20 per hour. If she works for him for five hours every week, how much is he spending per month on cleaning services?
def solve() -> int: hourly_rate = 20 weekly_hours = 5 weekly_cost = hourly_rate * weekly_hours monthly_cost = weekly_cost * 4 result = monthly_cost return result
A bike rental company has 30 bikes for rent. The rate for renting a bike is $5 per hour. They rented out 21 bikes for a total of 98 hours. How many hours was each bike rented, on average?
def solve() -> int: total_bikes = 30 rental_rate = 5 total_hours = 98 total_rental_fee = total_bikes * rental_rate * total_hours avg_rental_time = total_hours / total_bikes result = "Each bike was rented on average for "+str(int(avg_rental_time))+" hours." return result
Ethan has a bottle of 600 ml of juice. He wants to pour it into smaller bottles of 75 ml each. How many smaller bottles can he fill and how much juice will he have left over?
def solve() -> int: juice = 600 bottle = 75 smaller_bottles = juice // bottle remaining_juice = juice % bottle result = "Ethan can fill {} smaller bottles and will have {} ml of juice left over.".format(smaller_bottles, remaining_juice) return result
A company employs 200 people. If 80% of them earn $1000 per month and the rest earns $2000 per month, what is the total monthly salary paid by the company?
def solve() -> int: earning_1 = 200*0.8*1000 earning_2 = 200*0.2*2000 total_earning = earning_1 + earning_2 result = total_earning return result
Jason has a pizza shop. For each large pizza he sells, he has to use 2 cups of cheese and 1 cup of olive oil. If he wants to make 10 large pizzas, how much cheese and olive oil does he need?
def solve() -> int: no_of_pizzas = 10 cheese = 2 olive_oil = 1 result = (no_of_pizzas * cheese) + (no_of_pizzas * olive_oil) return result
Lisa wants to make a juice using 2 parts of apple juice and 3 parts of orange juice. She has 1.2 liters of apple juice and 2.4 liters of orange juice. How many liters of juice can she make with the given proportions?
def solve() -> int: from math import gcd part = gcd(2, 3) apple_parts = 1.2 / part orange_parts = 2.4 / part min_parts = min(apple_parts, orange_parts) apple_juice = min_parts * part orange_juice = min_parts * part total_juice = apple_juice + orange_juice result = total_juice ...
If Michael earns half what Michelle does, and Michelle earns $4 per hour, how much does Michael earn in 2 days working 5 hours a day?
def solve() -> int: michelle_earnings_per_hour = 4 michael_earnings_per_hour = michelle_earnings_per_hour / 2 michael_work_hours = 5 * 2 michael_total_earnings = michael_earnings_per_hour * michael_work_hours result = michael_total_earnings return result
There are 30 students in a class. If 18 students prefer chocolate and 24 students prefer vanilla, how many students prefer both chocolate and vanilla ice cream?
def solve() -> int: choco_vanilla = 18 + 24 - 30 result = choco_vanilla return result
If 4 oranges cost as much as 6 apples cost, and 10 apples cost $30, what is the cost of 15 oranges?
def solve() -> int: cost_of_10_apples = 30 cost_of_1_apple = cost_of_10_apples / 10 cost_of_6_apples = cost_of_1_apple * 6 cost_of_4_oranges = cost_of_6_apples cost_of_1_orange = cost_of_4_oranges / 4 cost_of_15_oranges = cost_of_1_orange * 15 result = cost_of_15_oranges return result
Student: Rachel borrowed $5000 from the bank at an annual interest rate of 6%, compounded quarterly. She decides to pay off the loan after 3 years. How much interest will she have paid by the time she pays off the loan?
def solve() -> int: principal = 5000 interest_rate = 0.06 time = 3 compound_freq = 4 interest_paid = principal * interest_rate * time * compound_freq total_amount_paid = principal + interest_paid result = interest_paid return result
Carlos can solve 8 math problems in 20 minutes. His classmate, Maria, can solve the same 8 problems in 15 minutes. How long would it take Carlos and Maria to solve 20 math problems if they worked together?
def solve() -> int: carlos_problems_per_minute = 8/20 maria_problems_per_minute = 8/15 combined_problems_per_minute = carlos_problems_per_minute + maria_problems_per_minute time_to_solve_20_problems = 20/combined_problems_per_minute result = time_to_solve_20_problems return result
Max is a car manufacturer. He uses 5 less than 10 gallons of gas to make each car. If Max has 100 gallons of gas, how many cars can he make?
def solve() -> int: gas_per_car = 10 - 5 total_gas = 100 cars = total_gas // gas_per_car result = cars return result
A car travels a distance of 100 km at a speed of 75 km per hour. How long did the trip take?
def solve() -> int: distance = 100 speed = 75 time = distance/speed result = time return result
Max likes to collect stickers. He collected one set of stickers with 50 stickers, two sets of stickers with 25 stickers each, and one set of stickers with half the number of stickers of the three previous sets combined. How many stickers did Max collect in total?
def solve() -> int: set1 = 50 set2 = 25 * 2 set3 = set1 + set2 set4 = set3 / 2 total = set1 + set2 + set3 + set4 result = total return result
A copper wire has a length of 150 meters. If the cost of copper wire is $2 per meter, how much does it cost for 150 meters of copper wire?
def solve() -> int: wire_length = 150 cost_per_meter = 2 total_cost = wire_length * cost_per_meter result = total_cost return result