question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Carol buys a cake. She then buys a box of cookies that is 4 times the price of the cake. Then, she buys a pie that is 6 times the price of the box of cookies. If Carol paid $648 for all these items, what is the price of the pie?
def solve() -> int: x = 648 / 29 result = x * 24 return result
A box contains 10 apples and 5 oranges. Henry removes 4 oranges and 3 apples. What fraction of the original contents remained?
def solve() -> int: total_fruit = 10+5 oranges_removed = 4 apples_removed = 3 remained_fruit = total_fruit - (oranges_removed + apples_removed) result = remained_fruit/(total_fruit) return result
Lisa has twice as many books as Dave. If Dave has 20 books, how many books do they both have combined?
def solve() -> int: dave = 20 lisa = dave * 2 total_books = dave + lisa result = total_books return result
Harry bought three potted plants at $4.50 each, two books at $17.50 each, and a set of gardening tools at $25. How much change did he get when he paid with a $50 bill?
def solve() -> int: total_price = 4.5 * 3 + 17.5 * 2 + 25 change = 50 - total_price result = change return result
Alan has 500 books in his room. He wants to buy 5 new shelves to store them in. Each shelf costs $20. How much money must Alan spend on the shelves?
def solve() -> int: number_of_shelves_needed = 5 price_of_each_shelf = 20 total = number_of_shelves_needed * price_of_each_shelf result = total return result
John had 540 stamps and he used them to decorate 5 envelopes. How many stamps did he use to decorate each envelope?
def solve() -> int: total_stamps = 540 num_envelopes = 5 stamps_per_envelope = total_stamps//num_envelopes result = stamps_per_envelope return result
Crown Public School has 40 students, 2 teachers and 7 classes. How many people are there in total in Crown Public School?
def solve() -> int: total_people = 0 total_people = 40 + 2 total_people += 7 * 20 result = total_people return result
Jane is going to the beach for 5 hours. She spends 50 minutes buying sunscreen, an hour playing frisbee, and 25 minutes changing into her swimsuit. How many more minutes does she have left to lay in the sun?
def solve() -> int: beach_time = 300 sunscreen_time = 0.83 frisbee_time = 1 changing_time = 0.42 suntanning_time = beach_time - sunscreen_time - frisbee_time - changing_time result = suntanning_time return result
The total for the sum and product of Rachel's age and John's age are 182. If Rachel's age is 13, how old is John?
def solve() -> int: rachel_age = 13 total = 182 product = total - rachel_age**2 john_age = product / (2*rachel_age) result = john_age return result
Student: A birch tree has 430 leaves when fall starts. Each day it loses two fifths of the staying leaves from the day before. How many leaves has it lost in total by the end of the fourth day?
def solve() -> int: leaves_start = 430 fraction_lost = 2/5 leaves_lost_1 = leaves_start * fraction_lost leaves_lost_2 = (leaves_start - leaves_lost_1) * fraction_lost leaves_lost_3 = (leaves_start - leaves_lost_1 - leaves_lost_2) * fraction_lost leaves_lost_4 = (leaves_start - leaves_lost_1 - le...
A toy store is delivering 400 stuffed animals to a hospital, and each animal is either a teddy bear or a bunny or a mix of both. Out of the 400 animals, 100 are teddy bears, 120 are bunnies, and the rest are a mix of both types. If the hospital wants to distribute half the number of each type of animal to the first 20 ...
def solve() -> int: total_animals = 400 teddy_bears = 100 bunnies = 120 mix = total_animals - teddy_bears - bunnies half_teddy_bears = teddy_bears / 2 half_bunnies = bunnies / 2 half_mix = mix / 2 animals_per_child = (half_teddy_bears + half_bunnies + half_mix) / 20 re...
A company has 4 teams. Each team consists of 10 members. If each member works 8 hours a day, how long, in hours, will it take for all the teams to complete a project that requires 300 hours of work?
def solve() -> int: team_count = 4 members_per_team = 10 hours_per_day = 8 project_hours = 300 total_members = team_count * members_per_team total_hours = total_members * hours_per_day days_to_complete = project_hours / total_hours hours_to_complete = days_to_complete * 24 ...
Mason is a chef at a restaurant, and he plans to make pizzas all day. The restaurant has given him a 50lb sack of flour to use for the pizzas. It takes him 8 minutes to prepare each pizza, and he has a 10-hour shift. If each pizza requires 0.75lb of flour, how many pizzas can Mason prepare with the flour left?
def solve() -> int: flour_sack = 50 flour_per_pizza = 0.75 minutes_per_pizza = 8 shift_hours = 10 flour_used = (shift_hours * 60) / minutes_per_pizza * flour_per_pizza pizzas_prepared = flour_sack // flour_per_pizza flour_left = flour_sack - flour_used pizzas_left = pizzas_prep...
A pencil has a length of 15 cm. A pen has a length of 2 cm more than a pencil. A ruler has a length of 3 times as much as a pen. How long is the ruler?
def solve() -> int: pencil_length = 15 pen_length = pencil_length + 2 ruler_length = pen_length * 3 result = ruler_length return result
Student: Jennifer has 8 friends and wants to buy 3 packets of candy. If each packet contains 10 candies, how many more candies should she buy so that each friend gets an equal number of candies?
def solve() -> int: num_friends = 8 num_packets = 3 candies_per_packet = 10 total_candies = num_packets * candies_per_packet candies_per_friend = total_candies // num_friends extra_candies = num_friends * candies_per_friend - total_candies result = extra_candies return result
Jack rode his bicycle for 50 km at the rate of 20 km/hr and then 60 km at the rate of 30 km/hr. Calculate his average speed for the entire trip.
def solve() -> int: distance1 = 50 rate1 = 20 distance2 = 60 rate2 = 30 total_distance = distance1 + distance2 total_time = distance1/rate1 + distance2/rate2 average_speed = total_distance/total_time result = average_speed return result
Student: David has a coupon for a free pizza at a local restaurant. The pizza normally costs $12.99 and has 8 slices. David decides to share the pizza with two friends and also orders three drinks for $1.99 each. He leaves a 15% tip on the total bill. How much does he pay for the meal in dollars total?
def solve() -> int: pizza_cost = 12.99 pizza_slices = 8 friends = 2 drink_cost = 1.99 tip_rate = 0.15 subtotal = pizza_cost + (drink_cost * (friends + 1)) subtotal = subtotal - pizza_cost tip = subtotal * tip_rate total = subtotal + tip result = total return result
``` If the area of a triangle is calculated by A = (b*h)/2, where b is the base of the triangle and h its height, and a triangle has a base of 5 cm and a height of 15 cm, what is its area?
def solve() -> int: base = 5 height = 15 area = (base * height) / 2 result = area return result
Marie is preparing for a dance competition. She practices for 3 hours every other day and takes a 1-hour ballet class twice a week. How many hours per week does Marie spend training for the competition?
def solve() -> int: days_per_week = 7 hours_per_day = 24 practice_hours = 3 ballet_class_hours = 1 practice_days_per_week = days_per_week // 2 ballet_class_days_per_week = 2 practice_hours_per_week = practice_hours * practice_days_per_week ballet_class_hours_per_week = bal...
Student: A square piece of paper has a perimeter of 20 cm. What is the area of the square?
def solve() -> int: perimeter = 20 side = perimeter / 4 area = side ** 2 result = area return result
Alice and Bob are collecting stickers. Alice has 200 stickers and gives 25% of them to Bob. Bob has 150 stickers and gives 20% of them to Alice. How many stickers does Alice have after the exchange?
def solve() -> int: Alice_stickers = 200 Bob_stickers = 150 Alice_give = 0.25 Bob_give = 0.20 Alice_give_num = Alice_stickers * Alice_give Bob_give_num = Bob_stickers * Bob_give Alice_final = Alice_stickers - Alice_give_num + Bob_give_num result = Alice_final return result
Cathy is a baker. She needs to buy cake stands and ribbons for the cake decorations. Each cake stand costs $5, and each roll of ribbon costs $20. For each order of 2 cake stands, the store offers a 25% discount, and for each order of 4 ribbon rolls, the store offers a 15% discount. If Cathy wants to buy 6 cake stands a...
def solve() -> int: cake_stand_cost = 5 ribbon_roll_cost = 20 discount_factor1 = 0.25 discount_factor2 = 0.15 num_stands = 6 num_ribbons = 8 total_cost = (num_stands*cake_stand_cost) + (num_ribbons*ribbon_roll_cost) if (num_stands >= 2): discount1 = discount_factor1*(num_stands*c...
The deepest lake can hold 100 times the volume of water as the shallowest lake. The deepest lake can hold 23,000 cubic kilometers of water. How much more water can the deepest lake hold than the shallowest lake?
def solve() -> int: volume_shallow = 23000 / 100 volume_difference = 23000 - volume_shallow result = volume_difference return result
John runs a 5K race in 25 minutes. He finished the first half of the race in 12 minutes. What was his pace for the second half of the race in minutes per mile?
def solve() -> int: total_distance = 5 total_time = 25 first_half_time = 12 second_half_time = total_time - first_half_time second_half_distance = total_distance - (total_distance / 2) pace = second_half_time / second_half_distance result = pace return result
Tom and his girlfriend rented a car for the weekend for $400. They agreed to split the cost based on the number of miles they drive. Tom will drive 100 miles, and his girlfriend will drive 200 miles. How much should Tom pay?
def solve() -> int: total_miles = 100 + 200 tom_share = 100/total_miles * 400 result = tom_share return result
A donation fund started with a balance of $5000. After receiving a donation of $2000, the balance increased by 25%. What is the new balance of the fund?
def solve() -> int: balance_start = 5000 donation = 2000 balance_after_donation = balance_start + donation increase_percentage = 0.25 increase = balance_after_donation*increase_percentage new_balance = balance_after_donation + increase result = new_balance return result
hannon went to the hardware store and bought 3 hammers for $7.00 each, 2 saws for $10.00 each, and 4 boxes of nails for $3.00 each. How much did Shannon spend?
def solve() -> int: items = [(3,7.00),(2,10.00),(4,3.00)] total_spent = 0 for item in items: num_item, price = item[0], item[1] total_spent += (num_item*price) result = total_spent return result
Student: Doug had three 4-hour shifts at work this week and earned $11.50 per hour. How much did Doug earn this week?
def solve() -> int: shifts = 3 hours_per_shift = 4 hourly_rate = 11.5 total_hours = shifts * hours_per_shift total_earnings = total_hours * hourly_rate result = total_earnings return result
If a grocery store buys 20 cartons of milk for $15 per carton and sells each carton for $20. If there are a little less than 24 cartons in each fridge and they earn 80% profit per fridge, how many fridges do they need to sell to break even?
def solve() -> int: cartonsFCost=20*15 cartonsFSales=20*20 fridgeProfit=cartonsFSales*0.8-cartonsFCost numberOfCartonsInFridge=24 numberOfFridges = 254 / numberOfCartonsInFridge result = f'<<<{round(numberOfFridges)}>>>' result = round(numberOfFridges) return result
Lily has a collection of stickers. She bought 50 new stickers on Monday and gave away 10 stickers to her friends on Tuesday. On Wednesday, she traded 15 stickers with her brother for 20 of his stickers. How many stickers does Lily have at the end of Wednesday?
def solve() -> int: stickers = 0 stickers = stickers + 50 stickers = stickers - 10 stickers = stickers - 15 + 20 result = stickers return result
In a school, there are 5 classes and each class has 25 students. If each student has 2 textbooks and 3 notebooks, how many textbooks and notebooks are there in the school in total?
def solve() -> int: students_per_class = 25 num_of_classes = 5 textbooks_per_student = 2 notebooks_per_student = 3 total_textbooks = students_per_class * num_of_classes * textbooks_per_student total_notebooks = students_per_class * num_of_classes * notebooks_per_student result = total_textbo...
Cano has exactly 300 pieces of Lego blocks, out of which one-fifth are red. How many red blocks does Cano have?
def solve() -> int: num_lego = 300 red_portion = 1/5 num_red_blocks = num_lego * red_portion result = 60 return result
A recipe calls for 3/4 cup of sugar to make 12 cookies. If you want to make 24 cookies, how much sugar will you need?
def solve() -> int: sugar_per_cookie = 3/4 num_cookies = 24 total_sugar = sugar_per_cookie * num_cookies result = total_sugar return result
A car is traveling at 40 miles per hour. How many kilometers per hour is it traveling (1 mile = 1.6 kilometers)?
def solve() -> int: speed_mph = 40 speed_kph = speed_mph * 1.6 result = speed_kph return result
A company sells t-shirts for $20 each and hats for $15 each. If they made $1500 from selling 70 items in total, how many t-shirts did they sell?
def solve() -> int: num_items = 70 total_revenue = 1500 tshirt_price = 20 hat_price = 15 num_tshirts = (total_revenue - num_items*hat_price)/(tshirt_price - hat_price) result = num_tshirts return result
Jenny wants to lose weight and she decides to start by increasing her total exercise minutes by 30% every week. Currently, she exercises 150 minutes each week. How many more minutes does she need to exercise per week in the next month to reach her goal?
def solve() -> int: current_minutes = 150 increase_percentage = 0.30 weeks_in_month = 4 increase_minutes = current_minutes * increase_percentage total_increase_minutes = increase_minutes * weeks_in_month target_minutes = current_minutes + total_increase_minutes additional...
Tom wants to buy a new car. He trades in his old car and receives 90% of its value which is $7000. He pays $25,000 and gets back $200 in change. What is the cost of the new car? Carla and Maria are swimming a race against each other. At the beginning of the race they are even with each other for 100 meters. Then Carla ...
def solve() -> int: old_car_value = 7000 trade_in_value = old_car_value * 0.9 total_payment = 25000 change = 200 new_car_cost = total_payment - change - trade_in_value remaining_distance = 2000 - (100 + 200 + 140 + 300) result = new_car_cost result = remaining_distance ...
The number of customers visiting a store changed significantly over seven days. On Monday, the store had 50 customers, it received 70 customers on Tuesday, 30 customers on Wednesday, 90 customers on Thursday, 80 customers on Friday, and welcomed 40 customers on Saturday. What was the average number of customers visitin...
def solve() -> int: monday = 50 tuesday = 70 wednesday = 30 thursday = 90 friday = 80 saturday = 40 total_customers = monday + tuesday + wednesday + thursday + friday + saturday average_customers = total_customers / 7 result = average_customers return result
Student: If a car's fuel tank holds 45 liters of gasoline and can only travel 18 km per liter, how far can the car travel on one full tank of fuel?
def solve() -> int: fuel_tank = 45 fuel_efficiency = 18 distance = fuel_tank * fuel_efficiency result = distance return result
Student: Sarah has 7 apples and if she eats half of them, what is the remaining number of apples?
def solve() -> int: apples = 7 apples = apples / 2 result = apples return result
A recipe calls for 2 cups of sugar to bake 24 cookies. How much sugar is needed to bake 60 cookies?
def solve() -> int: sugar_per_cookie = 2/24 cookies_needed = 60 sugar_needed = sugar_per_cookie*cookies_needed result = sugar_needed return result
A bakery made 75 cupcakes and sold 60. What percentage of cupcakes did they sell?
def solve() -> int: total_cupcakes = 75 cupcakes_sold = 60 percentage_sold = (cupcakes_sold / total_cupcakes) * 100 result = percentage_sold return result
Mr. Patel has 10 packs of pencils. Each pack has 20 pencils. He used 12 pencils for his project and gave 3 packs to his students. How many pencils does he have left?
def solve() -> int: total = 10 * 20 used = 12 gave = 3 * 20 remaining = total - used - gave result = remaining return result
Lisa bakes 3 cakes for her friends and 2 times as many cakes for her family. How many slices of cake does she make if each cake has 8 slices?
def solve() -> int: cakes_for_family = 3 * 2 cakes_in_total = 3 + cakes_for_family slices_in_total = cakes_in_total * 8 result = slices_in_total return result
A school has a total of 450 students. If the ratio of boys to girls is 3:4, how many girls are there in the school?
def solve() -> int: total_students = 450 boy_ratio = 3 girl_ratio = 4 total_ratio = boy_ratio + girl_ratio num_of_girls = (girl_ratio/total_ratio) * total_students result = num_of_girls return result
If 8 erasers were bought, how many pencils were bought?
def solve() -> int: number_erasers = 8 number_pencils = (number_erasers - 4) / 5 result = number_pencils return result
Student: Ryan has 4 packs of pens with 8 pens in each pack, and Jamie has 5 packs of pens with 10 pens in each pack. How many more pens does Jamie have than Ryan?
def solve() -> int: ryan_packs = 4 ryan_pens = 8 jamie_packs = 5 jamie_pens = 10 ryan_total = ryan_packs * ryan_pens jamie_total = jamie_packs * jamie_pens difference = jamie_total - ryan_total result = difference return result
Student: A library has 500 books. 100 of those books are non-fiction. What percentage of the books are non-fiction?
def solve() -> int: total_books = 500 non_fiction_books = 100 percentage = non_fiction_books / total_books * 100 result = percentage return result
Question 3 : A company produces 1200 books in a day and each employee works for 8 hours in a day. If every employee can produce 15 books in an hour, how many employees does the company have?
def solve() -> int: books_per_day = 1200 employee_productivity = 15 employee_workhours = 8 books_per_employee_per_day = employee_productivity * employee_workhours number_of_employees = books_per_day // books_per_employee_per_day result = number_of_employees return result
Kaitlyn had 15 stuffed animals. She left them at a friend's house and they lost 4 of them. Later, 2/5 of the remaining stuffed animals were donated to a children's charity. How many stuffed animals does she have left?
def solve() -> int: stuffed_animals = 15 lost_animals = 4 remaining_animals = stuffed_animals - lost_animals donated_animals = (2/5) * remaining_animals animals_left = remaining_animals - donated_animals result = animals_left return result
Jack has 3 more stickers than Jill. Jill has 2 times as many stickers as Sarah. If Sarah has 11 stickers, how many stickers does Jack have?
def solve() -> int: stickers_Sarah = 11 stickers_Jill = 2*stickers_Sarah stickers_Jack = stickers_Jill + 3 result = stickers_Jack return result
Mark bought 10 boxes of nails and each box has 12 nails. How many nails did Mark buy in total?
def solve() -> int: number_boxes = 10 number_nails_per_box = 12 total_num_nails = number_boxes * number_nails_per_box result = total_num_nails return result
Student: A car traveled 300 miles in 5 hours. What was the average speed of the car in miles per hour?
def solve() -> int: distance = 300 time = 5 speed = distance / time result = speed return result
Brianna is building a fence around her rectangular backyard. She needs 4 posts for each corner and 3 posts for every meter of length or width. Her backyard is 12 meters long and 9 meters wide. If each post costs $15, how much money will she spend on the fence posts in total?
def solve() -> int: posts_length = 4 + 3 * 12 posts_width = 4 + 3 * 9 total_posts = posts_length + posts_width cost = total_posts * 15 result = cost return result
Rachel has 120 stickers. She decided to give 30 to her little sister. She then bought another 40 stickers and lost 5. How many stickers does Rachel have now?
def solve() -> int: stickers = 120 stickers -= 30 stickers += 40 stickers -= 5 result = stickers return result
Ms. Rodriguez pays her gym membership quarterly at $180. She also pays a one-time enrollment fee of $50 when she joins the gym. How much does she pay in the first year for the gym membership?
def solve() -> int: fee = 180 enroll = 50 quarters = 4 yearly = fee * quarters total = yearly + enroll result = total return result
Jane invested $1,500 in a mutual fund with an annual interest rate of 4.75%. How much money will she have in her account after 5 years?
def solve() -> int: principal = 1500 interest_rate = 0.0475 time_years = 5 mutual_fund_total = principal * (1 + interest_rate)**time_years result = mutual_fund_total return result
Erin can chop 15 eggplants, 8 carrots, and 12 potatoes in a day. If she works 3 days a week, how many vegetables can she chop in 2 months?
def solve() -> int: eggplant = 15 carrot = 8 potato = 12 total_day = eggplant + carrot + potato day = 3 week = 4 month = 2 result = total_day * day * week * month return result
A grocery store has 50 apples and 25 oranges. What percentage of the fruit is apples?
def solve() -> int: total_fruit = 50 + 25 apple_percentage = (50/total_fruit)*100 result = apple_percentage return result
Emily is preparing gift boxes for a party. She needs to prepare 25 gift boxes, and each box requires 8 candies, 12 chocolates, and 3 toys. How many total items does Emily need to prepare all the gift boxes?
def solve() -> int: gift_boxes = 25 candies_per_box = 8 chocolates_per_box = 12 toys_per_box = 3 total_items = (candies_per_box + chocolates_per_box + toys_per_box) * gift_boxes result = total_items return result
Beth has 10 dimes, 15 nickels, and 20 quarters. How much money does Beth have?
def solve() -> int: dimes = 10 * 0.1 nickels = 15 * 0.05 quarters = 20 * 0.25 total_cash = dimes + nickels + quarters result = f'Beth has ${total_cash} in cash.' result = total_cash return result
Student: Tommy earned $600 by cleaning the neighborhood's cars. He spent 1/5 of his earnings on new cleaning supplies. Calculate the amount of money Tommy has left, and if he decides to give his sister 1/3 of the money he has left, calculate how much he will have left afterwards.
def solve() -> int: earnings = 600 supplies = earnings / 5 left = earnings - supplies sister = left / 3 final = left - sister result = left result = final return result
A bakery made 150 pies. 70 of the pies were apple, and the rest were cherry. What percentage of the pies were cherry?
def solve() -> int: num_apple_pies = 70 num_cherry_pies = 150 - num_apple_pies percent_cherry_pies = (num_cherry_pies/150) * 100 result = percent_cherry_pies return result
A rectangular room has a width of 10 feet and a length of 15 feet. How much carpet is needed to cover the entire floor?
def solve() -> int: area = 10 * 15 result = area return result
Possible math questions similar to the example: Dora, Elena, and Faye collect stickers for their albums. Dora has 12 more stickers than Elena, but Elena has 3 times as many stickers as Faye. If Faye has 27 stickers, how many stickers do they have altogether?
def solve() -> int: Dora = 0 Elena = 0 Faye = 27 Elena = Faye * 3 Dora = Elena + 12 result = Dora + Elena + Faye return result
If it costs $70 to produce a product and it sells for $100, how many products need to be sold to make a profit of $10,000?
def solve() -> int: costs = 70 sale = 100 profit = 10000 quantity = profit/(sale - costs) result = quantity return result
``` If you have $500 in your savings account and you save $25 every week, how many weeks until you have $1500 in savings?
def solve() -> int: saved_amount = 500 goal_amount = 1500 weekly_savings = 25 weeks_elapsed = (goal_amount - saved_amount) / weekly_savings result = weeks_elapsed return result
Jack needs to buy 8 sport balls and 4 tennis racquets, if each sport ball costs $50 and each tennis racquet costs 19% more than each sport ball, how much money does Jack need in total?
def solve() -> int: sport_balls = 50 multiplier = 1.19 number_of_sport_balls = 8 number_of_tennis_racquets = 4 total_price = (number_of_sport_balls * sport_balls) + (number_of_tennis_racquets * (sport_balls * multiplier)) result = total_price return result
Laura bought 2 packets of chips which cost €3 each and a packet of biscuits for €2.50. How much did her total spend?
def solve() -> int: cost_chip = 3 cost_biscuit = 2.50 number_chip = 2 total_cost = cost_chip*number_chip + cost_biscuit result = total_cost return result
Jack bought 6 candy bars for $3.50. How much did each candy bar cost?
def solve() -> int: a = 3.5 b = 6 cost = a / b result = cost return result
Nathan has a box of 25 markers and two more boxes with 17 markers each. How many markers does he have in total?
def solve() -> int: numMarkers = 25 numMarkers2 = 17 totalMarkers = numMarkers + (numMarkers2 * 2) result = totalMarkers return result
Emily has 70 markers. She uses 28 of them to color a picture, then gives 12 to her sister. If she still has 30 markers, how many markers did she have before?
def solve() -> int: x = 0 x = 70 x -= 28 x -= 12 if x == 30: result = x return result
The area of a square is 64 cm². What is the length of one side of the square?
def solve() -> int: area = 64 side_length = area ** 0.5 result = side_length return result
Amy and her brother collected stamps from different countries. They had 240 stamps in total, of which 60% were from Asia. They bought 40 more stamps from a store, of which 75% were from Africa. What is the percentage of stamps from Asia in their new collection?
def solve() -> int: stamps_from_asia_before = 0.6 * 240 stamps_from_africa_after = 0.75 * 40 total_stamps_after = 240 + 40 stamps_from_asia_after = stamps_from_asia_before + (40 - stamps_from_africa_after) percentage_from_asia = (stamps_from_asia_after / total_stamps_after) * 100 result = percen...
Here are some possible questions and programs: Alma and Ben collected and sold seashells to buy a new board game. Alma collected 72 seashells and sold them at $0.25 each while Ben collected 60 seashells and sold them at $0.30 each. If they need $18 to buy the game, how much more money do they need to earn?
def solve() -> int: alma_earn = 72 * 0.25 ben_earn = 60 * 0.30 total_earn = alma_earn + ben_earn game_cost = 18 money_needed = game_cost - total_earn result = money_needed return result
A construction worker can lay 5 bricks in 10 minutes. How many bricks can they lay in 3 hours?
def solve() -> int: bricks_per_time = 5 time_available = 180 total_bricks = bricks_per_time * (time_available/10) result = total_bricks return result
A gym has 50 members. The average number of reps completed by each member is four times the number of sets they do. If each member completes 10 sets per week, what is the total number of reps completed by the gym in a week?
def solve() -> int: members = 50 sets_per_week = 10 average_reps_per_set = 4 total_reps_per_week = members * sets_per_week * average_reps_per_set result = total_reps_per_week return result
Possible new questions are: Camila bought a pizza for $12 and shared it with two friends. She paid a $3 tip and each friend gave her $5. How much money did Camila have left after the pizza?
def solve() -> int: pizza_cost = 12 tip = 3 friend_payment = 5 total_cost = pizza_cost + tip total_payment = friend_payment * 2 money_left = total_payment - total_cost result = money_left return result
A digital camera costs $299.99, but is on sale for 20% off. What is the final price?
def solve() -> int: discount = 299.99*0.2 final_price = 299.99 - discount result = final_price return result
A school has 400 students. If 120 students play soccer and 150 students play basketball, how many students don't play either sport?
def solve() -> int: students = 400 soccer = 120 basketball = 150 neither = students - soccer - basketball result = neither return result
A stadium has 120 sections. If each section has 128 seats and 6,756 people attended the game, how many seats were empty?
def solve() -> int: num_sections = 120 num_seats_per_section = 128 num_people_attended = 6756 total_num_seats = num_sections * num_seats_per_section num_seats_occupied = num_people_attended num_seats_empty = total_num_seats - num_seats_occupied result = num_seats_empty ret...
Jack had 80 stickers to give to his classmates. Half of the stickers were smiley faces, and the rest were equally divided into hearts, stars, and unicorns. How many stickers were unicorns? A cat's tail is two-fifths the length of its body and its head is one-eighth the length of its body. If the cat is 24 inches long o...
def solve() -> int: stickers_total = 80 smiley_faces = stickers_total / 2 other_stickers = stickers_total / 2 unicorns = other_stickers / 3 cat_length = 24 body_length = cat_length * (5/8) head_length = body_length * (1/8) result = unicorns result = head_length ...
A rectangular box has dimensions 6 in. x 8 in. x 10 in. What is the volume of the box in cubic inches?
def solve() -> int: length = 6 width = 8 height = 10 volume = length * width * height result = f'The volume of the box is {volume} cubic inches.' result = volume return result
David has 30 shoes. He has 5 sets of matching shoes and the others don't match. How many shoes does David have that don't match?
def solve() -> int: total_shoes = 30 matching_sets = 5 matching_shoes = matching_sets * 2 non_matching_shoes = total_shoes - matching_shoes result = non_matching_shoes return result
Student: A restaurant has 55 tables. Each table has 3 chairs. How many chairs are in the restaurant?
def solve() -> int: tables = 55 chairs_per_table = 3 total_chairs = tables * chairs_per_table result = total_chairs return result
Sarah has 60 marbles. She gives away 25% of them to her friend, then losses 8 to her little brother's playful antics. How many marbles does she have left?
def solve() -> int: marbles = 60 give_away = marbles * 0.25 remaining = marbles - give_away - 8 result = remaining return result
Student: Mary bought some fruits for her family. Apples cost $3 per apple, oranges cost $2 each, and bananas cost $5 per bunch. How much did Mary spend if she bought 5 apples, 3 oranges, and 4 bunches of bananas?
def solve() -> int: apple_cost = 3 orange_cost = 2 banana_cost = 5 num_apples = 5 num_oranges = 3 num_bananas = 4 total_cost = apple_cost * num_apples + orange_cost * num_oranges + banana_cost * num_bananas result = total_cost return result
Blake filled two buckets with water, one is two-thirds full and the other is one-third full. The combined capacity of the two buckets is 24 gallons. How much water is in the two buckets totally?
def solve() -> int: cap_larger_bucket = 24 / (1/3 + 2/3) cap_smaller_bucket = cap_larger_bucket / 3 total_water = (2 * cap_larger_bucket) + (cap_smaller_bucket) result = total_water return result
Charlie has 4 textbooks for English and 6 textbooks for Mathematics. Jamie wants to buy three times as many English textbooks as Charlie has and five times as many Mathematics textbooks as Charlie has. How many textbooks does Jamie want to have?
def solve() -> int: charlie_english = 4 charlie_math = 6 jamie_english = 3 * charlie_english jamie_math = 5 * charlie_math total_textbooks = jamie_english + jamie_math result = total_textbooks return result
Student: At a shopping plaza, there are 440 items at 60% off, and 30% of the items discounted are food related. How many food items are discounted?
def solve() -> int: total_items = 440 discount_rate = 0.6 food_rate = 0.3 discounted_items = total_items * discount_rate food_items = discounted_items * food_rate result = food_items return result
``` The ratio of yellow balls to blue balls in a bag is 3:5. If the bag has 80 balls, how many are yellow?
def solve() -> int: total_balls = 80 ratio_yellow_to_blue = 3/8 yellow_balls = total_balls * ratio_yellow_to_blue result = int(yellow_balls) return result
A company paid a total of $1200 in wages to its workers. The workers worked for a total of 60 hours and were paid at different hourly rates. The first group of workers worked for 20 hours at a rate of $15 per hour, the second group worked for 25 hours at a rate of $20 per hour, and the remaining workers worked for 15 h...
def solve() -> int: total_hours = 60 group1_hours = 20 group2_hours = 25 group3_hours = total_hours - group1_hours - group2_hours group1_rate = 15 group2_rate = 20 group3_rate = 25 total_paid = 1200 group1_paid = group1_hours * group1_rate group2_paid = group2_hours * group2_rate...
Student: Jane drove 200 miles in 4 hours. If she continues at the same speed, how long will it take her to drive 300 miles?
def solve() -> int: distance = 200 time = 4 speed = distance/time new_distance = 300 new_time = new_distance/speed result = new_time return result
An apartment block costs $400,000 more to construct than those in the area. But it can sell for 1.5 times the price of the other blocks in the area, which sell at $200,000 each. How much more profit is made by spending the extra money?
def solve() -> int: extra_cost = 400000 price = 200000 profit1 = 0.2 * price profit2 = 1.5 * price result = profit2 - (profit1 + extra_cost) return result
If a bulb uses 25 watts of power for 6 hours and 15 minutes each day and a unit of electricity cost 12 cents per kilowatt hour, calculate the monthly cost of using the bulb if the month has 30 days.
def solve() -> int: bulb_power = 25 time_used_daily = 6+(15/60) cost_per_unit = 0.12 power_in_kilowatts = bulb_power/1000 energy_used_daily = power_in_kilowatts * time_used_daily energy_used_monthly = energy_used_daily * 30 cost_monthly = energy_used_monthly*cost_per_unit result =...
A store sells t-shirts for $20 each. If a customer buys 3 t-shirts, they get a 10% discount. How much will the customer pay for the 3 t-shirts?
def solve() -> int: total_cost = 20*3 discounted_cost = total_cost*0.9 result = discounted_cost return result
A company sells 4000 units of a product at $5 each. If the company increases the price to $7, how many units would they need to sell to make the same amount of revenue?
def solve() -> int: quantity = 4000 price1 = 5 revenue1 = quantity * price1 price2 = 7 quantity2 = revenue1 / price2 result = round(quantity2, 2) return result
Nora goes for a walk every day and covers a distance of 6 kilometers in an hour. How many more hours will she need to walk to reach a total of 42 kilometers?
def solve() -> int: distance_per_hour = 6 total_distance = 42 hours_needed = (total_distance / distance_per_hour) - 1 result = hours_needed return result
Student: 5. David has a single-bedroom flat with 9 walls. He paints 3/9 of the walls green and paints the rest of the walls brown. How many walls in the flat did he paint green?
def solve() -> int: total_walls = 9 fraction_green = 3/9 num_green = total_walls * fraction_green result = round(num_green) return result
A rectangular box has a length of 5 cm, width of 4 cm, and a height of 6 cm. What is the volume of the box in cubic centimeters?
def solve() -> int: length = 5 width = 4 height = 6 volume = length * width * height result = volume return result