question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A recipe calls for 2 1/2 cups of sugar and makes 24 cookies. How much sugar is needed to make 36 cookies?
def solve() -> int: sugar_for_24_cookies = 2.5 num_cookies = 36 sugar_for_one_cookie = sugar_for_24_cookies / 24 sugar_for_num_cookies = sugar_for_one_cookie * num_cookies result = sugar_for_num_cookies return result
A recipe calls for 2 cups of sugar to make 24 cookies. How much sugar is needed to make 36 cookies?
def solve() -> int: sugar_per_cookie = 2/24 cookies = 36 sugar_needed = sugar_per_cookie * cookies result = sugar_needed return result
A 3-liter jug is filled with 2 liters of water. How much more water is needed to fill up the jug?
def solve() -> int: water_needed = 3 - 2 result = water_needed return result
A laptop battery has a capacity of 4000 milliamp-hours (mAh), and the laptop consumes 80 milliamps per hour (mA/h). How many hours can the laptop be used on a fully charged battery?
def solve() -> int: battery_capacity = 4000 power_consumption = 80 time_on_battery = battery_capacity / power_consumption result = round(time_on_battery, 2) return result
Student: A company produces 40 widgets per hour. The cost of each widget is 5 dollars per unit. If each widget is sold at a price of 7 dollars per unit, what is the hourly profit of the company?
def solve() -> int: widgets_per_hour = 40 cost_per_widget = 5 price_per_widget = 7 total_cost = widgets_per_hour * cost_per_widget total_revenue = widgets_per_hour * price_per_widget profit = total_revenue - total_cost result = profit return result
A store purchases a certain item for $4 and gives it to customers for $9. If the store sold 180 items, what was its total sales revenue?
def solve() -> int: price_to_customers = 9 cost_to_store = 4 number_items_sold = 180 revenue = (price_to_customers - cost_to_store) * number_items_sold result = revenue return result
Possible new questions and programs: There are 10 people who want to share a pizza that has 12 slices. Each person can eat up to 3 slices, but they want to be fair and leave some leftovers for later. How many slices will each person get and how many will be left over?
def solve() -> int: slices_per_person = min(3, 12 // 10) slices_eaten = slices_per_person * 10 slices_left = 12 - slices_eaten result = (slices_per_person, slices_left) return result
Michael has two jars of candy, one filled with chocolate and the other filled with gummy bears. For every two pieces of chocolate he eats, he eats five gummy bears. If he eats 30 pieces of chocolate, how many pieces of candy does he eat in total?
def solve() -> int: chocolate_jar = 30 gummy_jar = (chocolate_jar/2)*5 total_candy = chocolate_jar + gummy_jar result = total_candy return result
Bob wants to buy 3 pairs of shoes at $45 each and 5 shirts at $20 each. If there is a 10% discount on the total purchase, how much did Bob pay in all after the discount?
def solve() -> int: shoes = 3 shoe_price = 45 shirts = 5 shirt_price = 20 total_cost = (shoes * shoe_price) + (shirts * shirt_price) discount = total_cost * 0.1 final_cost = total_cost - discount result = final_cost return result
The sum of three consecutive integers is 42. What is the smallest of these integers?
def solve() -> int: sum_integers = 42 middle_integer = sum_integers//3 smallest_integer = middle_integer - 1 result = smallest_integer return result
If Emily has a garden with 4 raised beds by 6 raised beds, and it takes her 9 minutes to sow each raised bed, how many hours did she spend sowing all the raised beds?
def solve() -> int: beds_length = 4 beds_width = 6 time_per_bed = 9 total_beds = beds_length * beds_width total_time = total_beds * time_per_bed hours_spent = total_time / 60 result = hours_spent return result
For her photography project, Jennifer needs to buy a camera and four rolls of film. The camera costs $220, each roll of film cost $22. How much did she spend in total?
def solve() -> int: price_camera = 220 price_film = 22 amount_film = 4 total_film = amount_film * price_film total_price = price_camera + total_film result = total_price return result
A rectangle has a length that is twice the width. If the perimeter is 36 meters, what is the length of the rectangle?
def solve() -> int: perimeter = 36 ratio = 2 width = perimeter/(2+ratio) length = ratio * width result = length return result
Andy has a collection of 20 books. He reads 2 books per week and buys 1 new book every 2 weeks. How many books will he have in his collection after 10 weeks?
def solve() -> int: books = 20 read = 2 buy = 1 weeks = 10 change = buy / 2 - read total_change = change * weeks final_books = books + total_change result = 10.0 return result
Layla had 25 hair clips. She purchased one and a half times as many clips as before and then gave away 30% of her new collection. How many hair clips does Layla have now?
def solve() -> int: hair_clips = 25 purchased_clips = hair_clips * 1.5 given_away_clips = purchased_clips * 0.3 remaining_clips = purchased_clips - given_away_clips result = remaining_clips return result
Mr. Delgado is hiking from New York City to Washington, D.C., travelling 156 miles in 2/3 of the time it takes to travel the same distance going the opposite direction. Mr. Delgado hiked 10 miles less in the opposite direction. What was his average speed for the entire trip?
def solve() -> int: distance = 156 oppositeTime = (distance / 2) * 3 totalTime = (distance + 10) / 2 speed = distance / totalTime result = speed return result
Kyle has 27 jars of jelly and he wants to share them equally with 6 of his siblings. How many jars will each of his siblings get?
def solve() -> int: num_jars = 27 num_siblings = 6 jars_per_sibling = num_jars / num_siblings result = jars_per_sibling return result
A swimming pool is 15 meters long, 10 meters wide, and 2 meters deep on one end and 4 meters deep on the other. What is the volume of the pool?
def solve() -> int: length = 15 width = 10 depth1 = 2 depth2 = 4 volume = ((depth1 + depth2) / 2) * length * width result = volume return result
Mr. Jack owns a bakery and he baked 200 cakes for selling at his bakery. On the first day, he sold 35 cakes. On the second day, he sold double the amount of cakes he sold on the first day. On the third day, he sold 50 cakes, but unfortunately, 7 cakes were dropped and smashed. On the fourth day, he baked 4 times the am...
def solve() -> int: cakes_baked = 200 cakes_sold_day1 = 35 cakes_sold_day2 = cakes_sold_day1 * 2 cakes_sold_day3 = 50 cakes_dropped_day3 = 7 cakes_baked_day4 = cakes_dropped_day3 * 4 cakes_left = cakes_baked - cakes_sold_day1 - cakes_sold_day2 - cakes_sold_day3 + cakes_dropped_day3 - ca...
A boat is traveling upstream against the current at a rate of 12 miles per hour. The boat can go 20 miles per hour downstream with the current. What is the speed of the current?
def solve() -> int: boat_speed = 20 upstream_speed = 12 speed_difference = boat_speed - upstream_speed current_speed = speed_difference/2 result = current_speed return result
Joe ran 5 miles in 50 minutes, while Emma ran 10 miles in 1.5 hours. Who ran slower?
def solve() -> int: Joe_time = 50/60 Emma_time = 1.5 Joe_speed = 5/Joe_time Emma_speed = 10/Emma_time if Joe_speed > Emma_speed: result = 'Emma ran slower' else: result = 'Joe ran slower' return result
Student: In a clothing store, a t-shirt is $15, and a pair of jeans is $50. If you buy 2 t-shirts and 1 pair of jeans, how much would it cost?
def solve() -> int: cost_tshirt = 15 cost_jeans = 50 num_tshirt = 2 num_jeans = 1 total_cost = cost_tshirt * num_tshirt + cost_jeans * num_jeans result = total_cost return result
Louise is planning a party for her friends. She knows that she needs to purchase 3 packs of snacks for $5 each, 4 packs of drinks for $10 each, and 1 pack of plates for $25. If she has a coupon for 20% off her total purchase, how much money will she save?
def solve() -> int: num_snacks = 3 num_drinks = 4 num_plates = 1 cost_snacks = 5 cost_drinks = 10 cost_plates = 25 discount = 0.2 total_cost = num_snacks * cost_snacks + num_drinks * cost_drinks + num_plates * cost_plates discounted_amount = discount * total_cost saving = discoun...
A box contains 5 red marbles, 3 blue marbles, and 2 green marbles. If 2 marbles are drawn at random, what is the probability that both marbles are red?
def solve() -> int: total_marbles = 5 + 3 + 2 total_red_marbles = 5 probability_of_red = total_red_marbles / total_marbles new_total_marbles = total_marbles - 1 new_total_red_marbles = total_red_marbles - 1 new_probability_of_red = new_total_red_marbles / new_total_marbles probability_of_two...
Jack watches 50 hours of TV each week. If he cuts the time he spends watching TV in half every week, how many weeks will it take him to only watch 5 hours of TV per week?
def solve() -> int: hours_per_week = 50 target_hours_per_week = 5 weeks = 0 while hours_per_week > target_hours_per_week: hours_per_week /= 2 weeks += 1 result = weeks return result
Lily had seven packs of stickers with eight stickers in each pack. She gave two packs to her sister and three stickers to her friend. How many stickers did Lily have left?
def solve() -> int: total_stickers = 7 * 8 left_packs = 7 - 2 left_stickers_in_packs = left_packs * 8 final_stickers = left_stickers_in_packs - 3 result = final_stickers return result
The ratio of boys to girls in each class is 3:2. How many girls are there in the whole school?
def solve() -> int: classes = 12 students = 25 ratio_boys = 3 ratio_girls = 2 girls_per_class = (students / (ratio_boys + ratio_girls)) * ratio_girls total_girls = classes * girls_per_class result = total_girls return result
Student: A rectangular garden is 12 meters long and 8 meters wide. Sam wants to add a 2-meter-wide flower bed around the garden. What will be the area of the flower bed?
def solve() -> int: length = 12 width = 8 flower_bed_width = 2 new_length = length + 2 * flower_bed_width new_width = width + 2 * flower_bed_width garden_area = new_length * new_width original_garden_area = length * width flower_bed_area = garden_area - original_garden_area result = ...
A bag contains 100 marbles. 30 marbles are red, 50 are blue, and 20 are green. If you take out 2 red marbles and 4 blue marbles, how many green marbles are left in the bag?
def solve() -> int: marbles = 100 red = 30 blue = 50 green = 20 red -= 2 blue -= 4 green_left = green result = green_left return result
John is baking cookies. He uses a recipe that requires 3 cups of flour for every dozen of cookies. John bakes two dozens of cookies and uses a total of 7 cups of flour. How many cups of flour does he have left?
def solve() -> int: dozen_of_cookies = 2 cups_of_flour_per_dozen = 3 total_cups_of_flour_used = dozen_of_cookies * cups_of_flour_per_dozen cups_of_flour_left = 7 - total_cups_of_flour_used result = cups_of_flour_left return result
Leo has a bag of candy that contains 24 pieces. He wants to share them with his 5 friends, but he also wants to keep some for himself. He decides to give 3 pieces to each friend and keep the rest. How many pieces of candy does Leo keep?
def solve() -> int: given = 3 * 5 left = 24 - given result = left return result
A hummingbird visits 50 flowers every hour, and a butterfly visits 30 flowers less. How many flowers do both insects visit in a day?
def solve() -> int: hummingbird_flower = 50 butterfly_flower = hummingbird_flower - 30 both_flower = hummingbird_flower + butterfly_flower day_flower = both_flower * 24 result = day_flower return result
Riley is painting a mural on a wall that is 12 meters long and 3 meters high. He has a paint roller that can cover 0.5 square meters in one minute. He needs to apply two coats of paint, and let the first coat dry for an hour before applying the second coat. How long does it take him to finish painting the wall?
def solve() -> int: area = 12 * 3 time_per_coat = area / 0.5 total_time = time_per_coat * 2 + 60 result = total_time return result
Lily and Jack shared $90. Jack got 2/3 of the money. Lily realized that Jack owed her $15 but she also owed him $9. After they paid off their debts, how much money does Jack have?
def solve() -> int: total_money = 90 jack_money = total_money * (2/3) lily_money = total_money - jack_money jack_money += 15 lily_money -= 15 jack_money -= 9 lily_money += 9 result = jack_money return result
Student: Eric wants to buy a T-shirt that costs $20 but he only has $15. If Eric's dad agrees to lend him the remaining amount, how much will he have to lend?
def solve() -> int: cost = 20 amount_owned = 15 amount_lent = cost - amount_owned result = amount_lent return result
A company has fixed expenses of $1000/month and variable expenses of $5 per unit sold. If they sell 500 units, what should be the selling price per unit if they want to make a profit of 30% on their total expenses?
def solve() -> int: fixed_expenses = 1000 variable_expenses_per_unit = 5 number_of_units = 500 profit_margin = 0.30 selling_price_per_unit = (fixed_expenses + variable_expenses_per_unit * number_of_units) * (1 + profit_margin) / number_of_units result = selling_price_per_unit...
A bag contains 25 red marbles and 35 blue marbles. What is the probability of drawing a red marble if one is randomly selected from the bag?
def solve() -> int: total_marbles = 25 + 35 red_marbles = 25 probability = red_marbles / total_marbles result = probability return result
Mike is renting a car for a trip. He can choose between two options: Option A charges 40 dollars per day plus 0.2 dollars per mile and Option B charges 50 dollars per day plus 0.1 dollars per mile. He plans to drive 200 miles per day for 3 days. Which option is cheaper and by how much?
def solve() -> int: option_a_day = 40 option_a_mile = 0.2 option_b_day = 50 option_b_mile = 0.1 miles_per_day = 200 days = 3 option_a_cost = (option_a_day * days) + (option_a_mile * miles_per_day * days) option_b_cost = (option_b_day * days) + (option_b_mile * miles_per_day *...
In a basketball team, there are 8 guards and 10 forwards. If 3 guards and 4 forwards are taken out for a game, what percentage of the team is left in the bench?
def solve() -> int: guards = 8 forwards = 10 out_guards = 3 out_forwards = 4 remaining_guards = guards - out_guards remaining_forwards = forwards - out_forwards total_players = remaining_guards + remaining_forwards percentage_on_bench = (total_players / (guards + forwards)) * 1...
A store sells two types of pens. One pack of pens has 8 pens and costs $6. The other pack of pens has 12 pens and costs $9. What is the average cost per pen?
def solve() -> int: cost_of_8_pens = 6 cost_of_1_pen_in_pack1 = cost_of_8_pens / 8 cost_of_12_pens = 9 cost_of_1_pen_in_pack2 = cost_of_12_pens / 12 average_cost_per_pen = (cost_of_8_pens + cost_of_12_pens) / (8 + 12) result = average_cost_per_pen return result
John has three four-litre boxes of milk and three six-litre boxes of milk. How much milk does John have altogether?
def solve() -> int: four_litre_box = 4 number_four_litre_box = 3 six_litre_box = 6 number_six_litre_box = 3 total_litres_four_litre_box = four_litre_box * number_four_litre_box total_litres_six_litre_box = six_litre_box * number_six_litre_box total_litres = total_litres_four_litre_...
A pizza has 8 slices and 3 of them are pepperoni. What percentage of the pizza is pepperoni?
def solve() -> int: pizza_slices = 8 pepperoni_slices = 3 percentage_pepperoni = (pepperoni_slices / pizza_slices) * 100 result = percentage_pepperoni return result
Student: A park has a path that is composed of two parallel sections. The total length of the path is 30 meters and the distance between the two sections is 3 meters. What is the length, in meters, of each of the two sections?
def solve() -> int: total_length = 30 distance = 3 section_length = (total_length - distance) / 2 result = section_length return result
Olivia bought 2 boxes of chocolate bars with 18 chocolate bars in each box. She also bought 3 boxes of candy bars with 12 candy bars in each box. In class, she gave away 7 chocolate bars and 6 candy bars. How many chocolate and candy bars does Olivia have left?
def solve() -> int: chocolate_bars_total = 2 * 18 candy_bars_total = 3 * 12 given_away_chocolate_bars = 7 given_away_candy_bars = 6 remaining_chocolate_bars = chocolate_bars_total - given_away_chocolate_bars remaining_candy_bars = candy_bars_total - given_away_candy_bars result = remaining_c...
Anabel and McKenna have a clothing store. Anabel sells shoes which use 9 yards of fabric per pair, and McKenna sells dresses which use 6 yards of fabric each. How many yards of fabric do they need every 5 days?
def solve() -> int: total_yards_of_fabric_per_5_days = 0 Anabel_shoes = 9 * 5 McKenna_dresses = 6 * 5 total_yards_of_fabric_per_5_days = Anabel_shoes + McKenna_dresses result = total_yards_of_fabric_per_5_days return result
Student: Ben likes to read books. He reads 2 books every week. Each book has 100 pages. How many pages will he read in 5 weeks?
def solve() -> int: books_per_week = 2 pages_per_book = 100 weeks = 5 total_books = books_per_week * weeks total_pages = total_books * pages_per_book result = total_pages return result
Zoe paints 8 squares, 6 triangles, and 4 circles. Each square has a side of 10 centimeters, each triangle has a base of 8 centimeters and a height of 6 centimeters, and each circle has a radius of 4 centimeters. What percentage of the total area painted was from the squares?
def solve() -> int: area_square = 10 * 10 area_triangle = (8 * 6) / 2 area_circle = 3.14 * 4 * 4 total_area = 8 * area_square + 6 * area_triangle + 4 * area_circle part_area = 8 * area_square percentage = (part_area / total_area) * 100 percentage = round(percentage, 2) result = percentag...
Five shirts cost $35. If four of the shirts cost $6 each, how much does the remaining shirt cost?
def solve() -> int: total_shirts_cost = 35 cost_shirts4 = 6 * 4 result = total_shirts_cost - cost_shirts4 return result
Sarah wants to buy 10 pens from the office supply store which cost $4.00 each with a 5% discount and she also wants to buy 3 notebooks which cost $7.00 with a 5% discount. How much money will Sarah have to spend in total after she bought all the items she wants after the discount?
def solve() -> int: pens = 10 pen_cost = 4.00 pen_discount = 0.05 notebooks = 3 notebook_cost = 7.00 notebook_discount = 0.05 total_pen_cost = pens * pen_cost pen_discount_amount = total_pen_cost * pen_discount final_pen_cost = total_pen_cost - pen_discount_amount ...
arah's family collects cans for a recycling fundraiser to help the local homeless shelter. They sell the cans for $1 per can and manage to collect a total of 320 cans. How much money in total did Sarah's family raise?
def solve() -> int: cansCollected = 320 canPrice = 1 totalRaised = cansCollected*canPrice result = totalRaised return result
Rick decides to start making and selling custom-designed T-shirts. Each T-shirt requires 3 yards of fabric, and each yard costs $11. He sells each T-shirt for $45. How much profit does he make if he sells 60 T-shirts?
def solve() -> int: cost_per_yard = 11 yards_per_tshirt = 3 cost_to_make_tshirt = cost_per_yard * yards_per_tshirt selling_price = 45 profit_per_tshirt = selling_price - cost_to_make_tshirt number_of_tshirts = 60 result = profit_per_tshirt * number_of_tshirts result return result
There are 80 pages in a novel. Maya has read 1/4 of it. She then lent the book to her friend who read 2/5 of what was left. How many pages are left to read?
def solve() -> int: pages = 80 pages = pages / 4 pages = pages * 3 pages = pages / 5 pages = pages * 3 result = pages return result
Beth spent $25 on groceries on Monday, $35 on groceries on Tuesday, and $40 on groceries on Wednesday. If she spends $50 on groceries on Thursday, what is the average amount she spends on groceries per day?
def solve() -> int: total_spent = (25 + 35 + 40 + 50)/4 result = total_spent return result
Jordan can read 100 pages in 2 hours. How long does it take her to read 140 pages?
def solve() -> int: pages_per_hour = 100 / 2 time_140_pages = 140 / pages_per_hour result = time_140_pages return result
Kyle bought a New Xbox One S for $250. The local sales tax rate is 9%. What is the total amount that he paid?
def solve() -> int: price_of_xbox = 250 tax_rate = 0.09 price_after_tax = price_of_xbox * (1 + tax_rate) result = price_after_tax return result
Student: 8. If a person has 11 coins, 5 dimes, 7 quarters, and 3 nickels, how much money does the person have total?
def solve() -> int: coins = 11 dimes = 5 quarters = 7 nickels = 3 total_amount = coins + dimes * 10 + quarters * 25 + nickels * 5 result = total_amount return result
Mike and his friends went out for a hike, and they covered 5 miles in 2 hours. How many miles did they cover in 1 hour each?
def solve() -> int: result = 2.5 num_miles = 5 num_hours = 2 miles_per_hour = num_miles / num_hours result = miles_per_hour return result
Jake drives his car at a constant speed of 78 miles/hour for 5 hours. If he has already covered 204 miles, how many more miles does he need to drive to complete his journey?
def solve() -> int: speed = 78 hours = 5 covered_miles = 204 total_miles = speed * hours remaining_miles = total_miles - covered_miles result = remaining_miles return result
Julia has a parking lot. The lot has an average of 20 cars per hour. In one hour, 15 cars parked. In another hour, twice that amount parked. How many cars parked in the third hour?
def solve() -> int: average_cars_per_hour = 20 cars_parked_in_hour_1 = 15 cars_parked_in_hour_2 = 2 * cars_parked_in_hour_1 cars_parked_in_hour_3 = average_cars_per_hour - (cars_parked_in_hour_1 + cars_parked_in_hour_2) result = cars_parked_in_hour_3 return result
James runs a lemonade stand and makes $50 a day. How much money will he make in 2 weeks?
def solve() -> int: daily_earnings = 50 days = 14 total_earnings = daily_earnings * days result = total_earnings return result
Maya has $45 to spend on 5 identical notebooks and 4 identical pens. The cost of each pen is $3. (a) How much does each notebook cost? (b) How much money will Maya have left after buying all 5 notebooks and 4 pens?
def solve() -> int: notebooks_cost = (45 - 4 * 3) / 5 result = notebooks_cost return result
Amy sold 12 bracelets for $4 each and 8 necklaces for $6 each at a craft fair. She spent $20 on materials and $10 on renting a table. How much profit did she make?
def solve() -> int: total_revenue = 12 * 4 + 8 * 6 total_expense = 20 + 10 profit = total_revenue - total_expense result = profit return result
Student: A train travels 180 km in 3 hours. If the train speed is increased by 50%, how long will it take to travel 360 km?
def solve() -> int: speed = 180 / 3 speed_increased = speed * 1.5 time = 360 / speed_increased result = time return result
A company wants to increase their sales by 50%. If they currently make $10,000 in sales per month, how much do they want to make after the increase?
def solve() -> int: current_sales = 10000 increase_percent = 0.5 increase_amount = current_sales * increase_percent result = current_sales + increase_amount return result
Sarah is a gardener. She plants 6 trees every day. It takes her 1 hour to prepare the soil for each tree and another 2 hours to plant and water each tree. She takes 30 minutes to label each tree. How long does it take Sarah to plant a tree?
def solve() -> int: trees_planted_per_day = 6 time_to_prepare_soil = 1 time_to_plant_and_water = 2 time_to_label = 0.5 total_time_per_tree = time_to_prepare_soil + time_to_plant_and_water + time_to_label time_to_plant_one_tree = total_time_per_tree / trees_planted_per_day ...
There are five times as many students in the Math class as the Science class. The English class has 150 pupils. If the Math class has one-fourth as many students as the English class, how many students are in the Science class?
def solve() -> int: e = 150 m = e/4 s = m/5 result = s return result
Jane’s phone battery died when she had only used 50% of it. If her phone battery capacity is 3500mAh, how many mAh has she used?
def solve() -> int: capacity = 3500 used_percent = 50 used_mAh = (used_percent / 100) * capacity result = used_mAh return result
Student: A house is 150 meters away from a grocery store. If Lydia drives the same distance to the grocery store and back, what is the total distance driven?
def solve() -> int: distance = 150 total_distance = distance * 2 result = total_distance return result
Janice sells car parts and earns $19 every hour. After working for 7 hours, she earned $142. How many hours did she work last week if she earned $954?
def solve() -> int: hourly_rate = 19 hours_worked = 954 / hourly_rate result = round(hours_worked) return result
Alex bikes 8 miles round-trip to work, where he drinks a can of soda with 150 calories. If Alex burns 100 calories per mile biked, what's Alex's net calorie deficit (expressed as a positive number)?
def solve() -> int: distance = 8 calories_per_mile = 100 calories_consumed = distance * calories_per_mile calories_intake = 150 net_calorie_deficit = calories_consumed - calories_intake result = abs(net_calorie_deficit) return result
A rectangular garden is 20 feet long and 10 feet wide. If a fence costs $2 per foot, how much will it cost to build a fence around the garden?
def solve() -> int: garden_perimeter = 2 * (20 + 10) fence_cost = garden_perimeter * 2 result = fence_cost return result
has just bought 3 shelves and 84 books. She wants to evenly distribute the books among the shelves but has 4 extra books at the end of filling it. How many books should she place on each shelf?
def solve() -> int: n =84/3 result = round(n) return result
Student: Michael wants to buy a phone and a case. The phone costs $1000. The case costs $25 more than 10% of the phone cost. How much did he pay for everything?
def solve() -> int: phone_cost = 1000 case_cost = 0.1 * phone_cost + 25 total_cost = 0 total_cost = phone_cost + case_cost result = total_cost return result
A kite is flying at a height of 200 meters. It gets caught in a tree and falls, reducing its height by 60%. How high was the kite after it fell? At a certain hair salon, customers are being charged an extra fee for shampooing and conditioning without their knowledge. If Jane's total bill was $72 and the extra fee was 1...
def solve() -> int: kite_height = 200 reduction_percentage = 60 reduction = kite_height * reduction_percentage / 100 new_height = kite_height - reduction haircut_price = 40 hidden_fee_percentage = 15 hidden_fee = haircut_price * hidden_fee_percentage / 100 total_bill ...
Jordan worked at the grocery store for four weeks and earned $448. What was his average pay per week?
def solve() -> int: total_money = 448 total_weeks = 4 result = total_money / total_weeks return result
Student: In a month, there are 4 Fridays and 4 Tuesdays, Donald runs 4 miles on Monday, 5 miles on Tuesday and 6 miles on Friday. How many miles will he run in a month?
def solve() -> int: monday_miles = 4 tuesday_miles = 5 friday_miles = 6 total_miles = monday_miles * 4 + tuesday_miles * 4 + friday_miles * 4 result = total_miles return result
The grocery store has 6 bags of apples, each bag containing 20 apples. If they want to make 10 apple pies with equal number of apples in each pie, how many apples will each pie have?
def solve() -> int: bags_of_apples = 6 apples_per_bag = 20 total_apples = bags_of_apples * apples_per_bag pies = 10 apples_per_pie = total_apples / pies result = apples_per_pie return result
John has 4 pencils and he wants to divide them equally among his 2 best friends. How many pencils will each friend get?
def solve() -> int: pencils = 4 friends = 2 equal_division = pencils / friends result = equal_division return result
A recipe for cookies calls for 2/3 cup of sugar for every 2 cups of flour. If you have 6 cups of flour, how much sugar do you need?
def solve() -> int: sugar_ratio = (2/3)/2 total_sugar = sugar_ratio * 6 result = total_sugar return result
If Sarah's earnings are 90% of what it used to be and Daniel's income is now three times what Sarah used to make, and Sarah's old income was $5000, what is their combined salary now?
def solve() -> int: sarah_old_income = 5000 sarah_new_income = sarah_old_income * 0.9 daniel_income = sarah_old_income * 3 combined_salary = sarah_new_income + daniel_income result = combined_salary return result
Ava has 500 books. She decides to sell them and use the money to buy movies. Each book sells for $1. A movie costs $3. If she buys 200 movies, how much money does she have left over?
def solve() -> int: books = 500 book_price = 1 movies = 200 movie_price = 3 total_money_from_books = books * book_price total_cost_of_movies = movies * movie_price leftover_money = total_money_from_books - total_cost_of_movies result = leftover_money return result
Possible questions and programs are: Tanner wants to make a fruit salad for his family. He needs 2 apples, 3 bananas, and 4 oranges. He has $20 in his wallet. If apples cost $1 each, bananas cost $0.5 each, and oranges cost $0.75 each, how much money will Tanner have left over?
def solve() -> int: apples = 2 bananas = 3 oranges = 4 money = 20 apple_cost = apples * 1 banana_cost = bananas * 0.5 orange_cost = oranges * 0.75 total_cost = apple_cost + banana_cost + orange_cost money_left = money - total_cost result = money_left return result
Lucas goes to the store to buy 9 jars of peanut butter that are "buy one get one half off" and each jar costs $4.00. How much is the final cost of the peanut butter? Last month, the Orchard Farm harvested 2500 kilograms of apples, while the Apple Grove harvested 1750 kilograms of apples. How many fewer kilograms of app...
def solve() -> int: jars = 9 cost_per_jar = 4.00 total_cost = (jars * cost_per_jar) * 0.75 orchard_farm = 2500 apple_grove = 1750 difference = orchard_farm - apple_grove result = total_cost - difference return result
Student: In a village, there are 4 cats and 5 dogs. The village adds 2 cats and 3 dogs. How many animals are there now?
def solve() -> int: cats = 4 dogs = 5 cats += 2 dogs += 3 total_animals = cats + dogs result = total_animals return result
Lucas has five times as many video games as Max has. If Max has six video games, how many video games does Lucas have?
def solve() -> int: max_games = 6 lucas_games = 5 * max_games result = lucas_games return result
A classroom has 24 desks and 10 students move to the class. If each student needs a desk, how many additional desks need to be brought in?
def solve() -> int: class_desks = 24 new_students = 10 total_students = class_desks + new_students additional_desks = total_students - class_desks result = additional_desks return result
A small business owner made a total of $5000 in 3 months. If he made $2000 in the first month and $1500 in the second month, how much did he make in the third month?
def solve() -> int: total = 5000 first_month = 2000 second_month = 1500 third_month = total - (first_month + second_month) result = third_month return result
A fast-food restaurant gave out free meals for the first three days of its opening. On the first day, they gave out 2500 meals. The second day, they only gave out 70% of the meals they provided the previous day because of limited food supplies. On the third day, they gave out 1.5 times more meals than they did on the f...
def solve() -> int: first_day = 2500 second_day = first_day * 0.7 third_day = first_day * 1.5 total_meals_given = first_day + second_day + third_day result = second_day result return result
At the veterinary clinic, there are 36 cats and 60 dogs. If the vet sells 1/5 of the cats and 1/3 of the dogs, how many animals will remain with the vet?
def solve() -> int: cats_num = 36 dogs_num = 60 cats_sold = 1/5 * cats_num dogs_sold = 1/3 * dogs_num animals_remain = cats_num - cats_sold + dogs_num - dogs_sold result = animals_remain return result
Student: Travis and his friends sailed 5 miles away from the shore of an island. They are now 1 mile away from the nearest shore. How far away from the initial shore are they now?
def solve() -> int: initial_shore = 0 distance_sailed = 5 distance_now = 1 result = initial_shore + distance_sailed - distance_now return result
Joel bought 18 bottles of kombucha, each bottle has 250ml of drink. How many liters of kombucha did Joel buy?
def solve() -> int: bottles = 18 ml = 250 liters = bottles * ml / 1000 result = liters return result
Rico can fill up his swimming pool in 6 days by working 10 hours per day. How many hours will it take him to fill the pool in 4 days?
def solve() -> int: days = 4 daily_hours = 10 total_hours = days * daily_hours result = 40.0 return result
Benjamin, Elijah, and Lucas played a game and held a contest to see who could solve the most math problems in 20 minutes. Benjamin solved 18 problems. Elijah solved 3 problems less than Benjamin did, and Lucas solved 8 problems less than Elijah did. How many problems did Lucas solve?
def solve() -> int: benjamin = 18 elijah = benjamin - 3 lucas = elijah - 8 result = lucas return result
A runner trains for a marathon. The first week he runs 10 kilometers. The second week he runs 5 times as much as the first week, and the third week he runs 8 kilometers less than twice the sum of the first two weeks. How much does he run on the third week?
def solve() -> int: week1 = 10 week2 = 5 * week1 sum1 = week1 + week2 week3 = 2 * sum1 - 8 result = week3 return result
Terry wants to save money for a new car. He plans to save $500 per month for the next year and then make a down payment. Assuming he puts his money in a savings account that has an annual interest rate of 3%, how much money will he have in total at the end of the year?
def solve() -> int: monthly_savings = 500 num_months = 12 interest_rate = 0.03 total_savings = sum([monthly_savings * (1 + interest_rate / 12)**i for i in range(num_months)]) result = total_savings return result
10. A company has 7 departments with 10 employees each. How many employees work in the company in total?
def solve() -> int: num_departments = 7 employees_per_department = 10 total_employees = num_departments * employees_per_department result = total_employees return result
A company makes 3 types of products: A, B, and C. Product A requires twice as many labor hours as product B. Product B requires 3 times as many labor hours as product C. If product A requires 90 labor hours, how many labor hours does product C require?
def solve() -> int: hrs_productB = 90/2 hrs_productC = hrs_productB/3 result = hrs_productC return result
Matt was decorating his house for his upcoming birthday party. He bought 8 rolls of streamers, 5 of which were red and 3 were blue. Each roll contains 15 feet of streamers. How many feet of blue streamers did Matt buy?
def solve() -> int: number_of_rolls = 8 red_rolls = 5 blue_rolls = 3 feet_per_roll = 15 total_feet_blue_streamers = blue_rolls * feet_per_roll result = total_feet_blue_streamers return result
A bag contains 360 jelly beans. If a third of the bag has 16 jelly beans and one jelly bean has 4 stripes, how many stripes are in a third of a jelly bean?
def solve() -> int: bag_total = 360 jelly_beans_third = 16 stripes_per_jelly_bean = 4 stripes_per_third_jelly_bean = stripes_per_jelly_bean * (jelly_beans_third / bag_total) result = stripes_per_third_jelly_bean return result
A car travels at a speed of 50 miles per hour. How far can the car go in 3 hours?
def solve() -> int: speed = 50 time_hours = 3 distance = speed * time_hours result = distance return result