question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A company produces 1000 widgets for $5000. What is the cost of producing 1 widget?
def solve() -> int: num_widgets = 1000 total_cost = 5000 cost_per_widget = total_cost / num_widgets result = cost_per_widget return result
Student: Dennis has 54 oranges. He needs to give equal portions of 18 oranges to three people. How many oranges will each person get?
def solve() -> int: oranges = 54 portion = 18 people = 3 each_person = oranges // people remaining_oranges = oranges % people result = each_person return result
Rachel and her brother Brian are selling lemonade for a charity fundraiser. They sold 50 cups of lemonade for $0.50 each. How much money did they make in total?
def solve() -> int: cups_sold = 50 price_per_cup = 0.5 total_money = cups_sold * price_per_cup result = total_money return result
Emma has 9 apples and wants to put them in bags of 3 apples each. How many bags will she need?
def solve() -> int: apples = 9 apple_per_bag = 3 total_bags = apples // apple_per_bag result = total_bags return result
Student: Ali runs a bakery and sells 4 kinds of pastries: croissants, muffins, scones, and cookies. He sells 12 croissants for $18, 8 muffins for $12, 10 scones for $15, and 16 cookies for $8. How much money does he make in a day if he sells 3 batches of each kind of pastry?
def solve() -> int: croissants = 12 muffins = 8 scones = 10 cookies = 16 croissant_price = 18 muffin_price = 12 scone_price = 15 cookie_price = 8 croissant_total = croissants * 3 * croissant_price muffin_total = muffins * 3 * muffin_price scone_total = scones * 3 * scone_pric...
A pizza restaurant offers a large pizza with up to 3 toppings for $12. Each additional topping costs $1.50. How much would it cost for a large pizza with 5 toppings?
def solve() -> int: num_toppings = 5 base_cost = 12 additional_toppings = max(num_toppings - 3, 0) cost_per_additional_topping = 1.5 total_cost = base_cost + (additional_toppings * cost_per_additional_topping) result = total_cost return result
Student: A square has a perimeter of 20cm. What is the length of each side?
def solve() -> int: perimeter = 20 sides = 4 length = perimeter / sides result = length return result
If a store sells apples for $0.75 each and a customer buys 6 apples, how much will they have to pay?
def solve() -> int: apple_cost = 0.75 total_apples = 6 total_cost = apple_cost * total_apples result = total_cost return result
A movie theater has 300 seats, and 40% of them are reserved. How many seats are still available?
def solve() -> int: total_seats = 300 reserved_seats = total_seats * 0.4 available_seats = total_seats - reserved_seats result = available_seats return result
A bag contains 9 black marbles, 4 white marbles, and 7 red marbles. What is the probability of choosing a white marble?
def solve() -> int: total_marbles = 9 + 4 + 7 white_marbles = 4 probability = white_marbles / total_marbles result = probability return result
Possible new questions and programs are: A baker makes pies and sells them for $15 each. He uses 4 cups of flour, 2 cups of sugar, and 1 cup of butter for each pie. He buys these ingredients in bulk and pays $0.50 per cup of flour, $0.75 per cup of sugar, and $1.25 per cup of butter. He sells 12 pies in a day and then ...
def solve() -> int: cost_per_pie = 4 * 0.5 + 2 * 0.75 + 1 * 1.25 price_per_pie = 15 pies_sold = 12 charity_fraction = 0.25 profits = price_per_pie * pies_sold - cost_per_pie * pies_sold donation = charity_fraction * profits remaining = profits - donation result = remaining ret...
If you have to make two table runners that measure 72 inches by 14 inches and twelve napkins that measure 8 inches by 10 inches, how many square inches of fabric do you need?
def solve() -> int: table_runner_length = 72 table_runner_width = 14 napkin_length = 8 napkin_width = 10 table_runner_area = table_runner_length * table_runner_width napkin_area = napkin_length * napkin_width total_area = (2 * table_runner_area) + (12 * napkin_area) result...
If Henry has to exercise, lifting weights takes 10 minutes each time, then taking a break for 20 minutes each time. If running on the treadmill takes 30 minutes and stretching takes 5 minutes, how long does the entire process take?
def solve() -> int: lifting_time = 10 break_time = 20 running_time = 30 stretching_time = 5 total_time = 3 * lifting_time + 3 * break_time + running_time + stretching_time result = total_time return result
John delivers newspapers on his bike. He has 6 bags of newspapers that he delivers every day. Each bag has 30 newspapers. He gets 10 cents for every newspaper he delivers. How much money does he make per week?
def solve() -> int: num_bags = 6 num_newspapers_per_bag = 30 num_newspapers_per_week = num_bags * num_newspapers_per_bag price_per_newspaper = 0.10 total_money_per_week = num_newspapers_per_week * price_per_newspaper result = total_money_per_week return result
Maria wanted to buy 8 markers. They cost $2 each. Leslie wanted to buy 5 of the same markers. How much money did Maria and Leslie spend?
def solve() -> int: marker_number_maria = 8 marker_price = 2 marker_number_leslie = 5 cost_maria = marker_number_maria * marker_price cost_leslie = marker_number_leslie * marker_price total_cost = cost_maria + cost_leslie result = total_cost return result
A supermarket sells apples at $0.75 each. Lisa buys 5 apples, but the supermarket has a coupon for buy 4 apples, get 1 free. How much does Lisa pay for the 5 apples, including tax (8%)?
def solve() -> int: apple_price = 0.75 apples_bought = 5 regular_cost = apple_price * apples_bought free_apples = apples_bought // 4 actual_cost = (apples_bought - free_apples) * apple_price with_tax = actual_cost * 1.08 result = with_tax return result
6. Kim and her friend went to the store and bought 4 items. If Kim paid for 2 of the items and her friend paid for the other 2 items, how much did each person pay?
def solve() -> int: total_items = 4 items_Kim_paid_for = 2 total_price = 10 price_per_item = total_price / total_items Kim_paid = price_per_item * items_Kim_paid_for friend_paid = total_price - Kim_paid result = Kim_paid, friend_paid return result
The biggest pumpkin ever grown weighed 1,969 pounds. Mike, a 14-year-old, wants to grow a pumpkin that big. The smallest pumpkin he has is 2 pounds. These pumpkins grow at a rate of 0.5 pounds per week. How old will he be when he grows the pumpkin heavier than the world record?
def solve() -> int: pumpkin_weight = 2 growth_rate = 0.5 world_record_weight = 1969 age = 14 while pumpkin_weight <= world_record_weight: pumpkin_weight += growth_rate age += 1 result = age return result
Mary bought a sports car that advertised an estimated fuel efficiency of 20 miles per gallon. The car has a 18-gallon tank. She filled the car full of fuel and was able to travel a total of 300 miles. What was the difference, in miles per gallon, between Mary's fuel efficiency and the advertised fuel efficiency?
def solve() -> int: advertised_efficiency = 20 tank_size = 18 total_distance = 300 actual_efficiency = total_distance / tank_size efficiency_difference = advertised_efficiency - actual_efficiency result = efficiency_difference return result
Mark's mom is very strict about how much sugar he can consume in a day. She has set a limit of 40 grams of sugar. If a can of soda has 20 grams of sugar, a candy bar has 15 grams of sugar, a cookie has 10 grams of sugar, and a piece of fruit has 5 grams of sugar, how many more cookies can Mark eat if he has already had...
def solve() -> int: soda = 20/2 candy_bar = 15 fruit = 5 cookie = 10 total_sugar_consumed = soda + candy_bar + fruit remaining_sugar = 40 - total_sugar_consumed remaining_cookies = remaining_sugar // cookie result = remaining_cookies return result
If 7 apples are shared evenly among 3 people, how many apples does each person get?
def solve() -> int: num_people = 3 num_apples = 7 result = num_apples // num_people print (result) result = 2 return result
Rachel works as a cashier and earns a variable amount of money every day. The past three days, she earned $40, $50, and $35 respectively. How much does she need to earn today if she wants to make a total of $150 for the week?
def solve() -> int: num_of_days = 7 desired_total = 150 total_earned = 40 + 50 + 35 needed_earnings = desired_total - total_earned result = needed_earnings return result
An artist is painting a mural that is 16 feet wide and 8 feet tall. If they have already painted 3/4 of the mural, how many square feet of the mural have they painted?
def solve() -> int: width = 16 height = 8 area = width * height percentage_painted = 0.75 painted_area = area * percentage_painted result = painted_area return result
If the area of a square is 64 square centimeters, what is the perimeter of the square?
def solve() -> int: side = (64 ** 0.5) perimeter = 4 * side result = perimeter return result
A department store is having a sale where all items are 25% off their original price. If a pair of shoes costs $60 at full price, how much will they cost during the sale?
def solve() -> int: original_price = 60 discount = 0.25 new_price = original_price - (original_price * discount) result = new_price return result
Student: A recipe calls for 2 cups of flour, 1 cup of sugar, and 3 eggs. If flour costs $2 per cup, sugar costs $1 per cup, and eggs cost $0.50 each, how much does it cost to make the recipe?
def solve() -> int: flour = 2 sugar = 1 eggs = 3 cost_flour = flour * 2 cost_sugar = sugar * 1 cost_eggs = eggs * 0.50 total_cost = cost_flour + cost_sugar + cost_eggs result = total_cost return result
Marcus is saving money for a new bike. He currently has $80 and saves $10 every week. How much money will he have in 5 weeks?
def solve() -> int: current = 80 weekly_savings = 10 weeks = 5 total_savings = current + weekly_savings * weeks result = total_savings return result
Student: A coffee shop sells three sizes of coffee: small for $2, medium for $3 and large for $4. If they sold 500 coffees in one month, with 40% being small, 30% being medium and the rest large. How much profit did they make?
def solve() -> int: small_price = 2 medium_price = 3 large_price = 4 total_coffees = 500 small_ratio = 0.4 medium_ratio = 0.3 large_ratio = 1 - small_ratio - medium_ratio small_sold = total_coffees * small_ratio medium_sold = total_coffees * medium_ratio large_sold = total_coffee...
Andrew has to choose between two jobs. His first job pays $100 per hour while the second pays $10 per hour, but each day Andrew works the second job he earns an additional bonus of $50. If Andrew worked the two jobs for a week, how much more money would he have made with the first job compared to the second?
def solve() -> int: job1_daily = 100 job2_daily = 10 job2_bonus = 50 hours_in_week = 7 days_in_job1 = hours_in_week days_in_job2 = hours_in_week money_job1 = job1_daily * days_in_job1 money_job2 = job2_daily * days_in_job2 + job2_bonus * days_in_job2 differen...
A bookshelf has 5 shelves. Each shelf can hold 10 books. If there are already 27 books on the bookshelf, how many more books can it hold?
def solve() -> int: num_shelves = 5 books_per_shelf = 10 books_on_shelf = 27 total_books = num_shelves*books_per_shelf remaining_capacity = total_books - books_on_shelf result = remaining_capacity return result
Richard has 18 blue stamps and 32 red stamps. He gives twice as many blue stamps to his brother as red stamps. How many stamps does Richard have left?
def solve() -> int: blue_stamps = 18 red_stamps = 32 stamps_given_to_brother = (blue_stamps * 2) + red_stamps stamps_left = blue_stamps + red_stamps - stamps_given_to_brother result = stamps_left return result
A shoe store bought a case of 30 pairs of shoes for $360. They sold 12 for $28 each, 8 for $15 each, and the rest for $18 each. How much profit did the store make?
def solve() -> int: cost = 360 profit = 0 sold_1 = 12 * 28 sold_2 = 8 * 15 sold_3 = (30 - 12 - 8) * 18 total_sales = sold_1 + sold_2 + sold_3 profit = total_sales - cost result = profit return result
A basketball court full of people raised 356 coins for charity. There were 14 people in the court. How many coins were raised by each person?
def solve() -> int: total_coins = 356 num_of_people = 14 coins_raised_by_person = total_coins / num_of_people result = coins_raised_by_person return result
Student: In a jigsaw puzzle, Zoe completed 6 pieces. Ava completed 4 more than Zoe and Bia completed 3 less than the half of Zoe and Ava. If Zoe, Ava, and Bia are on the same team, how many pieces did they complete for their team?
def solve() -> int: zoe = 6 ava = zoe + 4 bia = (zoe + ava) // 2 - 3 team = zoe + ava + bia result = team return result
John spent 1/6 of his earnings on a new phone and then spent 1/3 of what was left on a phone case. If he has $420 left, how much money did he earn?
def solve() -> int: earnings = 420 / (1 - 1/3) result = earnings return result
In a pile of 144 coins, one-third are dimes while the others are quarters. If there are 12 more heads dimes than tails dimes, and the ratio of heads quarters to tails quarters is 3:2, how many more tails coins are there than heads coins?
def solve() -> int: total_coins = 144 dime_coins = total_coins / 3 quarter_coins = total_coins - dime_coins heads_dimes = dime_coins / 2 + 12 tails_dimes = dime_coins - heads_dimes heads_quarters = quarter_coins * 3 / 5 tails_quarters = quarter_coins - heads_quarters difference = (t...
Sam has a collection of 120 stamps, of which 40% are from Asia and 25% are from Europe. He decides to give away some of his stamps to his friends. He gives away 12 Asian stamps and 15 European stamps. How many stamps does he have left?
def solve() -> int: asian_stamps = 0.4 * 120 euro_stamps = 0.25 * 120 asian_stamps -= 12 euro_stamps -= 15 other_stamps = 120 - asian_stamps - euro_stamps total_stamps = asian_stamps + euro_stamps + other_stamps result = total_stamps return result
Student: Sophia is creating a garden in her backyard. She needs to buy 10 bags of soil to fill up 5 buckets. Each bag costs $3.50, how much will the total cost be?
def solve() -> int: bags = 10 buckets = 5 cost_per_bag = 3.50 total_cost = bags * buckets * cost_per_bag result = total_cost return result
Josh and Tyler rented a car for a weekend trip. The daily rental price is $45, but they were given a discount of $10 per day. If they rented the car for two days, what is the total amount they paid?
def solve() -> int: rental_price = 45 discount = 10 days_rented = 2 total_amount = (rental_price - discount) * days_rented result = total_amount return result
Holly wants to buy a set of markers that costs $30. If the set contains 6 markers, and each marker is a different color, how much does each color marker cost?
def solve() -> int: set_cost = 30 num_markers = 6 cost_per_marker = set_cost / num_markers result = cost_per_marker return result
John cooks 3 12-ounce steaks for dinner every Friday. He can only cook 2 at a time because his pan is small. Each steak takes 10 minutes to cook. If he plans to serve dinner at 7:30 pm, what is the latest time he can start cooking the steaks?
def solve() -> int: steaks_per_batch = 2 cooking_time_per_steak = 10 total_steaks = 3 total_batches = total_steaks / steaks_per_batch total_cooking_time = total_batches * cooking_time_per_steak start_time = 7 * 60 + 30 - total_cooking_time hours = start_time // 60 minutes = start_time % ...
Charlie is a gardener. He has a rectangular plot of land that measures 15 meters by 12 meters. He wants to plant flowers along the perimeter of the plot, leaving a gap of 1 meter between each flower. How many flowers does he need to buy?
def solve() -> int: length = 15 width = 12 perimeter = 2 * (length + width) flowers_per_meter = 1 gaps_per_meter = flowers_per_meter - 1 gaps = perimeter * gaps_per_meter result = perimeter - gaps return result
In a school, there are 30 students in a class, and each student needs 5 pencils. If a pack of pencils contains 20 pencils, then how many packs of pencils does the teacher need to buy for the entire class?
def solve() -> int: pencils_needed = 30 * 5 packs_needed = pencils_needed // 20 + 1 result = packs_needed return result
pencer has 702 stamps in his collection, and wants to store them in 37 boxes. How many stamps should go in each box?
def solve() -> int: total_stamps = 702 num_boxes = 37 stamps_per_box = total_stamps/num_boxes result = stamps_per_box return result
Jenna works in a bakery, and she made 10 cakes for her boss in 4 hours. If it took her twice as long to make one cake as it did to plan it, how much time did Jenna spend planning the cakes in total?
def solve() -> int: time_taken = 4 time_per_cake = time_taken / 10 time_planning = time_per_cake / 2 total_time_planning = time_planning * 10 result = total_time_planning return result
Harry invested $1500 in Facebook. In the first month, it gained 12%. In the second month, it lost 7%. In the third month, it gained 9%. In the fourth month, it lost 4% on top of what it gained in the first three months. What is his investment worth now?
def solve() -> int: amount_invested = 1500 gain_in_first_month = 0.12 loss_in_second_month = 0.07 gain_in_third_month = 0.09 loss_in_fourth_month = 0.04 amount_after_first_month = amount_invested + (gain_in_first_month * amount_invested) amount_after_second_month = amount_after_first_month -...
A bookstore has 500 books. If 60% of the books are fiction, how many non-fiction books are there?
def solve() -> int: num_books = 500 fiction_percent = 0.6 non_fiction_percent = 1-fiction_percent non_fiction_books = non_fiction_percent*num_books result = non_fiction_books return result
Bob was making cookies for his friends. He had a recipe that made 24 cookies with 2 cups of flour, 1 cup of sugar, and 0.5 cups of butter. He wanted to make 72 cookies and he had already used 4 cups of flour and 2 cups of sugar. How much butter does he need to use?
def solve() -> int: cookies_per_flour = 24 / 2 cookies_per_sugar = 24 / 1 cookies_per_butter = 24 / 0.5 cookies_from_flour = 4 * cookies_per_flour cookies_from_sugar = 2 * cookies_per_sugar cookies_made = min(cookies_from_flour, cookies_from_sugar) cookies_remaining = 72...
Student: Vic had 3 boxes of cereal, he bought 2 more boxes and gave 1 away. How many boxes does he have now?
def solve() -> int: boxes_initial = 3 boxes_bought = 2 boxes_given = 1 boxes_total = boxes_initial + boxes_bought - boxes_given result = boxes_total return result
Student: Maria bought two more roses than Lily bought. Kevin bought four times as many roses as Lily bought. If Kevin bought 20 roses, how many roses did Maria buy?
def solve() -> int: lily_roses = 0 kevin_roses = 20 maria_roses = lily_roses + 2 + (4 * lily_roses) result = maria_roses return result
Sarah jumps rope for 20 minutes on Monday, and half as much on Tuesday. On Wednesday Sarah jumps rope 3 times as much as she did on Monday. How many minutes did Sarah jump rope total in the three days?
def solve() -> int: day1 = 20 day2 = 0.5*day1 day3 = 3*day1 total = day1+day2+day3 result = total return result
Penguin island is inhabited by penguins. Two fifths of the penguins are female. The rest are male. Among the females, 30% are chicks. There are 24 adult females. How many male penguins are there?
def solve() -> int: adult_females = 24 chicks = 0.3 * adult_females total_penguins = adult_females + chicks male_penguins = 3/5 * total_penguins result = round(male_penguins) return result
A toy store named "Playground" is closed for 2 days every quarter. If the store could have made 3 thousand dollars per day during this time, what is the potential loss of revenue for "Playground" during 5 years of operation?
def solve() -> int: days_per_quarter = 2 revenue_per_day = 3000 quarters_per_year = 4 years_of_operation = 5 days_closed = days_per_quarter * quarters_per_year * years_of_operation potential_loss = days_closed * revenue_per_day result = potential_loss return result
Michael buys a sandwich and soup combo for $8.50 and adds a cookie for $1.25 more. If Michael buys this same combo every work day for a week, how much does he spend?
def solve() -> int: sandwich_and_soup_combo = 8.50 cookie = 1.25 days_in_a_week = 7 total_cost = (sandwich_and_soup_combo + cookie) * days_in_a_week result = total_cost return result
Zach can get to work in 15 minutes by car. He can get to work in 25 minutes by bus. If Zach takes the bus for 10 miles and drives for the remaining 20 miles of his journey, how many minutes will his commute take?
def solve() -> int: car_mins = 15 bus_mins = 25 total_miles = 10 + 20 car_mph = total_miles/car_mins bus_mph = total_miles/bus_mins total_mph = (car_mph * 10) + (bus_mph * 20) total_mins = total_miles/total_mph result = round(total_mins) return result
At a music festival, 100 artists performed, and two-fifths of them brought their bands along. If 60% of the bands were comprised of four members each, how many people were there in the festival?
def solve() -> int: artists = 100 bands = artists * 2/5 bands_with_four_members = bands * 60/100 members_in_bands_with_four_members = bands_with_four_members * 4 total_people = artists + members_in_bands_with_four_members result = total_people return result
A train travels at a speed of 50 km/hr for 2 hours and then at a speed of 60 km/hr for 3 hours. What is the total distance covered by the train?
def solve() -> int: distance1 = 50*2 distance2 = 60*3 total_distance = distance1 + distance2 result = total_distance return result
- Here are some possible questions and programs: A toy store has 3 dolls and some cars. A doll costs $12, and a car costs $8. If the store earns $108 from selling all the toys, how many cars does the store have?
def solve() -> int: doll_cost = 3 * 12 remaining_money = 108 - doll_cost car_number = remaining_money // 8 result = car_number return result
In a class of 30, the number of girls and boys are equal. If next year, 20% of the boys are leaving and the number of girls stays the same, what percentage of the class will be girls next year?
def solve() -> int: total_class = 30 boys = girls = 15 percent_boys_leaving = 20 boys_next_year = boys * (1 - percent_boys_leaving/100) total_next_year = boys_next_year + girls percent_girls = (girls / total_next_year) * 100 result = percent_girls return result
Trainer Sarah is managing 20 athletes. Two-fifths of her athletes require extra attention, which requires 10% more training time. If it takes 40 minutes to train a typical athlete, how long does it take for Sarah to train all her athletes?
def solve() -> int: athletes = 20 extra_attention = athletes * 2/5 normal_attention = athletes - extra_attention extra_training_time = 10/100 * 40 total_training_time = (extra_attention * (40 + extra_training_time)) + (normal_attention * 40) result = total_training_time return result
John drove to a restaurant which is 45 miles away, with an average speed of 50 miles per hour. On his way back, he drove at a speed of 30 miles per hour. What is the average speed for the whole trip?
def solve() -> int: time_to_arrive = 45 / 50 time_to_return = 45 / 30 total_time = time_to_arrive + time_to_return total_distance = 2 * 45 average_speed = total_distance / total_time result = average_speed return result
am had to go to the supermarket. She bought a three-pound bag of apples for $3.00 per pound, a five-pound bag of potatoes for $2.00 per pound, a two-pound pack of cheese for $4.00 per pound and a dozen eggs for $2.50. How much change would Sam get back if she paid with a $50 bill?
def solve() -> int: applesPrice = 3.00 * 3 potatoesPrice = 2.00 * 5 cheesePrice = 4.00 * 2 eggsPrice = 2.50 * 1 totalPrice = applesPrice + potatoesPrice + cheesePrice + eggsPrice change = 50 - totalPrice result = change return result
If you take the number of pages in a book and add 2, then multiply that by 3 and subtract 10, you get 40. How many pages are in the book?
def solve() -> int: p = (40 + 10) / 3 - 2 result = int(p) return result
A rectangle has width of 5 cm and perimeter of 22 cm. What is the length of the rectangle?
def solve() -> int: width = 5 perimeter = 22 length = (perimeter - 2*width) / 2 result = round(length, 2) return result
Alice wants to make 3 bracelets for her friends. She needs 15 beads for each bracelet. She has 20 beads of red color and 40 beads of blue color. How many more beads of any color does she need to buy?
def solve() -> int: total_beads = 3 * 15 have_beads = 20 + 40 buy_beads = total_beads - have_beads result = buy_beads return result
A bakery sells cakes for $15 each and pies for $10 each. They also offer a 10% discount for orders of more than 10 items. A customer ordered 7 cakes and 5 pies. How much did the customer pay for the order?
def solve() -> int: cake_price = 15 pie_price = 10 discount_rate = 0.1 cakes = 7 pies = 5 items = cakes + pies total_price = cake_price * cakes + pie_price * pies if items > 10: total_price = total_price * (1 - discount_rate) result = total_price return result
Emma went shopping. She bought 3 pairs of shoes for $20 each, and 5 shirts for $15 each. If she paid with a gift card for $100, how much change will she get back?
def solve() -> int: shoe_price = 20 num_shoes = 3 shirt_price = 15 num_shirts = 5 total_cost = (shoe_price * num_shoes) + (shirt_price * num_shirts) gift_card = 100 change = gift_card - total_cost result = change return result
Student: A triangle has a base of 12 feet and a height of 10 feet. What is the area of the triangle?
def solve() -> int: base = 12 height = 10 area = 0.5 * base * height result = area return result
At a bakery, 4 of the blueberry muffins have 36 blueberries, and 6 have 27 blueberries. What is the total number of blueberries in all 10 blueberry muffins?
def solve() -> int: total_blueberries = 0 num_muffins1 = 4 num_blueberries1 = 36 num_muffins2 = 6 num_blueberries2 = 27 total_blueberries = (num_muffins1*num_blueberries1) + (num_muffins2*num_blueberries2) result = total_blueberries return result
Alex is building a model city. Skyscrapers require 10 building blocks, houses require 6 building blocks, and apartments require 8 building blocks. Alex needs to finish 15 buildings per hour to complete the city on time. If Alex builds 7 skyscrapers, 9 houses, and 4 apartments, how many hours will it take for him to com...
def solve() -> int: skyscraper_blocks = 10 house_blocks = 6 apartment_blocks = 8 buildings_per_hour = 15 num_skyscrapers = 7 num_houses = 9 num_apartments = 4 total_blocks = num_skyscrapers * skyscraper_blocks + num_houses * house_blocks + num_apartments * apartment_blocks...
Henry earns $10 per hour at his job. He worked 7 days this week and for 4 hours each day. How much money did he earn?
def solve() -> int: hourly_rate = 10 days = 7 hours_worked = 4 total_earnings = hourly_rate * days * hours_worked result = total_earnings return result
A machine can produce 25 items per hour. If it operates for 5 hours, how many items will it produce?
def solve() -> int: production_rate = 25 hours_of_operation = 5 total_items_produced = production_rate * hours_of_operation result = total_items_produced return result
``` Bryn's weekly salary is $500. She saves 35% of her salary and spends 20% on gas and groceries. How much money does Bryn have left after saving and spending?
def solve() -> int: salary = 500 savings = salary * 0.35 spending = salary * 0.20 remaining = salary - savings - spending result = remaining return result
Emily is a graphic designer and charges $50 per design for social media and $100 per design for website. If she designed 3 social media graphics last Monday, 2 website designs last Tuesday, 4 website designs on Wednesday, and 1 social media graphic last Thursday, how much did she earn in total?
def solve() -> int: social_media_designs = 3 website_designs_tuesday = 2 website_designs_wednesday = 4 social_media_designs_thursday = 1 social_media_earnings = social_media_designs * 50 website_earnings_tuesday = website_designs_tuesday * 100 website_earnings_wednesday = website_design...
A box contains 80 pencils and 20 pens. What percentage of the box's contents are pencils?
def solve() -> int: total_items = 80 + 20 percentage = (80 / total_items) * 100 result = percentage return result
A runner runs at an average speed of 8 miles per hour for 4.5 hours. How far do they run?
def solve() -> int: speed = 8 time = 4.5 distance = speed*time result = distance return result
A doctor prescribes a patient to take 2 pills every 4 hours. If the patient started taking the pills at 6am, how many pills will he have taken by 6pm?
def solve() -> int: pills_per_hour = 2 hours = 12 pills_taken = pills_per_hour * hours result = pills_taken return result
A plane can fly 4500 km without refueling. If it has flown 2500 km and then refueled for 3500 liters, how many kilometers can it fly now?
def solve() -> int: range = 4500 distance_flown1 = 2500 refueled = 3500 distance_flown2 = range - distance_flown1 fuel_consumed = refueled - distance_flown2 new_range = range - fuel_consumed result = new_range return result
A store sells 200 phones. If 60% of them are iPhones and each iPhone costs $900 while each Samsung costs $600, what is the total revenue of the store?
def solve() -> int: iphones = 200*0.6 samsungs = 200 - iphones revenue = iphones*900 + samsungs*600 result = revenue return result
A runner completes a 10-mile race in 1 hour and 30 minutes. What was the runner's average speed in miles per hour?
def solve() -> int: time_in_minutes = 90 time_in_hours = time_in_minutes / 60 distance = 10 average_speed = distance / time_in_hours result = average_speed return result
Student: Sarah can bench press 75% as much as she deadlifts. She was able to deadlift 200 pounds last week, but her trainer increased that by 20%. If she can bench press three reps of 85% of her deadlift, what weight will she be bench pressing?
def solve() -> int: deadlift = 200 increase = 0.2 bench_percent = 0.75 bench_reps = 3 deadlift_new = deadlift * (1 + increase) bench_weight = deadlift_new * bench_percent * 0.85 total_weight = bench_weight * bench_reps result = total_weight return result
Ethan purchases bags of popcorn for $3.50 each. Each bag weighs 10 ounces. He eats 30 ounces of popcorn every 3 days. How much does Ethan spend on popcorn per week?
def solve() -> int: popcorn_price = 3.50 bag_weight = 10 popcorn_consumed = 30 popcorn_per_week = (popcorn_consumed / 3) * 7 bags_per_week = popcorn_per_week / bag_weight total_spent = bags_per_week * popcorn_price result = total_spent return result
Jeremy had $18 and spent 4/5 of it on apples. Then he spent some money on cherries and had only $9 left. How much did he spend on cherries?
def solve() -> int: first_amount = 18 percentage = 4 / 5 first_item_amount = first_amount * percentage second_item_amount = first_amount - first_item_amount result = second_item_amount return result
Student: Jake sells lemonade at the park. He makes 12 cups of lemonade and sells them for 50 cents each. He spends 20 cents on each cup of lemonade. How much profit does he make?
def solve() -> int: cost = 12 * 20 revenue = 12 * 50 profit = revenue - cost result = profit return result
Rachel wants to buy some new clothes for the fall. She needs to purchase two sweaters for $50 each, a pair of jeans for $70, and a scarf for $25. If she has a 15% discount on all items, how much will Rachel spend?
def solve() -> int: sweater_cost = 50 * 2 jeans_cost = 70 scarf_cost = 25 discount_rate = 0.15 total_cost = sweater_cost + jeans_cost + scarf_cost discounted_cost = total_cost - (total_cost * discount_rate) result = discounted_cost return result
Q6: Marcus put $100 into his saving account three years ago. If the interest rate is 3% per year, how much money will Marcus have in his saving account now?
def solve() -> int: initial_balance = 100 rate = 0.03 num_years = 3 amount = initial_balance * (1 + rate) ** num_years result = amount return result
Olivia and Ethan each received $1,000 to invest. Olivia invested her money in the stock market and doubled her investment. Ethan invested in a startup and earned 20 times the amount he invested. How much more money does Ethan have now than Olivia?
def solve() -> int: olivia_investment = 1000 ethan_investment = 1000 olivia_investment *= 2 ethan_investment *= 20 difference = ethan_investment - olivia_investment result = difference return result
A grocery store has 1000 peaches in stock. On average, 10% of the peaches go bad each day. If the store wants to sell all the peaches in 5 days, how many peaches should they sell each day?
def solve() -> int: daily_peaches = 0.9 * 1000 / 5 result = daily_peaches return result
How much money does a car dealership earn in a week if they sell 8 SUVs at $20,000 each, 5 sedans at $15,000 each, and 3 trucks at $25,000 each, per day?
def solve() -> int: suv_cost = 20000 sedan_cost = 15000 trucks_cost = 25000 suv_number = 8 sedan_number = 5 trucks_number = 3 daily_earning = suv_cost * suv_number + sedan_cost * sedan_number + trucks_cost * trucks_number weekly_earning = daily_earning * 7 result = weekly_earning ...
Student: Kiara bought 15 packets of candy for a party, each containing 12 pieces of candy. She gave away 4 packets to her friends and then divided the remaining candy equally among the 9 guests at the party. How many pieces of candy did each guest get?
def solve() -> int: packets = 15 pieces_per_packet = 12 packets_given_away = 4 packets_remaining = packets - packets_given_away guests = 9 pieces_per_guest = (packets_remaining * pieces_per_packet) / guests result = pieces_per_guest return result
Ben is at the toy store and buys 2 cars for $1.50 each. He then buys 3 balls that cost $0.50 each. He spent 1/4 of the money he earned from selling lemonade. If he sells one cup of lemonade for $0.25, how many cups did he sell?
def solve() -> int: car_cost = 1.5 ball_cost = 0.5 lemonade_cost = 0.25 total_spent = 2 * car_cost + 3 * ball_cost fraction_spent = 1/4 total_earned = total_spent / fraction_spent cups_sold = total_earned / lemonade_cost result = cups_sold return result
Brian has a collection of 60 t-shirts, of which 20 are blue. If he randomly chooses 3 shirts to take with him on vacation, what is the probability that at least 2 of the shirts are blue?
def solve() -> int: total_tshirts = 60 blue_tshirts = 20 p_2_or_more_blue = ((blue_tshirts / total_tshirts) * ((blue_tshirts - 1) / (total_tshirts - 1)) * ((total_tshirts - blue_tshirts) / (total_tshirts - 2))) + ((blue_tshirts / total_tshirts) * ((total_tshirts - blue_tshirts) / (total_tshirts - 1)) * ((to...
Student: Han spends 20 minutes every day reading a book. He reads 5 pages per minute. The book has 240 pages. How many days does it take him to finish the book?
def solve() -> int: minutes_per_day = 20 pages_per_minute = 5 total_pages = 240 pages_per_day = minutes_per_day * pages_per_minute days = total_pages / pages_per_day result = days return result
A train travels 150 miles in 2 hours and 30 minutes. What is its average speed in miles per hour?
def solve() -> int: miles = 150 hours = 2.5 speed = miles / hours result = speed return result
Jaxon got 2 bags of chips and Jordan got 5 bags of chips. They want to divide it equally among their 7 other friends. How many bags of chips will each person get?
def solve() -> int: jaxon_bags = 2 jordan_bags = 5 total_bags = jaxon_bags + jordan_bags num_friends = 7 bags_per_person = total_bags / num_friends result = bags_per_person return result
A recipe calls for 2/3 cup of sugar to make 16 cupcakes. How much sugar is needed to make 20 cupcakes?
def solve() -> int: sugarpercupcake = 2/3 sugarfor16 = sugarpercupcake*16 sugarfor20 = sugarfor16*(20/16) result = sugarfor20 return result
A car travels at a speed of 50 km/h. If the distance to be travelled is 200 km, how long does it take to reach the destination?
def solve() -> int: distance = 200 speed = 50 time = distance/speed result = time return result
Madison and Ethan were both born on March 11th, but in different years. To support each other's interests, they founded a charity together when Madison turned 30. If today they've been running the charity for 5 years and the total donations they've received is exactly 5 times what Ethan's initial donation was, how much...
def solve() -> int: madison_birthday = "March 11" ethan_birthday = "March 11" years_running_charity = 5 madison_age_founded_charity = 30 + years_running_charity ethan_age_founded_charity = madison_age_founded_charity ethan_initial_donation = (1/5) * (madison_age_founded_charity - ...
John has 3 times as many marbles as Peter, and Peter has 10 marbles. How many marbles does John have?
def solve() -> int: peter_marbles = 10 john_marbles = 3 * peter_marbles result = john_marbles return result
A science lab has 30 test tubes, and 12 of them contain a particular solution. If heating a test tube will make its contents react only if it has the solution, and two rounds of heating are needed for test tubes without the solution, how many test tubes that don't contain the solution were tested if they heated a total...
def solve() -> int: total_test_tubes = 30 test_tubes_with_solution = 12 test_tubes_without_solution = total_test_tubes - test_tubes_with_solution heating_rounds_with_solution = 1 heating_rounds_without_solution = 2 total_heating_rounds = 44 tested_test_tubes_with_solution = to...