question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Student: A store sells apples for 2 dollars each and oranges for 3 dollars each. If Mary buys 3 apples and 2 oranges, how much money will she spend?
def solve() -> int: apples = 3 oranges = 2 cost_apples = apples * 2 cost_oranges = oranges * 3 total_cost = cost_apples + cost_oranges result = total_cost return result
If a pizza has 16 slices in total, and there are 5 more meat slices than cheese slices, how many cheese slices are there?
def solve() -> int: total_slices = 16 meat_slices = (total_slices - 5) / 2 cheese_slices = total_slices - meat_slices result = cheese_slices return result
Student: Mr. Aries has two identical 6-story buildings. The first floor has 5 apartment units while the rest of the floors have 8 apartment units on each floor. How many apartment units does Mr. Aries have in all?
def solve() -> int: num_buildings = 2 num_floors = 6 num_units_first_floor = 5 num_units_other_floors = 8 total_units = num_buildings * (num_units_first_floor + (num_floors - 1) * num_units_other_floors) result = total_units return result
6. Gavin scored 90 objectives in 4 football games, calculate the total number of objectives he scored.
def solve() -> int: a = 90 total_goals = a result = total_goals return result
arah has to buy paint to cover a wall that is 12 feet by 14 feet. One gallon of paint can cover 400 square feet. How many gallons of paint does she need to buy?
def solve() -> int: wall_width = 12 wall_height = 14 wall_area = wall_width * wall_height paint_coverage = 400 gallons_of_paint = wall_area / paint_coverage result = gallons_of_paint return result
A store has a sale where everything is 25% off. If an item originally costs $40, what is the sale price?
def solve() -> int: original_price = 40 discount = 0.25 sale_price = original_price - (original_price * discount) result = sale_price return result
am collects five marbles every day from his classmates. He already has 20 marbles in his jar. How many marbles will he have after 12 days?
def solve() -> int: marbles_per_day = 5 initial_marbles = 20 days = 12 total_marbles = initial_marbles + marbles_per_day * days result = total_marbles return result
Bob is traveling 450 miles for work. He has driven 150 miles so far and will drive another 200 miles tomorrow. How many more miles does he have to travel to reach his destination?
def solve() -> int: distance_to_travel = 450 - 150 - 200 result = distance_to_travel return result
Emily and David took a taxi ride that cost $40. The taxi driver gave Emily a 20% discount and David a 10% discount. What was the total cost of the ride after the discounts were applied?
def solve() -> int: emily_discount = 0.2 * 40 david_discount = 0.1 * 40 total_cost = 40 - emily_discount - david_discount result = total_cost return result
Jerry has a bag of terracotta and a bag of marble chips. The terracotta chips make up 60% of the total weight and the marble chips make up 40%. If Jerry has a total of 4.8 kilograms of chips, how much do the marble chips weigh?
def solve() -> int: total_weight = 4.8 terracotta_percentage = 0.6 terracotta_weight = total_weight * terracotta_percentage marble_weight = total_weight - terracotta_weight result = marble_weight return result
Samuel's property tax rate is 3.5%. He has a house worth $250,000. A new mall will be constructed near his house, which is anticipated to raise his house's value by 10%. What is the maximum increase in house value that Samuel can afford before his tax bill surpasses $10,000?
def solve() -> int: tax_rate = 0.035 house_value = 250000 anticipated_increase = 0.1 max_increase = 0 current_tax_bill = tax_rate * house_value while current_tax_bill <= 10000: max_increase += 1 new_house_value = house_value * (1 + anticipated_increase * max_increase) ...
Ben bought a box of 12 cupcakes for his birthday party. He paid $18 for the box, but he got a 15% discount because he was a regular customer. He also got a free cupcake as a birthday gift. How much did each cupcake cost Ben after the discount and the gift?
def solve() -> int: price_after_discount = 18 * (1 - 0.15) cupcakes_paid = 12 - 1 cost_per_cupcake = price_after_discount / cupcakes_paid result = cost_per_cupcake return result
In a library, there are 500 books. Every day, 20 more books are added to the collection. How many books will be in the library after a month?
def solve() -> int: books_in_library = 500 books_added_per_day = 20 days_in_month = 30 total_books_added = books_added_per_day * days_in_month total_books_in_library = books_in_library + total_books_added result = total_books_in_library return result
Jack eats 3 apples every day for the next 2 months. Assuming he doesn't miss a day, how many apples will he have eaten?
def solve() -> int: days_in_a_month = 30 apples_per_day = 3 months = 2 total_days = days_in_a_month * months total_apples = apples_per_day * total_days result = total_apples return result
A person wants to divide 100 dollars among three people so that the first person gets 30% more than the second person, and the second person gets 20% more than the third person. How much money should each person get?
def solve() -> int: total_money = 100 num_people = 3 third_share = total_money / (1 + 0.2 + 0.2*1.3) second_share = third_share * 1.2 first_share = second_share * 1.3 each_person_gets = [first_share, second_share, third_share] result = each_person_gets return result
In a grocery store, 50% of the apples are green, and 10% are of the yellow variety. Unfortunately, an alarming 35% of the green apples and 80% of yellow apples have worms. If a customer picks a random apple, what are the chances that the fruit will have worms?
def solve() -> int: total_apples = 100 green_apples = 50 yellow_apples = 10 green_wormy = 0.35 * green_apples yellow_wormy = 0.80 * yellow_apples total_wormy = green_wormy + yellow_wormy probability_wormy = total_wormy / total_apples result = probability_wormy ret...
A pack of 20 batteries is divided among remote-controlled cars. If 5 of the cars get 2 batteries each and the rest of the cars get 3 batteries each, how many cars are there in total?
def solve() -> int: two_battery_cars = 5 batteries = 20 batteries_for_two_battery_cars = two_battery_cars * 2 remaining_batteries = batteries - batteries_for_two_battery_cars three_battery_cars = remaining_batteries // 3 total_cars = two_battery_cars + three_battery_cars result = total_cars ...
Tyler wanted to buy 3 notebooks and the store was selling them for $4 each. If he wanted to use $14 to buy them, how much change did he get?
def solve() -> int: notebooks = 3 price = 4 money = 14 change = money - notebooks * price result = change return result
In 19 years, Sarah will be three times the age that Jack is currently. If Jack is currently 13 years old, how old is Sarah now?
def solve() -> int: Jack_current_age = 13 Sarah_age_in_19_years = Jack_current_age * 3 Sarah_current_age = Sarah_age_in_19_years - 19 result = Sarah_current_age return result
At an auction for an antique chair, the starting bid is $500. James is the first to bid as he adds $350 to the starting value, another person doubles James' bid, and a third one adds $400 to the second bid. At last, James bids $4,500. By how much did James's final bid exceed that of the third bidder?
def solve() -> int: starting_bid = 500 james_bid = starting_bid + 350 second_bidder = james_bid * 2 third_bidder = second_bidder + 400 james_final_bid = 4500 result = james_final_bid - third_bidder result return result
Maria has a watermelon that is 16 inches in diameter. She plans to cut the watermelon into quarters and sell 1 quarter. How many inches of watermelon will she have sold?
def solve() -> int: diameter = 16 radius = diameter / 2 area = 3.14 * radius ** 2 quarter_area = area / 4 sold_area = quarter_area sold_inches = sold_area * 4 result = sold_inches return result
Sarah, Lisa, and Ashley played chess against one another. Sarah won 4 more games than Lisa, and Lisa won 2 more games than Ashley. If Ashley won 6 games, what was the total number of games they played?
def solve() -> int: ashley_wins = 6 lisa_wins = ashley_wins + 2 sarah_wins = lisa_wins + 4 total_games = ashley_wins + lisa_wins + sarah_wins result = total_games return result
Roger bought a pair of skis for $800 but sold it for only 50% of that price. He aims to buy a new pair of skis costing $1,200. How much cheaper is the new pair compared to the original one?
def solve() -> int: original_price = 800 selling_price = original_price * 0.5 new_price = 1200 cheaper_amount = original_price - new_price result = cheaper_amount return result
If Lucy is 7 years younger than twice the age of her brother, who is 4 years older than her cousin, who is 14 years old, how old is Lucy?
def solve() -> int: cousin_age = 14 brother_age = cousin_age + 4 lucy_age = 2 * brother_age - 7 result = lucy_age return result
Ruth cut a triangle of area 200 square inches into four equal parts. What is the area of each part?
def solve() -> int: totalArea = 200 numOfParts = 4 eachPart = totalArea / numOfParts result = eachPart return result
Student: Jessica is baking cupcakes. She needs to make 60 cupcakes. The recipe states that she needs 2/3 cup of sugar for each cupcake. How much sugar does Jessica need?
def solve() -> int: num_cupcakes = 60 sugar_per_cupcake = 2/3 total_sugar = num_cupcakes * sugar_per_cupcake result = total_sugar return result
Michael wants to buy a car. The car costs \$20,000, with a sales tax of 10%. If the dealer charges an additional fee of \$200 to transfer ownership, what is the total cost of the car, including sales tax and the transfer fee?
def solve() -> int: car_cost = 20000 sales_tax = 0.1 transfer_fee = 200 total_cost = car_cost * (1 + sales_tax) + transfer_fee result = total_cost return result
If John can paint a room in 3 hours and Jane can paint the same room in 4 hours, how long will it take if they work together to paint the room?
def solve() -> int: result = 1/(1/3+1/4) * 60 return result
A pizza is divided into 10 slices. If 3 people each eat 2 slices, how many slices are left?
def solve() -> int: total_slices = 10 people = 3 slices_eaten = 2 * people slices_left = total_slices - slices_eaten result = slices_left return result
Joe has a collection of coins. He had five coins yesterday, and today, he has four times as many coins as yesterday. How many coins does he have today?
def solve() -> int: total_coins = 5 coins_today = 4 * total_coins result = coins_today return result
The sum of two numbers is 40. If one number is twice the other number, what are the numbers?
def solve() -> int: total = 40 ratio = 2 num2 = total / (ratio + 1) num1 = ratio * num2 result = num1 + num2 return result
hane works as a barista and earns $7/hr. He was scheduled to work 4 5-hour shifts and makes an average of $2/hr in tips. His tax rate is 25%. How much does Shane pay in taxes this week?
def solve() -> int: hours_worked = 20 rate = 7 tips = 2 tax_rate = 25 income = (hours_worked * rate) + (hours_worked * tips) taxes = income * (tax_rate/100) result = taxes return result
Lily wants to knit a scarf that is 60 inches long. Each inch of yarn is 1/8 of a yard. How many total yards of yarn does she need to complete the project?
def solve() -> int: length_in_inches = 60 length_in_yards = length_in_inches * (1/8) result = length_in_yards return result
Student: At the grocery store, Susan bought 5 apples and 7 oranges. Apples cost $0.5 each and oranges cost $2.5 each. How much money did she spend in total?
def solve() -> int: apples = 5 oranges = 7 apple_price = 0.5 orange_price = 2.5 apple_cost = apples * apple_price orange_cost = oranges * orange_price total_cost = apple_cost + orange_cost result = total_cost return result
Sarah went to a bookstore where she spent one-fifth of her money, and then spent $8 more. She then went to a coffee shop where she spent one-half of her starting money, and then spent $12 more. If she then had no money left, how much did she have when she entered the bookstore?
def solve() -> int: money = 0 bookstore_spending = 0 coffee_shop_spending = 0 bookstore_spending = money / 5 + 8 remaining_money = money - bookstore_spending coffee_shop_spending = remaining_money / 2 + 12 remaining_money -= coffee_shop_spending initial_money = r...
Larry sells flowers online. He has 1000 different types of flowers. He sold 25% of his flowers in the first week and sold another 40% of the remaining flowers in the second week. How many flowers did he have left at the end of the second week?
def solve() -> int: num_flowers = 1000 sale_percentage1 = 0.25 sale_percentage2 = 0.4 sold_in_week1 = num_flowers * sale_percentage1 remaining1 = num_flowers - sold_in_week1 sold_in_week2 = remaining1 * sale_percentage2 remaining2 = remaining1 - sold_in_week2 result = remaining2 retu...
There are 250 headphones to be sold at an electronics store. Jack sold six times as many headphones as Lily while Kate sold 10 more than half the number of headphones Lily sold. If Lily sold 30 headphones, how many headphones need to be sold?
def solve() -> int: lily = 30 jack = 6 * lily kate = 10 + 0.5 * lily total = lily + jack + kate left = 250 - total result = left return result
A farmer has 36 chickens and 24 ducks. He feeds each chicken 0.2 kilograms of grain per day, and each duck 0.3 kilograms of grain per day. He buys a bag of grain that weighs 25 kilograms. How many days will the bag of grain last?
def solve() -> int: chicken_grain = 36 * 0.2 duck_grain = 24 * 0.3 total_grain = chicken_grain + duck_grain days = 25 / total_grain result = days return result
A car travels 80 kilometers per hour. How far will it travel in 4 hours and 30 minutes?
def solve() -> int: speed = 80 time_in_hours = 4.5 distance = speed*time_in_hours result = distance return result
A water tank is being filled at a rate of 15 liters per minute. If the tank can hold 1200 liters of water, how long will it take to fill the tank completely?
def solve() -> int: fill_rate = 15 tank_capacity = 1200 time = tank_capacity / fill_rate result = time return result
Kevin grows 9 plants in his garden. He also grows plants for 4 other people, each of them receiving the same amount. For each plant, Kevin needs 2 bags of soil. Moreover, he needs 1 pack of fertilizer for each batch of plants. If Kevin uses a total of 36 bags of soil and packs of fertilizer, how many plants are there i...
def solve() -> int: plants_in_kevins_garden = 9 total_bags_of_soil_and_fertilizer = 36 plants_in_other_gardens = (total_bags_of_soil_and_fertilizer - (plants_in_kevins_garden * 2)) / 2 result = plants_in_other_gardens return result
Student: Peter has $1000 in the bank and just received a check of $5000. He plans to put the money into a 4.5% interest account once he deposits the check. How much interest will he earn if he leaves the money in the account for 2 years?
def solve() -> int: initial_amount = 1000 check_amount = 5000 interest_rate = 0.045 time_period = 2 total_amount = initial_amount + check_amount interest_earned = total_amount * interest_rate * time_period final_amount = total_amount + interest_earned result = interest_earned return...
Henry earns $15 per hour. He worked 8 hours last Monday and 6 hours the following Tuesday. If he paid 20% tax, how much money did he make after tax?
def solve() -> int: hourly_wage = 15 hours_monday = 8 hours_tuesday = 6 total_hours = hours_monday + hours_tuesday income = hourly_wage * total_hours tax_rate = 0.2 income_after_tax = income * (1 - tax_rate) result = income_after_tax return result
A shop sells shirts for $25 each, but there is a 20% discount if you buy 5 or more shirts. If John wants to buy 7 shirts, how much will he spend in total?
def solve() -> int: quantity = 7 price = 25 discounted_price = price * 0.8 if quantity >= 5: total_cost = discounted_price * quantity else: total_cost = price * quantity result = total_cost return result
5. Johnny has 96 erasers, giving away 1/3 of them. How many erasers had Johnny originally?
def solve() -> int: give_away = 96 * 0.33 erasers = 96 + give_away result = erasers return result
A recipe calls for 1/2 cup of sugar to make 12 muffins. If you want to make 36 muffins, how much sugar do you need?
def solve() -> int: sugar_per_muffin = 1/24 num_muffins = 36 total_sugar = sugar_per_muffin * num_muffins result = total_sugar return result
Jenny regularly goes to the 3rd floor of a mall. She walks up and down the stairs twice a day, 7 days a week. The height of each story is 11 feet, how much distance has she covered over the week?
def solve() -> int: height_of_story = 11 stories_covered_per_day = 2 days_in_week = 7 distance_covered_per_day = height_of_story * stories_covered_per_day distance_covered_per_week = distance_covered_per_day * days_in_week result = distance_covered_per_week return result
Isabel has a blueberry bush with 30 branches and 100 blueberries per branch. 60% of the blueberries are ripe and the rest are unripe. If each ripe blueberry weighs 2g and each unripe blueberry weighs 1g, how many grams of blueberries are on the bush in total?
def solve() -> int: branches = 30 blueberries_per_branch = 100 ripe_percentage = 0.6 ripe_weight = 2 unripe_weight = 1 total_ripe_blueberries = branches * blueberries_per_branch * ripe_percentage total_unripe_blueberries = branches * blueberries_per_branch * (1 - ripe_percentage) ...
A rectangular garden is 20 meters long and 15 meters wide. If you want to put a fence around the garden and you have to paint it, and the cost of paint is $3 per square meter and the cost of fencing is $6 per meter, how much will it cost?
def solve() -> int: length = 20 width = 15 area = length * width fencing_cost = 6 * (length + width) paint_cost = area * 3 total_cost = fencing_cost + paint_cost result = total_cost return result
Jerry uses 3 cans of spray paint to cover a 10 square foot surface. Each can of spray paint costs $5. How much does he spend on spray paint in a week if he covers a 60 square foot surface every day from Monday to Friday?
def solve() -> int: cans_per_sqft = 3/10 surface_area = 60 * 5 total_cans = surface_area * cans_per_sqft total_cost = total_cans * 5 result = total_cost return result
Emily has missed her water bill payment for three months, but luckily the water company won't charge late fees. She will use 4/9th of her salary after taxes to pay the overdue bill. If she gets paid $7000 per month and is taxed 15%, how much is her water bill?
def solve() -> int: salary = 7000 tax_rate = 0.15 salary_after_tax = salary * (1 - tax_rate) bill_percentage = 4/9 bill_amount = salary_after_tax * bill_percentage result = bill_amount * 3 return result
David makes 300 dollars a week doing freelance work. He saves half of his money, but he also spends 20 dollars every week on lunch and 50 dollars every month on books. How much money will David have in his savings account after 6 months?
def solve() -> int: weekly_salary = 300 weekly_lunch_cost = 20 monthly_books_cost = 50 total_expenses = weekly_lunch_cost*24 + monthly_books_cost*6 total_savings = weekly_salary/2*24 left_amount = total_savings - total_expenses result = left_amount return result
Sarah and her cousins have a BBQ party. Sarah has 50 hot dogs, and her cousins have one-third of the hot dogs as Sarah. If Sarah's cousins grill two-fifths of their hot dogs, and Sarah grills three-fourths of her hot dogs, how many hot dogs did they grill in total?
def solve() -> int: sarah_hotdogs = 50 cousins_hotdogs = sarah_hotdogs / 3 sarah_grilled = sarah_hotdogs * 3 / 4 cousins_grilled = cousins_hotdogs * 2 / 5 total_grilled = sarah_grilled + cousins_grilled result = total_grilled return result
John bought 2 shirts at $25 each and 6 pairs of pants at $30 each from a clothing store to resell at a profit. However, when he sold the items, the selling price of a shirt was 15% less and the selling price of a pair of pants was 10% less. Calculate the total profit John made from the sale of the items.
def solve() -> int: shirt_cost = 25 pants_cost = 30 num_shirts = 2 num_pants = 6 selling_price_shirt = shirt_cost * 0.85 selling_price_pants = pants_cost * 0.9 total_cost = (shirt_cost * num_shirts) + (pants_cost * num_pants) total_selling_price = (selling_price_shirt * num_shirts) + (se...
In a math class of 30 students, 70% of them passed their exam. How many students passed the exam?
def solve() -> int: total_students = 30 pass_percentage = 0.7 students_passed = total_students * pass_percentage result = students_passed return result
A bookstore has 200 copies of a book. They sell 75% of these books. How many books do they still have in stock after selling 75% of the books?
def solve() -> int: total_books = 200 percentage_sold = 75 books_sold = (percentage_sold/100)*total_books books_left = total_books - books_sold result = books_left return result
Grace has 25 stickers. On Mondays, Tuesdays, and Thursdays, she gives away 3 stickers, and on the other days of the week, she gives away 1 sticker. How long will it take for Grace to give away all of her stickers?
def solve() -> int: total_stickers = 25 special_days = 3 regular_days = 1 days = (total_stickers - (special_days * 3)) / regular_days result = days return result
If a train takes 3 hours to travel 150 miles, what is the average speed of the train in miles per hour?
def solve() -> int: time = 3 distance = 150 speed = distance / time result = speed return result
In a class of 50 students, the ratio of girls to boys is 3:2. If 10% of the girls and 20% of the boys were absent on a particular day, how many students were present in the class?
def solve() -> int: total_students = 50 girls_ratio = 3 boys_ratio = 2 total_ratio = girls_ratio + boys_ratio x = total_students / total_ratio num_girls = girls_ratio * x num_boys = boys_ratio * x present_students = total_students - 0.1*num_girls - 0.2*num_boys result = present_stude...
A box contains 24 red balls, 36 blue balls, and 60 green balls. If one ball is randomly selected from the box, what is the probability that it is not green?
def solve() -> int: total_balls = 24 + 36 + 60 green_balls = 60 non_green_balls = total_balls - green_balls probability = non_green_balls / total_balls result = probability return result
Mr. Lee has a bag of apples with enough apples for 15 days. After half of the time, he has 21 apples left. How many apples is Mr. Lee supposed to eat per day if he eats the same number daily?
def solve() -> int: days = 15 apples_left = 21 initial_apples = apples_left * 2 apples_per_day = initial_apples / days result = apples_per_day return result
Mark and his family have a coupon for 40% off their lunch bill at a certain restaurant. Their bill before applying the coupon was $90. How much money did they save with the coupon?
def solve() -> int: cost_without_discount = 90 discount = 0.4 * 90 cost_with_discount = cost_without_discount - discount money_saved = cost_without_discount - cost_with_discount result = money_saved return result
Student: Michael sold a jar of 20 marbles for $5. He sold twice as many green marbles as blue marbles and three times as many yellow marbles as each of the other two colors. How much did Michael make from his sales of yellow marbles?
def solve() -> int: num_marbles = 20 price_per_marble = 5 num_green_marbles = 2 * num_marbles / 5 num_blue_marbles = num_marbles / 5 num_yellow_marbles = 3 * num_marbles / 5 amount_made_yellow_marbles = num_yellow_marbles * price_per_marble result = amount_made_yellow_marbles return res...
In a group of 50 people, 30% have a cat, 20% have a dog, and 10% have both. How many people in the group have a cat or a dog?
def solve() -> int: num_people = 50 percent_cat = 0.3 percent_dog = 0.2 percent_both = 0.1 percent_either = percent_cat + percent_dog - percent_both num_either = percent_either*num_people result = num_either return result
At the bowling alley, adults can rent shoes for $5 and children can rent shoes for $3 each. If Mr. Cruz spent $20 in total and bought 2 more pairs of shoes for adults than for children, how many adults and how many children went bowling?
def solve() -> int: cost_adult = 5 cost_children = 3 adults = 0 children = 0 spent = 20 for a in range(spent // cost_adult + 1): children = a - 2 total_cost = a * cost_adult + children * cost_children if total_cost == spent: adults = a break result...
A jar contains a mixture of milk and water in the ratio 5:2. If the total volume of the mixture is 21 litres, what is the volume of milk in the mixture?
def solve() -> int: milk_ratio = 5 water_ratio = 2 mixture_vol = 21 total_ratio = milk_ratio + water_ratio milk_vol = (milk_ratio/total_ratio) * mixture_vol result = milk_vol return result
A circular pond has a radius of 10 meters. What is the area of the pond?
def solve() -> int: radius = 10 pi = 3.14159 area = pi * radius ** 2 result = area return result
Student: Tina earns $76 an hour and $105 for every hour of overtime. She worked 10 hours last week, calculate her total income.
def solve() -> int: regular_hours = 10 overtime_hours = 0 regular_pay = regular_hours * 76 overtime_pay = overtime_hours * 105 total_pay = regular_pay + overtime_pay result = total_pay return result
At the local farmer's market, Sandrine buys some vegetables. On the first day she buys a total of 5 vegetables. For the following three days, she buys four times as many vegetables as the day before. How many vegetables does she buy in total during those four days?
def solve() -> int: total_veggies = 5 for i in range (0, 3): total_veggies = total_veggies + (4 * total_veggies) result = total_veggies return result
A company pays its employees a monthly fixed salary of $4000. In addition, employees receive a bonus based on their performance as follows: good performance, 20% of fixed salary, average performance, 10% of fixed salary, and poor performance, 5% of fixed salary. If John's performance is good, what is his total salary f...
def solve() -> int: fixed_salary = 4000 performance_bonus = 0.20 total_salary = fixed_salary + (fixed_salary * performance_bonus) result = total_salary return result
``` In a jar of 80 candies, there are 15 yellow candies, 20 green candies, 25 red candies, and 20 blue candies. If Mark only likes red candies, how many candies will he eat to finish all the red candies?
def solve() -> int: red_candies = 25 result = red_candies return result
Lisa is baking cookies for a fundraiser. She can make 24 cookies from one batch of dough. She has 5 cups of flour and each batch of dough requires 1.5 cups of flour. How many cookies can she make in total?
def solve() -> int: flour_available = 5 flour_required = 1.5 batches_possible = flour_available / flour_required cookies_per_batch = 24 total_cookies = batches_possible * cookies_per_batch result = total_cookies return result
If Emma reads 20 pages of a book every night and forgets half of what she read the next day, how many pages does she need to read to always remember one more page than she started with after forgetting and growing her knowledge?
def solve() -> int: pages_read_per_night = 20 pages_forgotten_per_day = pages_read_per_night / 2 pages_remembered_per_day = pages_read_per_night - pages_forgotten_per_day pages_needed_to_remember_one_more = pages_remembered_per_day + 1 result = pages_needed_to_remember_one_more return resul...
Student: Linda has 8 bags of candy. There are 5 candies in each bag. She decides to keep 6 candies for herself and distribute the rest equally amongst her 4 friends. How many candies will each friend receive?
def solve() -> int: bags_of_candy = 8 candies_per_bag = 5 total_candies = bags_of_candy * candies_per_bag candies_kept = 6 candies_distributed = total_candies - candies_kept friends = 4 candies_per_friend = candies_distributed // friends result = candies_per_friend return result
7. Joshua bought a new laptop for $900. If he bought it with a 10% discount, how much did he actually pay?
def solve() -> int: original_price = 900 discount_rate = 0.1 discounted_price = original_price*(1-discount_rate) result = discounted_price return result
Student: If 2x = 5y and y = 3, what is the value of x?
def solve() -> int: x = None y = 3 x = 15 / 2 result = x return result
Max spent 1/3 of his birthday money on candy. He earned an additional 15 dollars for doing chores. If he ended up with 50 dollars, how much money did he receive for his birthday?
def solve() -> int: candy_money = 50 * 1/3 total_money = candy_money + 15 birthday_money = total_money - 50 result = birthday_money return result
Clara sells lemonade at a fair. She buys a 6-liter bottle of lemonade concentrate for $18 and mixes it with 9 liters of water. She sells each cup of lemonade for $1.5. She pays $10 for the booth rental and $5 for the cups. How much profit does she make if she sells all the lemonade?
def solve() -> int: total_volume = 6 + 9 number_of_cups = total_volume * 1000 / 250 total_revenue = number_of_cups * 1.5 total_cost = 18 + 10 + 5 profit = total_revenue - total_cost result = profit return result
Patrick earns $21 for each hour that he works. He then has to pay 18% for taxes and fees. After working 72 hours, Patrick receives his paycheck. If he spends 12% of his paycheck on a movie ticket, how much, in dollars, does he have left?
def solve() -> int: money_earned = 21 * 72 taxes_fees = money_earned * 0.18 net_earnings = money_earned - taxes_fees money_spent_on_movie_ticket = net_earnings * 0.12 money_left = net_earnings - money_spent_on_movie_ticket result = money_left return result
Sally is going to the movies with 4 friends. The tickets are $12 each for adults and $8 each for kids. If Sally and two of her friends are adults and the other three friends are kids, how much will the tickets cost in total?
def solve() -> int: num_adults = 2 adult_price = 12 num_kids = 3 kid_price = 8 total_cost = (num_adults * adult_price) + (num_kids * kid_price) result = f'<<<{total_cost}>>>' result = total_cost return result
Chris has a bag of 20 candies, he wants to divide them equally among himself and 4 friends. How many candies will each person receive?
def solve() -> int: candies = 20 total_people = 5 candies_per_person = candies // total_people result = candies_per_person return result
Molly has 12 books. If she gives away 4 books, how many books does she have left?
def solve() -> int: books_owned = 12 books_given_away = 4 books_left = books_owned - books_given_away result = books_left return result
4. Rachel had some books. She put 7 books in each of three bags, and there were still 4 books left. How many books did Rachel have initially?
def solve() -> int: books_bags = 7 books_left = 4 books_total = (books_bags * 3) + books_left result = books_total return result
Ms. Patel bought 30 books for $20 each and 10 sets of pens for $5 each from a school supply store to resell at a profit. However, when she sold the items, the selling price of a book was 10% less and the selling price of a set of pens was 25% less. Calculate the total loss Ms. Patel made from the sale of the items.
def solve() -> int: books = 30 book_cost = 20 pens = 10 pen_cost = 5 total_cost = (books * book_cost) + (pens * pen_cost) book_sell_price = book_cost * 0.9 pen_sell_price = pen_cost * 0.75 total_sell_price = (books * book_sell_price) + (pens * pen_sell_price) tota...
A toy store has 123 action figures and 95 dolls. If they sell 20 action figures and 15 dolls, how many toys do they have left in their inventory?
def solve() -> int: action_figures = 123 dolls = 95 action_figures_sold = 20 dolls_sold = 15 action_figures -= action_figures_sold dolls -= dolls_sold inventory = action_figures + dolls result = inventory return result
Ella is planning a road trip with her friends. She has a budget of $800 for gas, food, and lodging. She estimates that she will drive 1200 miles and that her car consumes 25 miles per gallon of gas. She also estimates that she will spend $15 per day on food and $50 per night on lodging. How many days can she afford to ...
def solve() -> int: budget = 800 total_miles = 1200 miles_per_gallon = 25 gas_price = 3 food_price = 15 lodging_price = 50 day = 0 gas_cost = (total_miles / miles_per_gallon) * gas_price remaining_budget = budget - gas_cost while remaining_budget >= (food_price...
A bakery has 10 cans of whipped cream but only enough additional ingredients to make 5 batches of dessert. The recipe calls for 2 cans of whipped cream for every batch of dessert. How many more cans of whipped cream should the bakery order to make all 10 batches of dessert?
def solve() -> int: original_cans = 10 batches_needed = 10 ratio_whipped_cream = 2/1 original_whipped_cream = 5 * ratio_whipped_cream total_whipped_cream = batches_needed * ratio_whipped_cream result = total_whipped_cream - original_whipped_cream return result
Ms. Lee inherited a house valued at $90000. Four years later, she sold it for a 15% profit and paid a 4% broker's commission from the original price. How much did she receive from selling the house?
def solve() -> int: original_price = 90000 profit_percentage = 15 commission_percentage = 4 profit_amount = original_price * (profit_percentage / 100) selling_price = original_price + profit_amount commission_amount = original_price * (commission_percentage / 100) amount_...
Mark decided to raise funds for a local children's hospital by baking cakes. He baked 20 cakes and sold each slice for 75 cents. A local business owner pledged to donate 30 cents for each slice sold, while another pledged to donate 20 cents per slice sold. How much money would Mark have raised if he sold all the slices...
def solve() -> int: num_cakes = 20 slices_per_cake = 8 price_per_slice = 0.75 total_slices = num_cakes * slices_per_cake donation1 = total_slices * 0.30 donation2 = total_slices * 0.20 total_amount = (total_slices * price_per_slice) + donation1 + donation2 ...
A juice cart has 720 liters of juice. If 25% of the juice is sold on the first day, and 70% of the remaining juice is sold on the second day, how many liters of juice are left?
def solve() -> int: liters_sold_day1 = 720 * 25 / 100 liters_remaining_day1 = 720 - liters_sold_day1 liters_sold_day2 = liters_remaining_day1 * 70 / 100 liters_remaining_day2 = liters_remaining_day1 - liters_sold_day2 result = liters_remaining_day2 return result
Student: Michaela earns $500 per week. She saves 20% of her earnings and spends the rest equally on groceries and bills. How much does Michaela spend on groceries and bills in a week?
def solve() -> int: earnings = 500 savings = earnings * 0.2 remaining = earnings - savings spending = remaining / 2 result = spending return result
The ratio of hotdogs to buns that a vendor needs for his stand is 2:1. If he needs a total of 45 buns, how many hotdogs should he prepare?
def solve() -> int: hotdogs_to_buns_ratio = 2/1 total_buns = 45 hotdogs = (total_buns / (1 + hotdogs_to_buns_ratio)) * hotdogs_to_buns_ratio result = hotdogs return result
Student: Grandma made an apple pie with 7 pounds of apples. She needed 1 cup of sugar for the recipe. How many cups of sugar is 7 pounds of apples?
def solve() -> int: pound_of_apples = 2 cups_of_sugar = pound_of_apples * 7 result = cups_of_sugar return result
In a library, 48 shelves with a capacity of 20 books each were filled with books of different genres. The number of books in the library was 900, and some shelves had less than 20 books. If 2/3 of the shelves had 20 books, and the rest had either 15 or 18 books, calculate the number of shelves that had 15 books.
def solve() -> int: shelves = [0] * 48 books = 900 full_shelf = 48 * 2 // 3 for i in range(full_shelf): shelves[i] = 20 books -= 20 for i in range(full_shelf, 48): if books >= 18: shelves[i] = 18 books -= 18 else: shelves[i]...
- Ella is making bracelets for her friends. She's going to use 36 beads, three times as many charms, and 18 elastic cords to make the bracelets. How many bracelets can she make if each bracelet requires 6 beads, 2 charms, and 1 elastic cord?
def solve() -> int: beads = 36 charms = beads * 3 cords = 18 beads_per_bracelet = 6 charms_per_bracelet = 2 cords_per_bracelet = 1 bracelets_with_beads = beads // beads_per_bracelet bracelets_with_charms = charms // charms_per_bracelet bracelets_with_cords = cords // cords...
Sarah earns $700,000 per year. If she shares one-sixth of her salary equally among the 7 employees who make $35,000 per year, how much would her salary be if she wants to make sure all of her employees make $45,000 per year?
def solve() -> int: salary_per_year = 700000 num_employees = 7 shared_salary = salary_per_year / 6 new_salary_per_employee = 45000 new_salary_per_year = new_salary_per_employee * num_employees additional_salary = new_salary_per_year - shared_salary new_salary = salary_per_year + additional_s...
A train travels 60 miles per hour. How far will it travel in 2.5 hours?
def solve() -> int: speed = 60 time = 2.5 distance = speed * time result = distance return result
A box of pens weighs 3 ounces, and a box of pencils weighs 2 ounces. If you have 4 boxes of pens and 6 boxes of pencils, how many ounces does everything weigh in total?
def solve() -> int: pen_weight = 3 pencil_weight = 2 num_pens = 4 num_pencils = 6 total_weight = (pen_weight * num_pens) + (pencil_weight * num_pencils) result = total_weight return result
Student: Ryan works in a building that has 10 floors and a basement. His office is on the 8th floor, and he usually takes the elevator to get there. However, one day the elevator is out of order, so he has to use the stairs. He walks up from the basement to the 8th floor in the morning, then goes down to the basement f...
def solve() -> int: basement = 0 floor_8 = 8 floor_5 = 5 morning_stairs = floor_8 - basement lunch_stairs = basement - floor_8 afternoon_stairs = floor_8 - basement meeting_stairs = floor_5 - basement meeting_stairs_up = floor_8 - floor_5 total_stairs = morning_stairs + lunch_stairs ...
A driver travels 160 miles to reach her destination. If she drives at a speed of 60 miles per hour for the first half of the trip and 80 miles per hour for the second half of the trip, how long does the entire trip take, in hours?
def solve() -> int: total_distance = 160 first_half_distance = total_distance / 2 second_half_distance = total_distance / 2 first_half_speed = 60 second_half_speed = 80 first_half_time = first_half_distance / first_half_speed second_half_time = second_half_distance / second_half_speed to...