question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A company has 350 employees. If they recently hired 25 new employees and 15% of employees left the company, how many employees currently work there?
def solve() -> int: total_employees = 350 new_employees = 25 new_total = total_employees + new_employees left_percentage = 0.15 left_employees = left_percentage * total_employees current_total = new_total - left_employees result = current_total return result
Robert works part time and earns $80 daily. He invested 30% of his money for 2 months. How much did Robert earn in total during the 2 months period?
def solve() -> int: income = 80 investment_percentage = 30 total_days = 2 * 30 total_income = income * total_days investment_amount = total_income * (investment_percentage/100) money_earned = total_income - investment_amount result = money_earned return resul...
If 6 screws can hold 4 wooden planks together, 10 metal sheets or 15 plastic sheets, how many screws are needed to hold 60 wooden planks together, 50 metal sheets and 30 plastic sheets?
def solve() -> int: wooden_planks = 60 metal_sheets = 50 plastic_sheets = 30 screws_per_plank = 6 screws_per_metal_sheet = 10 screws_per_plastic_sheet = 15 total_screws = (wooden_planks * screws_per_plank) + (metal_sheets * screws_per_metal_sheet) + (plastic_sheets * screws_per_pla...
Bob has 16 pencils that he wants to divide into 3 piles. He wants his 3 piles to have a ratio of 2:1:1. How many pencils should each of the 3 piles have?
def solve() -> int: total_pencils = 16 pencils_per_pile = total_pencils / 3 ratio = 2 / 1 / 1 pencils_pile = pencils_per_pile / ratio result = pencils_pile return result
A rectangular field is 15 m long and 8 m wide. What is the area of the field in square meters?
def solve() -> int: length = 15 width = 8 area = length * width result = area return result
Student: Kevin is planning a road trip with his friends. He wants to visit three cities that are on a straight line. The first city is 50 miles from his home, the second city is 80 miles from the first city, and the third city is 120 miles from the second city. Kevin decides to drive from his home to the third city and...
def solve() -> int: home = 0 city1 = 50 city2 = city1 + 80 city3 = city2 + 120 total_distance = city3 + city1 result = total_distance return result
Student: There are 90 students in a classroom. If 2/3 of them are girls, how many boys are there?
def solve() -> int: total_students = 90 fraction_girls = 2/3 number_girls = total_students * fraction_girls number_boys = total_students - number_girls result = number_boys return result
**Some possible questions are:** A bakery sells two types of pies: apple and cherry. An apple pie costs $8 to make and sells for $12, while a cherry pie costs $10 to make and sells for $15. The bakery can make at most 30 pies a day, and sells all the pies it makes. How many more dollars will the bakery earn if it makes...
def solve() -> int: apple_cost = 8 apple_revenue = 12 cherry_cost = 10 cherry_revenue = 15 apple_profit = apple_revenue - apple_cost cherry_profit = cherry_revenue - cherry_cost scenario_1 = 15 * apple_profit + 15 * cherry_profit scenario_2 = 20 * apple_profit + 10 * cherry_profit di...
Student: A factory owner pays their workers $40 per hour. If a worker works 8 hours a day, how much money will they make in a week (5 days)?
def solve() -> int: hourly_wage = 40 hours_per_day = 8 days_in_week = 5 total_hours = hours_per_day * days_in_week result = hourly_wage * total_hours return result
A car travels 412 km in 4 hours. What is its average speed?
def solve() -> int: distance = 412 time = 4 speed = distance / time result = speed return result
Two buses leave at the same time and travel different routes. Bus A travels at a speed of 40 mph and Bus B travels at a speed of 50 mph. How far apart are they after 4 hours?
def solve() -> int: time = 4 dist_a = 40*time dist_b = 50*time dist_diff = dist_b - dist_a result = dist_diff return result
Two friends, Bob and Alice, decide to buy a pizza that costs 27 dollars. Bob has 10 dollars and Alice has 15 dollars. They agree to split the cost proportionally to their contribution. How much should Bob give to Alice?
def solve() -> int: dollars_bob = 10 dollars_alice = 15 total_cost = 27 bob_contribution = dollars_bob / (dollars_bob + dollars_alice) alice_contribution = dollars_alice / (dollars_bob + dollars_alice) bob_should_give = alice_contribution * total_cost - dollars_bob result = f'Bob should give...
Lucy spent $20 on a shirt that was on sale for 25% off. What was the original price of the shirt?
def solve() -> int: sale_price = 20 discount = 0.25 original_price = sale_price/(1-discount) result = original_price return result
A barbecue cookout is being planned for a group of 25 people. If 1 pound of meat serves 4 people, how many pounds of meat is needed?
def solve() -> int: pounds_per_person = 1/4 pounds_needed = 25 * pounds_per_person result = pounds_needed return result
A pack of batteries that normally costs $7 is now sold at a discount of 15%, while a flashlight is sold at a discount of $2. If David wants to buy 4 packs of batteries and 2 flashlights, how much will he save in total via the discounts?
def solve() -> int: battery_cost = 7 battery_discount = 0.15 flashlight_discount = 2 battery_savings = battery_cost * battery_discount * 4 flashlight_savings = flashlight_discount * 2 total_savings = battery_savings + flashlight_savings result = total_savings return result...
Ethan loves playing video games. He plays video games for 2 hours after school every Monday, Wednesday, and Friday. On Tuesday and Thursday, he plays video games for 1 hour and on Saturdays, he could play video games for 3 and a half hours. How many hours in total did he play video games over a 3 week period?
def solve() -> int: mon_wed_fri = 2 * 3 tue_thu = 1 * 2 sat = 3.5 total_weekly = mon_wed_fri + tue_thu + sat total_three_weeks = total_weekly * 3 result = total_three_weeks return result
Student: A pizza restaurant sells pizzas in 3 different sizes- small for $7, medium for $12, and large for $16. If the restaurant sold 10 small, 5 medium, and 3 large pizzas, how much did they make in total?
def solve() -> int: small_price = 7 medium_price = 12 large_price = 16 num_small = 10 num_medium = 5 num_large = 3 total_small = num_small * small_price total_medium = num_medium * medium_price total_large = num_large * large_price total_sales = total_small + total_medium + total...
ix groups of four turtles were walking by a log. Two of the groups stopped to take a rest and two more turtles from the remaining four groups joined them making a total of 18 turtles on the log. After resting for a while, 6 turtles from the original 6 groups suddenly left the log. How many turtles remained on the log?
def solve() -> int: total_turtles = 0 group_num = 6 turtles_in_group = 4 first_wave = group_num * turtles_in_group total_turtles += first_wave add_turtles = 2 * 4 total_turtles += add_turtles left_turtles = 6 total_turtles -= left_turtles result = total_turtles return res...
Starbucks decided to award a bonus to all its baristas who worked on Thanksgiving Day. The bonus will total 20% of Starbucks' daily earnings, which was $15,000. It is known that Starbucks has 25 baristas; 5 were on leave on Thanksgiving Day. How much was the bonus that each barista who worked on Thanksgiving Day receiv...
def solve() -> int: daily_earnings = 15000 total_baristas = 25 baristas_on_leave = 5 baristas_worked = total_baristas - baristas_on_leave bonus_per_barista = (daily_earnings * 0.2) / baristas_worked result = bonus_per_barista return result
Student: Jonathan has a total of 30 marbles. He has twice the number of green marbles as red marbles. How many green marbles does he have?
def solve() -> int: total_marbles = 30 red_marbles = total_marbles / 3 green_marbles = red_marbles * 2 result = green_marbles return result
A student bought 4 pens, 5 erasers, and 6 notebooks at the school store. If each pen cost $3, each eraser cost $2, and each notebook cost $5, how much money did the student spend in total?
def solve() -> int: total_cost = 0 total_cost = total_cost + (4 * 3) total_cost = total_cost + (5 * 2) total_cost = total_cost + (6 * 5) result = total_cost return result
ahil can cycle twenty times faster than Kathy. If it takes Kathy 40 minutes to cycle 7 kilometers, how long, in minutes, will it take Sahil to cycle 18 kilometers?
def solve() -> int: dist_kathy = 7 speed_kathy = 1/40 speed_sahil = speed_kathy*20 dist_sahil = 18 time_sahil= dist_sahil * speed_sahil result = time_sahil return result
In a school, there are 500 students. 80% of them have at least one parent attending parent-teacher meetings, while 65% of the students have at least two parents attending. How many students have only one parent attending?
def solve() -> int: total_students = 500 at_least_one_parent = total_students * 0.8 at_least_two_parents = total_students * 0.65 only_one_parent = at_least_one_parent - at_least_two_parents result = only_one_parent return result
During a shopping trip, Mia and Ethan bought 3 pounds of strawberries for $6.75. If they want to divide the strawberries evenly, how much will each person get and how much did each strawberry cost?
def solve() -> int: total_strawberries = 3 total_cost = 6.75 strawberries_per_person = total_strawberries / 2 cost_per_strawberry = total_cost / total_strawberries result = None return result
A fish's fins are one-sixth its body length. If a fish is 30 centimeters long, calculate the length of the rest of its body minus the fins.
def solve() -> int: body_length = 30 fins_length = body_length / 6 rest_of_body_length = body_length - fins_length result = rest_of_body_length return result
Rachel drives her friends to a music festival. They will share the cost of gas. The festival is 200 miles away, gas costs $3.20/gallon, Rachel's car gets 22 miles/gallon, and they will attend the festival once a year. What is the total gas cost and cost per person for the trip?
def solve() -> int: distance = 200 gas_cost_per_gallon = 3.20 car_miles_per_gallon = 22 total_gas_cost = (distance / car_miles_per_gallon) * gas_cost_per_gallon cost_per_person = total_gas_cost / 4 result = cost_per_person return result
A bicycle is 20% off, with the original price being $250. How much does the bike cost after the discount?
def solve() -> int: original_price = 250 discount = 0.2 discount_amount = original_price * discount discounted_price = original_price - discount_amount result = discounted_price return result
arah owns a small clothing store where she sells custom dresses. Each dress is made of a fabric that costs $40 per yard. Sarah uses 2.5 yards of fabric per dress and adds decorative materials costing $20 per dress. She sells the dresses for 2 times the value of fabric and decorations. Sarah manages to sell 100 dresses ...
def solve() -> int: fabric_cost = 40 yards_per_dress = 2.5 decoration_cost = 20 dresses_per_month = 100 rent = 7000 extra_expenses = 4000 total_cost_per_dress = (fabric_cost * yards_per_dress) + decoration_cost sale_price_per_dress = total_cost_per_dress * 2 income = sale_price_...
Noah wants to buy a bike. The bike costs $1,000 but he gets a discount of 20%. He sells the bike and earns a profit of $200. If he sold the bike for $1,200, how much money did he spend to buy the bike?
def solve() -> int: bike_cost = 1000 discount = bike_cost * 0.2 discounted_cost = bike_cost - discount profit = 200 selling_price = 1200 cost_for_noah = selling_price - profit amount_spent = cost_for_noah - discounted_cost result = amount_spent ...
The sum of three consecutive numbers is 63. What is the largest of the three numbers?
def solve() -> int: total_sum = 63 middle_number = total_sum/3 largest_number = middle_number + 1 result = largest_number return result
If a pound of coffee normally costs $15 but is now sold at a 10% discount and a box of tea was sold at a discount of $2, how much will you save if you buy 3 pounds of coffee and 2 boxes of tea?
def solve() -> int: coffee_price = 15 coffee_discount = 0.1 tea_discount = 2 coffee_quantity = 3 tea_quantity = 2 coffee_discount_amount = coffee_price * coffee_discount coffee_discounted_price = coffee_price - coffee_discount_amount coffee_total_price = coffee_discounted_price * co...
A car travels 60 kilometers per hour for 5 hours. How many kilometers did the car travel?
def solve() -> int: speed = 60 time = 5 distance = speed * time result = distance return result
How much larger is the circumference of a circle with a radius of 10 than a circle with a radius of 2?
def solve() -> int: radius_1 = 10 radius_2 = 2 circumference_1 = 2 * 3.14 * radius_1 circumference_2 = 2 * 3.14 * radius_2 difference_in_circumference = circumference_1 - circumference_2 result = difference_in_circumference return result
Maria runs 3 km less than John every hour. If John runs 9 km/hour, how many kilometers will they run together in 4 hours?
def solve() -> int: john_speed = 9 maria_speed = john_speed - 3 time = 4 total_distance = (john_speed + maria_speed) * time result = total_distance return result
Melissa is constructing a wooden fence. Each fence post is 6 feet high and she purchased 400 feet of lumber for the sides. If she wants each side to be the same length, how long should the sides be?
def solve() -> int: total_lumber_length = 400 fence_post_height = 6 number_of_posts = total_lumber_length / fence_post_height fence_side_length = total_lumber_length / number_of_posts result = fence_side_length return result
There are 6 shelves in a bookcase and each shelf has 8 books. Each book has 3 sections and each section has 12 pages. How many pages are in the bookcase?
def solve() -> int: shelves = 6 books = 8 sections = 3 pages = 12 pages_per_book = sections * pages pages_per_shelf = books * pages_per_book pages_in_bookcase = shelves * pages_per_shelf result = pages_in_bookcase return result
If a rectangular pizza has 8 slices and 4 slices were eaten already, how many slices are left in the pizza?
def solve() -> int: slices_in_pizza = 8 slices_eaten = 4 slices_left = slices_in_pizza - slices_eaten result = slices_left return result
A pipe can fill a tank in 6 hours. An identical pipe can fill the same tank in 4 hours. If both pipes are used at the same time, how long will it take to fill the tank?
def solve() -> int: pipe1_time = 6 pipe2_time = 4 combined_time = 1 / ((1 / pipe1_time) + (1 / pipe2_time)) result = combined_time return result
In a game, Simeon got 3 power-ups, each worth 10 coins. If Simeon has 24 coins, how much money does he have left?
def solve() -> int: coins_per_pow_up = 10 no_of_pow_ups = 3 total_coins = 24 total_cost = coins_per_pow_up * no_of_pow_ups remaining_coins = total_coins - total_cost result = remaining_coins return result
A store has 100 shirts for sale. 30 shirts are sold and 20 shirts are added to the inventory. How many shirts are left in the store?
def solve() -> int: shirts = 100 shirts -= 30 shirts += 20 result = shirts return result
A restaurant bill totals to $120, not including tax. The sales tax is 6%. If you want to leave a 15% tip, what is the total cost?
def solve() -> int: bill_amount = 120 sales_tax = 0.06 tip_percentage = 0.15 tax_amount = bill_amount * sales_tax total_cost = bill_amount + tax_amount tip_amount = total_cost * tip_percentage final_total_cost = total_cost + tip_amount result = final_total_cost ...
A company can produce 6 cars per hour. If it takes 4 hours to produce 18 cars, how many more cars should be produced in the next 2 hours to speed up production?
def solve() -> int: production_rate = 6 initial_time = 4 initial_cars = 18 hours_needed = 6 cars_needed = production_rate * hours_needed - initial_cars speedup_cars = production_rate * 2 difference = speedup_cars - cars_needed result = int(difference) return result
A book store sold 100 novels for $15 each, 30 self-help books for $10 each, and 20 textbooks for $100 each. How much money did the book store make?
def solve() -> int: novels_sold = 100 novel_price = 15 self_help_sold = 30 self_help_price = 10 textbooks_sold = 20 textbook_price = 100 novels_total = novels_sold * novel_price self_help_total = self_help_sold * self_help_price textbooks_total = textbooks_sold * textbook_price ...
Alice can solve 20 math problems in an hour. She practices and is able to solve 10% more per hour. How many problems can she solve in 5 hours?
def solve() -> int: speed = 20 increased_speed = speed * 1.1 problems = increased_speed * 5 result = problems return result
7. Nick's Home has 1080 glasses of orange juice necessary to serve 30 people. How many glasses would be needed to serve 10% less people?
def solve() -> int: glasses = 1080 new_people = 30 - 0.1 * 30 result = glasses/new_people return result
If Ann can complete 10 math problems in 20 minutes, how many problems can she complete in 90 minutes?
def solve() -> int: time = 90 rate = 10/20 problems = rate*time result = problems return result
posits $4500 into a bank account with an annual interest rate of 6%. How much money will Susan have in her account after 2 years?
def solve() -> int: principal = 4500 interest_rate = 0.06 numbers_of_years = 2 interest = principal * interest_rate * numbers_of_years final_amount = principal + interest result = final_amount return result
A company has 500 employees. If 60% of them are women, how many male employees are there?
def solve() -> int: total_employees = 500 percent_women = 0.60 women_employees = total_employees * percent_women men_employees = total_employees - women_employees result = men_employees return result
Wendy the Gardener had 72 roses, 54 tulips, and 36 daisies in her garden. She cut one-fourth of her roses and one-third of her tulips for a bouquet. Peter then gave her 27 lilies and 18 sunflowers to plant in her garden. If exactly 50% of the flowers in the garden are red, how many red flowers are there in the garden?
def solve() -> int: roses_left = 72 - (72 / 4) tulips_left = 54 - (54 / 3) total_flowers = roses_left + tulips_left + 36 + 27 + 18 red_flowers = total_flowers * 0.5 result = red_flowers return result
At the zoo, there were 2 lions, 3 zebras, 6 monkeys, and 4 elephants. How many legs were there in total?
def solve() -> int: lions = 2 zebras = 3 monkeys = 6 elephants = 4 lions_legs = lions * 4 zebras_legs = zebras * 4 monkeys_legs = monkeys * 2 elephants_legs = elephants * 4 total_legs = lions_legs + zebras_legs + monkeys_legs + elephants_legs result = total_legs ...
Mary has a container of laundry detergent. Each use requires 1.5 ounces. She uses it twice every day. If the container is 4 ounces less than a half-gallon, how many days will it last?
def solve() -> int: container_size = 64 daily_use = 1.5 * 2 days_last = container_size / daily_use result = days_last return result
Jackie bought a total of 24 video games from the store. She spent $115 in total. How much did she spend on each game?
def solve() -> int: total = 115 games = 24 price = total/games result = price return result
If David buys a donut for 2 quarters and 5 dimes, and receives 10 cents back in change, what is the cost of the donut?
def solve() -> int: quarters = 2 dimes = 5 change = 10 total_paid = (quarters * 25) + (dimes * 10) cost_of_donut = total_paid - change result = cost_of_donut return result
In a class of 30 students, the ratio of boys to girls is 2:3. How many girls are in the class?
def solve() -> int: total_students = 30 boy_ratio = 2 girl_ratio = 3 total_ratio = boy_ratio + girl_ratio girls = (girl_ratio / total_ratio) * total_students result = girls return result
A candy store is offering a summer discount. A bag of gummies costs $1 less than its original price of $5 and the lollipops are sold at $0.50 for 2 pieces. How much will you pay if you buy five bags of gummies and 20 lollipops?
def solve() -> int: original_gummy_price = 5 discounted_gummy_price = original_gummy_price - 1 num_gummy_bags = 5 num_lollipops = 20 lollipop_price = 0.50 / 2 total_gummy_cost = discounted_gummy_price * num_gummy_bags total_lollipop_cost = num_lollipops * lollipop_price to...
Greg has saved $500 for his vacation. The flight and hotel will cost him $350 and he wants to have $50 per day for food and activities. How many days can Greg afford to spend on vacation?
def solve() -> int: original = 500 total_spent = 350 daily = 50 days = (original - total_spent) / daily result = days return result
During a marathon, the distance covered by exactly two runners was 15% of the total distance covered by all runners. If the runners covered the same distance and a total of 500 kilometers were covered, how many kilometers did each runner cover?
def solve() -> int: total_distance = 500 distance_covered_by_two_runners = total_distance * 0.15 distance_covered_by_each_runner = distance_covered_by_two_runners / 2 result = distance_covered_by_each_runner return result
George has a fruit orchard filled with apples. For every 7 apples he picks, he plants 12 new apple trees. If he started with 1200 apple trees and picked 35% of them, how many apple trees does he have now?
def solve() -> int: starting_trees = 1200 picked_percentage = 35 picked_trees = starting_trees * (picked_percentage / 100) remaining_trees = starting_trees - picked_trees picked_apples = picked_trees * 7 new_trees = picked_apples // 12 total_trees = remaining_tr...
The sum of three consecutive even integers is 162. What is the smallest of the three integers?
def solve() -> int: x = 52 y = x + 2 z = x + 4 while x + y + z!= 162: x += 2 y = x + 2 z = x + 4 result = x return result
Student: Jimmy was paid $60 for 3 hours work. What was his hourly wage?
def solve() -> int: hours_worked = 3 total_pay = 60 hourly_wage = total_pay / hours_worked result = hourly_wage return result
Lily needs to travel to the airport. A limousine ride costs $8 more than a shuttle ride. A shuttle ride costs $5 less than a taxi ride. The limousine ride costs $42. How much would a taxi ride cost for Lily if she tips the driver 10% of the fare?
def solve() -> int: limousine_ride = 42 shuttle_ride = limousine_ride - 8 taxi_ride = shuttle_ride + 5 tip = taxi_ride * 0.1 taxi_ride_with_tip = taxi_ride + tip result = taxi_ride_with_tip return result
Emma makes 25% profit on a sweatshirt. She sells each sweatshirt at $35. How much money does Emma make on the sale of 3 sweatshirts?
def solve() -> int: price_of_sweat_shirt = 35 number_of_sweatshirts = 3 profit_percentage =.25 total_revenue = price_of_sweat_shirt * number_of_sweatshirts profit = total_revenue * profit_percentage result = profit return result
Emma has 500g of chocolate chips and she wants to make double chocolate cookies for a party. Each cookie needs 30g of chocolate chips and she wants to make 5 extra cookies just in case. How many cookies can Emma make?
def solve() -> int: choco_chips = 500 per_cookie = 30 extra_cookies = 5 total_cookies = (choco_chips // per_cookie) + extra_cookies result = total_cookies return result
Alice has 80 stickers that she wants to use to decorate her notebook, but she needs to arrange them in a pattern first. She decides to use 4 rows and 5 columns of stickers, and then leaves a gap of 2 stickers between each row and column. How many stickers does she have left after decorating her notebook?
def solve() -> int: stickers = 80 stickers_used = 4 * 5 + 2 * 4 + 2 * 5 stickers_left = stickers - stickers_used result = stickers_left return result
Michael wants to go to a concert. A VIP pass costs $25 more than a general admission ticket. A general admission ticket costs $18 more than a student discount ticket. The VIP pass costs $63. If Michael chooses to use the student discount instead and gives 15% of the ticket price as a donation to the sponsoring organiza...
def solve() -> int: student_discount = 48 general_admission = student_discount + 18 vip_pass = general_admission + 25 ticket_price = student_discount * 0.85 donation = student_discount * 0.15 total_cost = ticket_price + donation result = round(total_cost, 2) return result
An artist has to paint 36 canvases. There are 6 walls in the gallery. 3 of the walls are white and 2 are black. How many canvases will be allocated for each of those walls?
def solve() -> int: total_canvases = 36 total_walls = 6 white_walls = 3 black_walls = 2 white_wall_canvases = total_canvases * (white_walls / total_walls) black_wall_canvases = total_canvases * (black_walls / total_walls) result = white_wall_canvases, black_wall_canvases ...
Razzle, the seven-winged hummingbird, makes 12 wing prints every 5 meters as she flits through the garden, but Dazzle, the four-legged snail, leaves a slimy trail that makes 9 wet marks every 3 meters while she crawls. Razzle travels 8000 meters, while Dazzle crawls 7000 meters. How many total marks will they leave?
def solve() -> int: razzle_wingprints_per_meter = 12/5 dazzle_wetmarks_per_meter = 9/3 razzle_distance = 8000 dazzle_distance = 7000 razzle_total_marks = razzle_wingprints_per_meter * razzle_distance dazzle_total_marks = dazzle_wetmarks_per_meter * dazzle_distance total_marks ...
A recipe requires 2 cups of sugar, 3 cups of flour, and 1 cup of milk. If John wants to triple the recipe, how much milk will he need?
def solve() -> int: original_milk = 1 new_recipe_multiplier = 3 new_milk_amount = original_milk * new_recipe_multiplier result = new_milk_amount return result
A sofa costs $400 and a table costs twice as much. If Sarah buys the sofa and the table, how much does she spend?
def solve() -> int: price_sofa = 400 price_table = 2 * price_sofa total_cost = price_sofa + price_table result = total_cost return result
A gym has 50 machines for cardio exercises. The gym owner purchases an additional 20 machines. After one week, 10 machines were taken out for maintenance. After two weeks, the gym purchases another 30 machines. How many machines are available for cardio exercise in the gym at the end of the month?
def solve() -> int: gym_machines = 50 additional_machines = 20 maintenance_machines = 10 additional_machines_2 = 30 machines_after_purchase = gym_machines + additional_machines machines_after_maintenance = machines_after_purchase - maintenance_machines machines_after_second_purchase = m...
Student: In the farm, there are three fewer cows than chickens. If there are 24 chickens, how many cows and chickens are there in total?
def solve() -> int: chickens = 24 cows = chickens - 3 result = cows + chickens return result
John has 300 pencils. He gives away 75% of the pencils to his friends. How many pencils does John have left?
def solve() -> int: pencils = 300 given_away = pencils * 0.75 left = pencils - given_away result = left return result
Student: A bookstore bought 300 books for $2 each and sold them for $4 each. What was its total profit after selling all the books?
def solve() -> int: books = 300 cost = 2 price = 4 total_cost = books * cost total_revenue = books * price profit = total_revenue - total_cost result = profit return result
You borrowed $5000 from the bank with a 4% annual interest rate. Every month you have to pay back $200. How many months will it take to pay back the whole debt?
def solve() -> int: total_payment = 5000 * 1.04 months = total_payment / 200 result = months return result
Student: The sum of three consecutive even numbers is 78. What is the second number?
def solve() -> int: second_number = 24 + 2 result = second_number return result
Harry has three more than twice as many coins as Irene has. If Irene has 15 coins in her wallet and 9 coins in her piggy bank, how many coins does Harry have?
def solve() -> int: irene_coins = 15 + 9 harry_coins = 2 * irene_coins + 3 result = harry_coins return result
Student: A train travels 300 miles in 5 hours. If it continues at the same speed, how far will it travel in 8 hours?
def solve() -> int: distance_traveled = 300 time_traveled = 5 speed = distance_traveled / time_traveled distance_traveled_in_8_hours = speed * 8 result = distance_traveled_in_8_hours return result
A rectangular parcel has a length of 15 cm and a width of 10 cm. What is the perimeter of the parcel?
def solve() -> int: length = 15 width = 10 perimeter = 2 * (length + width) result = perimeter return result
A car dealer bought 20 cars at a total cost of $150,000. He then sold 15 of them at a profit of $2,000 each and sold the remaining 5 at a loss of $1,000 each. What was his overall profit or loss?
def solve() -> int: cost_per_car = 150000 / 20 total_profit_from_first_15 = 15 * 2000 total_loss_from_last_5 = 5 * 1000 overall_profit_or_loss = total_profit_from_first_15 - (total_loss_from_last_5 + (cost_per_car * 5)) result = overall_profit_or_loss return result
If a person ran a total of 2.5 miles in 20 minutes, what was their average speed?
def solve() -> int: distance = 2.5 time = 20 result = distance/time result = 0.125 return result
Kevin plants 160 potato seeds. 15% of them sprout and Kevin sells 10 of the potato plants. How many potato plants does he have left?
def solve() -> int: seeds_planted = 160 sprouted_percentage = 0.15 plants_sprouted = seeds_planted * sprouted_percentage plants_sold = 10 plants_left = plants_sprouted - plants_sold result = plants_left return result
Student: William has $1000 in his bank account and he wants to save $500 in 5 months. If he saves the same amount of money each month, how much should he save each month?
def solve() -> int: total_amount = 1000 saving_goal = 500 months = 5 amount_to_save = saving_goal / months result = amount_to_save return result
Annie drank 10 gallons of juice in 4 days. If she continues drinking the same amount, how many gallons will she drink in 1 week?
def solve() -> int: daily_gallons = 10/4 total_gallons = daily_gallons * 7 result = total_gallons return result
Maya read 12 books in January, 15 books in February, and 10 books in March. She wants to read an average of 13 books per month for the first six months of the year. How many books does she need to read in the next three months to achieve her goal?
def solve() -> int: books_read = 12 + 15 + 10 target_books = 13 * 6 books_to_read = target_books - books_read result = books_to_read return result
Student: A cyclist rides 45km in 3 hours. What is the average distance the cyclist completes in 1 hour?
def solve() -> int: distance = 45 time = 3 average_distance = distance / time result = average_distance return result
Math textbooks cost 11.20 each at a book store. What is the total cost of 3 math textbooks?
def solve() -> int: total_price = 11.20 num_books = 3 total = total_price * num_books result = total return result
A manufacturer produces 500 widgets at a cost of $8 each. If the manufacturer sells the widgets for $12 each, what is the profit on the entire batch?
def solve() -> int: widgets_produced = 500 cost_per_widget = 8 selling_price_per_widget = 12 total_cost = widgets_produced * cost_per_widget total_revenue = widgets_produced * selling_price_per_widget profit = total_revenue - total_cost result = profit return result
10. William gave his friend $24 for a shirt. If the original cost of the shirt was $30, what percent of the cost did William pay?
def solve() -> int: original_cost = 30 amount_paid = 24 percent = (amount_paid/original_cost) * 100 result = percent return result
Student: Sarah wants to make a fruit salad for her family. She has 3 apples, 4 oranges, and 2 bananas. If Sarah uses 2 pieces of fruit per serving of salad, how many servings can she make?
def solve() -> int: apples = 3 oranges = 4 bananas = 2 total_fruit = apples + oranges + bananas servings = total_fruit // 2 result = servings return result
Student: A square has an area of 64 square units. What is the length of each side of the square?
def solve() -> int: area = 64 side_length = area ** 0.5 result = side_length return result
A grocery store has 200 fruits, 100 vegetables and 50 meat products. Each fruit weighs an average of 1 lb, each vegetable weighs an average of 2 lbs and each meat product weighs an average of 5 lbs. What is the total weight, in pounds, of all the products in the store?
def solve() -> int: num_fruits = 200 weight_per_fruit = 1 num_vegetables = 100 weight_per_vegetable = 2 num_meat_products = 50 weight_per_meat_product = 5 total_weight = (num_fruits * weight_per_fruit) + (num_vegetables * weight_per_vegetable) + (num_meat_products * weight_per_meat_product) ...
Student: In a class of 36 students, what is the total number of pairs that can be formed?
def solve() -> int: num_students = 36 total_pairs = num_students * (num_students - 1) / 2 result = total_pairs return result
Emily buys 10 apples for $4 each. She also buys 4 oranges for $2 each. How much money did Emily spend in total?
def solve() -> int: price_apples = 4 price_oranges = 2 quantity_apples = 10 quantity_oranges = 4 total_price_apples = price_apples * quantity_apples total_price_oranges = price_oranges * quantity_oranges total = total_price_apples + total_price_oranges result = total ...
Andy is filling a pool with water using two hoses. The first hose can fill the pool in 6 hours, and the second hose can fill the pool in 9 hours. He also has a drain that can empty the pool in 12 hours. He opens both hoses and the drain at the same time. How long will it take to fill the pool, and how much water will b...
def solve() -> int: hose_1 = 1 / 6 hose_2 = 1 / 9 drain = - 1 / 12 net_rate = hose_1 + hose_2 + drain time = 1 / net_rate fraction = net_rate * 4 result = f'It will take {time} hours to fill the pool, and {fraction} of the pool will be filled after 4 hours.' return r...
Rachel's weather app predicts rain for 40% of the time, and 30% of the time it doesn't predict rain, it still ends up raining. What percentage of the time does the app predict no rain and still not rain?
def solve() -> int: rain_predict = 0.4 rain_not_predict = 0.3 no_rain_not_predict = 1 - (rain_predict + rain_not_predict) result = no_rain_not_predict * 100 return result
A cake requires 3/4 cups of sugar. If Linda has only 2/3 cups of sugar, how much more sugar does she need to make the cake?
def solve() -> int: cake_sugar = 3/4 linda_sugar = 2/3 needed_sugar = cake_sugar - linda_sugar result = needed_sugar return result
A car gets 25 miles per gallon of gas. If you want to drive 300 miles, how many gallons of gas do you need?
def solve() -> int: gallons_of_gas = 300/25 result = gallons_of_gas return result
A football team played a 90-minute match. If they made the first goal in 10 minutes and then scored two more goals in 30 minutes each, what was their average speed in (m/s) for the entire match?
def solve() -> int: time_first_goal = 10 time_second_goal = 30 time_third_goal = 30 total_time = 90 total_goals = 3 total_distance = total_goals * 100 total_time_in_seconds = total_time * 60 average_speed = total_distance / total_time_in_seconds result = ...
A bag contains 7 blue marbles, 4 red marbles, and 5 green marbles. If two marbles are randomly drawn from the bag, what is the probability that they are both red?
def solve() -> int: total_marbles = 16 red_marbles = 4 prob_first_red = red_marbles/total_marbles prob_second_red = (red_marbles-1)/(total_marbles-1) prob_both_red = prob_first_red*prob_second_red result = prob_both_red return result
There are 56 pencils in a box, 14 of them are red and the others are blue. What fraction of the pencils is blue?
def solve() -> int: pencils_total = 56 pencils_blue = 42 result = pencils_blue/pencils_total return result