question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Student: The Kansas City Chiefs are gearing up for football season and need to order a team of custom jerseys. Each jersey is priced at $45 with a 9% sales tax. How much money will the Chiefs need for the entire team order?
def solve() -> int: price_per_jersey = 45 sales_tax = 0.09 total_cost_before_tax = price_per_jersey * 53 total_cost_after_tax = total_cost_before_tax * (1 + sales_tax) result = total_cost_after_tax return result
The number of boys in a class is 20% more than the number of girls. If there are 36 students in the class, how many girls are there?
def solve() -> int: boys_percentage = 20 total_percentage = 100 + boys_percentage boys = 36 * (boys_percentage / total_percentage) girls = 36 - boys result = girls return result
A cafe owner recorded the number of cups of coffee sold over the course of a week. The numbers sold per day were 120 on Monday, 80 on Tuesday, 160 on Wednesday, 100 on Thursday, 140 on Friday, 60 on Saturday and 70 on Sunday. What was the average number of cups of coffee sold per day?
def solve() -> int: monday_cups = 120 tuesday_cups = 80 wednesday_cups = 160 thursday_cups = 100 friday_cups = 140 saturday_cups = 60 sunday_cups = 70 total_cups = monday_cups + tuesday_cups + wednesday_cups + thursday_cups + friday_cups + saturday_cups + sunday_cups average_cup...
The maximum speed that a car can travel is 120 km/h. If the distance between two cities is 480 km, what is the fastest time that the car could travel this distance?
def solve() -> int: max_speed = 120 distance = 480 time = distance/max_speed result = time return result
John has $500 and wants to split it evenly among 7 friends. After giving each friend their share, he realizes he has overpaid by $10. How much money did each friend receive?
def solve() -> int: amount = 500 num_friends = 7 overpaid = 10 share = (amount - overpaid) / num_friends result = share return result
A gourmet bakery sells croissants for a certain price and pain au chocolat for twice that price. If the combined cost of one order each kind of pastry is $30, how much does the pain au chocolat cost?
def solve() -> int: croissant_price = 10 pain_au_chocolat_price = 2 * croissant_price total_cost = croissant_price + pain_au_chocolat_price while total_cost!= 30: croissant_price += 1 pain_au_chocolat_price = 2 * croissant_price total_cost = croissant_price + pain_au_chocolat_pri...
Tanya is painting a mural on a wall that is 8 meters long and 3 meters high. She can paint 2 square meters of the wall per hour. She started painting at 10 a.m. and took a one-hour lunch break at noon. What time will she finish painting the mural?
def solve() -> int: area = 8 * 3 hours = area / 2 hours = hours - 1 start_time = 10 end_time = start_time + hours if end_time > 12: end_time = end_time - 12 am_pm = "p.m." else: am_pm = "a.m." result = str(end_time) + " " + am_pm return res...
Q1: In a race, a runner ran 4km in 11 minutes and 40 seconds. What was the runner's average speed in m/s?
def solve() -> int: time_minutes = 11 + 40/60 time_seconds = 11 * 60 + 40 distance_km = 4 distance_m = 1000 * distance_km time_sec = time_minutes * 60 result = distance_m/time_sec return result
Betty Francis baked a cake for her family, which has 8 slices. Each slice has 300 calories, and 10% of the calories come from fat. Her husband Henry wants to eat 2 slices of cake, but he is on a diet that allows him to consume only 600 calories from fat per day. How many calories from fat can he have from other sources...
def solve() -> int: slices = 8 calories_per_slice = 300 fat_percentage = 0.1 henry_slices = 2 fat_limit = 600 fat_breakfast_lunch = 400 fat_in_cake = henry_slices * calories_per_slice * fat_percentage remaining_fat = fat_limit - fat_in_cake fat_other_sources = rem...
If the cost of 4 pens is $20, what is the cost of 1 pen?
def solve() -> int: cost_of_one_pen = 20 / 4 result = cost_of_one_pen return result
A car covers a distance of 240 miles with a speed of 60 mph. How many gallons of gas does it require if the vehicle has a mileage of 20 miles per gallon?
def solve() -> int: distance = 240 speed = 60 mileage = 20 gas_required = distance/mileage result = round(gas_required, 2) return result
In a school district, $2200 is allocated to buy textbooks for 30 students. Each textbook costs $30. How much leftover money will the school have if they buy the textbooks?
def solve() -> int: price_each = 30 num_students = 30 total = price_each * num_students money_given = 2200 result = money_given - total return result
If Kevin has a pile of marbles and 10% of the marbles are red, 20% are green, and the rest are blue, how many blue marbles did he have if there were 150 of marbles altogether?
def solve() -> int: marbles_total = 150 marbles_red = marbles_total * 0.1 marbles_green = marbles_total * 0.2 marbles_blue = marbles_total - marbles_red - marbles_green result = marbles_blue return result
Matthew had 18 chocolates and gave 4 of them to his friends. What percentage of the original amount of chocolates did Matthew keep for himself?
def solve() -> int: initial_chocolates = 18 given_chocolates = 4 remaining_chocolates = initial_chocolates - given_chocolates percentage = (remaining_chocolates/initial_chocolates)*100 result = percentage return result
A bookshelf contains 10 novels, 5 philosophies, and 3 biographies. What percentage of the shelf contains philosophy books? (Round off to the nearest integer).
def solve() -> int: total_books = 10+5+3 philosophy_books = 5 percentage = (philosophy_books/total_books)*100 result = round(percentage) return result
A shopper bought three items worth $10 each and four items worth $15 each. If there is a sales tax of 8%, what is the total amount the shopper has to pay?
def solve() -> int: item1_price = 10 item2_price = 10 item3_price = 10 item4_price = 15 item5_price = 15 item6_price = 15 item7_price = 15 subtotal = item1_price + item2_price + item3_price + item4_price + item5_price + item6_price + item7_price sales_tax = subtotal * 0.08 total ...
Samantha is ordering her wedding invitations. The invitations cost $2.00 each and she needs 100. She also wants to add a special envelope lining for $1.00 per envelope. What will be the total cost with shipping of $20.00 and a 10% discount?
def solve() -> int: invitations_cost = 2.00 num_invitations = 100 envelope_lining_cost = 1.00 shipping_cost = 20.00 discount = 0.10 total_cost = (invitations_cost * num_invitations) + (envelope_lining_cost * num_invitations) + shipping_cost discount_amount = total_cost * discount fi...
A school choir sold 150 tickets for their musical play. If each ticket cost $12, calculate the total amount of money collected.
def solve() -> int: total_money = 150 * 12 result = total_money return result
A movie theater has a capacity that is 1/5 that of a concert hall. The concert hall can seat 2,000 people. The cost to rent out the movie theater for a private screening is 3 times that of the cost for the concert hall. If the cost to rent out the concert hall is $10,000, what is the cost to rent out the movie theater ...
def solve() -> int: concert_hall_capacity = 2000 movie_theater_capacity = concert_hall_capacity / 5 concert_hall_rental_cost = 10000 movie_theater_rental_cost = concert_hall_rental_cost * 3 result = movie_theater_rental_cost return result
ome possible new questions and programs are: Layla is knitting a scarf that is 180 cm long. She has already knitted 40 cm of it, but she realizes that she needs to knit faster if she wants to finish it by tomorrow. She figures out that she can knit 2 cm every 15 minutes. How long will it take her to finish the scarf?
def solve() -> int: scarf_left = 180 - 40 minutes_per_cm = 15 / 2 total_minutes = scarf_left * minutes_per_cm hours = total_minutes / 60 result = hours return result
A school is collecting money for a charity event. In the first day, they collect $100. In the next eight days, they collect six times as much money as they did in the first day. How much money did they collect in the first day if they collected $4,900 now?
def solve() -> int: first_day = 100 next_eight_days = 6 * first_day total_money = first_day + next_eight_days * 8 result = (4900 - total_money) / 8 return result
Nick is planning for his son's birthday party. The entertainment cost $1,000. The cake costs $10 per child, and Nick wants to invite 30 children while his wife wants to invite 40% more than that. What is the total cost if Nick agrees with his wife?
def solve() -> int: entertainment_cost = 1000 num_children = 30 cake_cost_per_child = 10 wife_num_children = num_children * 1.4 total_cake_cost = (num_children + wife_num_children) * cake_cost_per_child total_cost = entertainment_cost + total_cake_cost result = total_cost ...
Jacob has twice as many LEGO sets as Emily. If Emily has 30 LEGO sets, how many LEGO sets does Jacob have?
def solve() -> int: emily_lego_sets = 30 jacob_lego_sets = 2 * emily_lego_sets result = jacob_lego_sets return result
If a bag contains 40 marbles of which 20 are black and 20 are white, what is the probability of picking a white marble out of the bag?
def solve() -> int: total_marbles = 40 white_marbles = 20 probability_of_white = white_marbles/total_marbles result = probability_of_white return result
Student: A bag of chips costs $2 and a bag of popcorn costs $3. If George buys 4 bags of chips and 2 bags of popcorns, how much will it cost?
def solve() -> int: chips_price = 2 popcorn_price = 3 num_chips = 4 num_popcorn = 2 total_cost = chips_price * num_chips + popcorn_price * num_popcorn result = total_cost return result
Judy needs 16 cups of sugar for her recipe. How many tablespoons does she need?
def solve() -> int: cups = 16 tablespoons_in_cup = 16 total_tablespoons = cups * tablespoons_in_cup result = total_tablespoons return result
A library has a total of 1000 books. Six-tenths of them are in English and 20% of the remaining are in French. How many books are in French?
def solve() -> int: books = 1000 english = 6/10 * books remaining = books - english french = 20/100 * remaining result = french return result
There are 100 spaces for vehicles in a parking lot. Each bus needs 6 spaces and there are 5 buses parked there. How many spaces are still available?
def solve() -> int: buses = 5 spaces = 100 needed_spaces = 6 total_spaces = buses * needed_spaces spaces_left = spaces - total_spaces result = spaces_left return result
Woods hill received 500 centimeters of snowfall in the recent snowstorm, while Riverdale and Fieldview got 5 meters and 120 centimeters respectively. How many more centimeters of snow did Riverdale and Fieldview receive than Woodshill?
def solve() -> int: woods_hill = 500 riverdale = 5 * 100 + 0 fieldview = 120 total_snow_riverdale_fieldview = riverdale + fieldview difference = total_snow_riverdale_fieldview - woods_hill result = difference return result
Sarah runs 5 laps around the track every day from Monday to Friday. She runs the same number of laps to return home. Last Thursday, her coach asked her to run an additional 2 laps for a training exercise. How many laps did Sarah run that week?
def solve() -> int: laps_per_day = 5 laps_weekdays = laps_per_day * 5 laps_return = laps_per_day laps_thursday = laps_per_day + 2 total_laps = laps_weekdays + laps_return + laps_thursday result = total_laps return result
Olivia got 5 t-shirts, 3 pairs of shorts, and 2 pairs of shoes. Each pair of shoes cost twice as much as each t-shirt. The total cost of everything was $250. If each t-shirt cost $15, how much did each pair of shoes cost?
def solve() -> int: t_shirts = 5 shorts = 3 shoes = 2 t_shirt_cost = 15 shoe_cost = 0 total_cost = (t_shirts * t_shirt_cost) + (shorts * t_shirt_cost) + (shoes * shoe_cost) shoe_cost = (total_cost - (t_shirts * t_shirt_cost) - (shorts * t_shirt_cost)) / shoes result =...
Student: A clothing store is having a sale of 25% off on all items. If a jacket costs $80, how much will it cost on the sale?
def solve() -> int: price = 80 discount = 0.25 discounted_price = price * (1 - discount) amount_saved = price - discounted_price result = discounted_price return result
The school basketball court is 45 yards long and 30 yards wide. What is the area of the basketball court in square yards?
def solve() -> int: length = 45 width = 30 area = length * width result = area return result
A traditional banana tree bears 50 bananas per year. Tony has designed incredible banana trees that yield 70% more bananas per year. He has a grove with 200 trees. How many bananas will he produce in 10 years?
def solve() -> int: traditional_yield = 50 increase_percentage = 70 number_of_trees = 200 number_of_years = 10 increase_per_tree = traditional_yield * increase_percentage / 100 new_yield_per_tree = traditional_yield + increase_per_tree total_yield_per_year = new_yield_per_tree...
Mary wants to buy boxes of apples to sell in her fruit store. She can buy them from a wholesaler who charges $32.50 for 10 boxes, or from a local farm for $30 for 8 boxes. If Mary needs to buy 480 boxes of apples, what is the most cost-effective option for her?
def solve() -> int: price_wholesaler = 32.50 price_farm = 30 needed_boxes = 480 cost_wholesaler = price_wholesaler * (needed_boxes // 10) cost_farm = price_farm * (needed_boxes // 8) savings = cost_wholesaler - cost_farm result = savings return result
Student: How many of the 50 questions on Miss Lawrence's math exam are problem-solving questions?
def solve() -> int: number_of_questions = 50 number_of_problem_solving_questions = 20 result = number_of_problem_solving_questions / number_of_questions * 100 return result
At the store, there are twice as many apples as oranges and an equal number of lemons to oranges. If the total cost of all the fruits is $90, how many lemons are there?
def solve() -> int: oranges = 90 / 3 apples = oranges * 2 lemons = oranges result = lemons return result
A rectangular garden has a width that is 8 meters less than twice its length. The perimeter of the garden is 76 meters. What is the length and width of the garden?
def solve() -> int: perimeter = 76 length = (perimeter-8)/2 width = perimeter/2 - length result = (int(length), int(width)) return result
A parcel delivery service charges $15 for the first 5kg of a parcel and $2 additional charge per kg thereafter. If a parcel weighed 10kg, what was the total cost of the delivery?
def solve() -> int: base_charge = 15 additional_charge_per_kg = 2 parcel_weight = 10 if parcel_weight <= 5: total_cost = base_charge else: additional_weight = parcel_weight - 5 total_cost = base_charge + (additional_weight * additional_charge_per_kg) result = total_cost ...
7. Caleb has six two cm cubes of silver. A cubic centimeter of silver weighs 4.5 grams. Each gram of silver sells for $55. How much does he sell it for if he sells it for one seventh of its silver value?
def solve() -> int: volume = 6 * 2 * 2 * 2 * 10**-6 weight = 4.5 * volume price = 55 * weight result = 0.14 * price return result
A recipe calls for 8 cups of sugar. If Lisa wants to make half as much of the recipe, how many cups of sugar does she need?
def solve() -> int: sugar_needed = 8 recipe_amount = 0.5 sugar_needed *= recipe_amount result = sugar_needed return result
Lisa can grade 50 papers in 2 hours. How long will it take her to grade 80 papers?
def solve() -> int: papers_1 = 50 time_1 = 2 papers_2 = 80 rate = papers_1 / time_1 time_2 = papers_2 / rate result = time_2 return result
Aisha bought 2.5 kilograms of apples and 1.75 kilograms of oranges at the market. Then she used 0.75 kilograms of apples and 0.5 kilograms of oranges to make a fruit salad. How many kilograms of fruits did she have left?
def solve() -> int: apples = 2.5 oranges = 1.75 apples = apples - 0.75 oranges = oranges - 0.5 result = apples + oranges return result
If Jack wants to purchase 11 packs of 250g butter, it will cost him $8.25. If he buys them individually, they will cost $0.85 each. How much can he save if he purchases 19 sets of 11 packets of 250g butter?
def solve() -> int: packs = 11 cost_per_pack = 8.25 / packs individual_cost = 0.85 sets = 19 total_cost = cost_per_pack * sets * packs total_individual_cost = individual_cost * sets * packs savings = total_individual_cost - total_cost result = savings return result
A store has 120 notebooks and 240 pencils. If 60% of the notebooks and 75% of the pencils are sold, how many items are left in the store?
def solve() -> int: notebooks = 120 pencils = 240 sold_notebooks = 0.6 * notebooks sold_pencils = 0.75 * pencils remaining_items = notebooks - sold_notebooks + pencils - sold_pencils result = remaining_items return result
Bobby and Jayden bought a teddy bear that cost $44. If Bobby paid $6 more than Jayden, how much did Jayden pay?
def solve() -> int: teddy_bear = 44 difference = 6 jayden_paid = teddy_bear - difference result = jayden_paid return result
If a recipe calls for 2 eggs and you need to make it for 6 people, how many eggs do you need?
def solve() -> int: people = 6 eggs_per_recipe = 2 total_eggs_needed = people * eggs_per_recipe result = total_eggs_needed return result
A box contains 5 red balls, 3 green balls, and 2 yellow balls. 3 balls are drawn randomly without replacement. What is the probability that all 3 balls are yellow?
def solve() -> int: total_balls = 10 yellow_balls = 2 yellow_probability = yellow_balls / total_balls yellow_balls_2 = 1 yellow_probability_2 = yellow_balls_2 / (total_balls - 1) yellow_balls_3 = 0 yellow_probability_3 = yellow_balls_3 / (total_balls - 2) total_probability = yellow_proba...
ara is making a batch of strawberry jam for a school function. If she needs a total of 8 cups of sugar and each cup of sugar is 6 ounces, and if sugar costs $1.05 an ounce, how much does the sugar cost?
def solve() -> int: ounces_of_sugar = 8 * 6 cost_of_sugar = ounces_of_sugar * 1.05 result = cost_of_sugar return result
Result: There were 6 girls and 18 boys in the group Rachel has $18. She spends $2 on a t-shirt and saves the rest. How much money does she have left?
def solve() -> int: rachel_money = 18 tshirt_cost = 2 money_left = rachel_money - tshirt_cost result = money_left return result
Student: A factory produces 1200 widgets per day with 5 machines. Each machine works 8 hours per day. The factory decides to increase the production by 50% by adding more machines and working longer hours. How many machines and how many hours per day are needed to achieve this goal?
def solve() -> int: widgets_per_day = 1200 machines = 5 hours_per_day = 8 new_production_goal = widgets_per_day * 1.5 new_machines = machines * 1.5 new_hours_per_day = new_production_goal / (new_machines * hours_per_day) result = (new_machines, new_hours_per_day) return result
A marathon is 26.2 miles long. If a runner can run 8 miles an hour, how long will it take them to finish the marathon?
def solve() -> int: marathon_distance = 26.2 speed = 8 time = marathon_distance/speed result = time return result
A room has an area of 130 square feet. The length of the room is 1.5 times the width of the room. What is the length and width of the room?
def solve() -> int: area = 130 width = (area / 2)**0.5 length = 1.5 * width result = str(length) + " and " + str(width) return result
Matt has 500 photos on his computer but realizes that too many of them are blurry. He keeps only 70% of the photos and then deletes 65% of the remaining ones. How many photos are left on his computer after deleting? A company wants to expand its workforce so that they will have 3 times their current number of employees...
def solve() -> int: total_photos = 500 keep_percentage = 0.7 kept_photos = total_photos * keep_percentage deleted_photos = total_photos - kept_photos delete_percentage = 0.65 remaining_photos = kept_photos * (1 - delete_percentage) current_employees = 20 ...
A company is making a rectangular package for a customer’s new product. The customer wants the package to be 20 inches wide, 30 inches long, and 18 inches tall. How much total surface area must the package have?
def solve() -> int: width = 20 length = 30 height = 18 total_area = 2 * (width * length + width * height + length * height) result = total_area return result
If a cube has a volume of 125 cubic meters, what is the length of each side?
def solve() -> int: volume = 125 side = round(volume**(1/3),2) result = side return result
**** Adam bought a car with a sale price of $14,500 after a 20% discount. How much did he save?
def solve() -> int: original_price = 14500 discount_percent = 20 discount_amount = (discount_percent/100) * original_price result = discount_amount return result
Student: Tyler drove his car to the grocery store to buy food. The trip cost him $28 in gasoline. He had already saved $35 before. How much money does he have now?
def solve() -> int: gasoline_cost = 28 saved_money = 35 total_money = saved_money + gasoline_cost result = total_money return result
A pizza place sells small pizzas for $6 and large pizzas for $10. If the total amount made from selling 14 small pizzas and 9 large pizzas is $126, how many small pizzas were sold?
def solve() -> int: small_price = 6 large_price = 10 total_sales = 126 num_small_pizzas = 14 num_large_pizzas = 9 total_small_sales = num_small_pizzas * small_price total_large_sales = num_large_pizzas * large_price total_pizza_sales = total_small_sales + total_large_sales num_extra_...
MegaCorp earned $3,000,000 from mining and $5,000,000 from oil refining every week. Its monthly expenses are $30,000,000. They are being fined 10% of their profits. How much is MegaCorp's fine in dollars?
def solve() -> int: annual_profits = 3000000 * 7 * 52 + 5000000 * 7 * 52 - 30000000 * 12 fine = annual_profits * 0.1 result = fine return result
The local pet store sells fish by the pair. It cost $12 for 10 pairs. How much would 25 pairs cost?
def solve() -> int: pairs_bought = 25 pairs_cost_10 = 10 cost_10pairs = 12 cost_25pairs = (cost_10pairs * (pairs_bought / pairs_cost_10)) result = cost_25pairs return result
Sophia flew 5000 miles to visit her family in Europe. During her trip, she took a flight of 1000 miles to visit her aunt. Later, she returned home the same way. How many miles did Sophia travel in all?
def solve() -> int: distance_to_europe = 5000 distance_to_aunt = 1000 total_distance = distance_to_europe + distance_to_aunt + distance_to_aunt result = total_distance return result
Cora has saved $180 for her summer trip. If admission to the place costs $20 and an additional $45 per person for activities, how many friends can she take with her?
def solve() -> int: admission = 20 activity_expense = 45 saved_amount = 180 friend_count = 0 while saved_amount >= admission: saved_amount-= (admission + activity_expense) friend_count+=1 result = friend_count return result
Lisa and her friends each bought 3 bags of chips. If there were 10 friends in all, how many bags of chips did they buy in total?
def solve() -> int: friends = 10 chips_each = 3 total_chips = friends * chips_each result = total_chips return result
san earns $15 per hour at her job. She worked 10 hours this week and pays 25% in taxes. How much money will she earn after taxes?
def solve() -> int: hours_worked = 10 earnings_per_hour = 15 tax_rate = 0.25 total_earnings = hours_worked * earnings_per_hour total_taxes = total_earnings * tax_rate earnings_after_taxes = total_earnings - total_taxes result = earnings_after_taxes return result
Sofia needs to buy new notebooks for her school classes. She received $15 from each of her six aunts. If each notebook costs $5, how many pages will all the notebooks have?
def solve() -> int: aunt_money = 15 num_aunts = 6 notebook_cost = 5 total_money = aunt_money * num_aunts num_notebooks = total_money // notebook_cost num_pages_per_notebook = 100 total_pages = num_notebooks * num_pages_per_notebook result = total_pages return result
Student: Adam bought a total of 63 books for his library. If each book is sold at $12 and he received a discount of 20%, how much did Adam pay for the books in total?
def solve() -> int: num_books = 63 price_per_book = 12 discount_percentage = 0.2 total_price_before_discount = num_books * price_per_book discount_amount = total_price_before_discount * discount_percentage total_price_after_discount = total_price_before_discount - discount_amount result = to...
A certain type of cell phone plan costs $20 per month plus $0.05 per minute of talk time used. If John used 400 minutes in a month, how much did he have to pay?
def solve() -> int: monthly_fee = 20 rate_per_minute = 0.05 num_of_minutes = 400 total_price = monthly_fee + (rate_per_minute*num_of_minutes) result = total_price return result
A car is traveling at a speed of 50 km/h. How long will it take to travel a distance of 200 km?
def solve() -> int: speed = 50 distance = 200 time = distance/speed result = time return result
Jamal has 8 tubes of paint, each containing 450 milliliters of paint. How many liters of paint does Jamal have in total?
def solve() -> int: number_of_tubes = 8 amount_of_paint_per_tube = 450/1000 total_amount_of_paint = number_of_tubes * amount_of_paint_per_tube result = total_amount_of_paint return result
Michael wants to finish reading a book that has 400 pages. If he reads 40 pages per hour and spends 1 hour taking breaks after every 3 hours of reading, how long will it take him to finish the book?
def solve() -> int: pages = 400 pages_per_hour = 40 reading_time_per_day = 3 break_time_per_day = 1 total_reading_time = (pages/pages_per_hour) + ((pages/pages_per_hour)//reading_time_per_day)*break_time_per_day result = total_reading_time return result
harmeen wants to buy a phone which costs $599. She has saved $250 so far. How much more money does she need to buy the phone?
def solve() -> int: x = 599 y = 250 result = x - y return result
Dylan collects stamps. For every 12 stamps he adds to his collection, he gets a free stamp. He has already received 7 free stamps. How many more stamps does he need to collect for another free one?
def solve() -> int: stamps_collected = 0 free_stamps_received = 7 stamps_needed = 12 - (stamps_collected % 12) stamps_needed += stamps_needed - (free_stamps_received % 12) result = stamps_needed return result
A farmer has a rectangular field that measures 120 meters by 80 meters. He wants to divide the field into four equal parts by fencing along the middle of each side. If the fencing costs 15 dollars per meter, how much money does he need to spend on the fencing?
def solve() -> int: fence_length = 120 / 2 + 80 / 2 total_length = fence_length * 4 cost = total_length * 15 result = cost return result
Sarah bought a dress worth $1000 on credit from a boutique 4 months ago. She has returned $300 so far. How much will she still owe to the boutique in 2 months?
def solve() -> int: credit = 1000 returned = 300 owed = credit - returned owed_in_2_months = owed result = owed_in_2_months return result
Aaron has $200 in his bank account. He spends $75 on a new game console and $30 on snacks from the store. If he then spends a third of what he has left on a new game, how much money does he have left?
def solve() -> int: balance = 200 game_console = 75 snacks = 30 game = (balance - game_console - snacks)/3 total_spent = game_console + snacks + game balance -= total_spent result = balance return result
A recipe calls for 3 1/2 cups of flour to make 24 pancakes. How much flour is needed to make 72 pancakes?
def solve() -> int: pancake_amount = 24 flour_amount = 3.5 new_pancake_amount = 72 flour_needed = (new_pancake_amount / pancake_amount) * flour_amount result = flour_needed return result
Student: A motorbike is sold for $4,500. If a customer puts down a $500 deposit and pays 12 monthly installments of $300, what is the total amount paid?
def solve() -> int: price = 4500 deposit = 500 installment = 300 total_amount_paid = deposit + installment * 12 result = total_amount_paid return result
Amanda thinks that if she can complete three-quarters of the tasks on her to-do list, she will be able to relax. She has already completed half of the tasks, but out of the remaining tasks, only 5 remain. She surveys her family, and delegates some of her tasks to them. This results in half of her family members saying ...
def solve() -> int: total_tasks = 30 completed_tasks = total_tasks / 2 remaining_tasks = total_tasks - completed_tasks remaining_tasks -= 5 completed_remaining_tasks = remaining_tasks * 3 / 4 tasks_delegated = remaining_tasks - completed_remaining_tasks tasks_delegated /= 2 remaining_tas...
Anthony has a rectangular garden that measures 7 meters by 5 meters. He wants to plant roses along the perimeter of the garden, leaving 1 meter of space between each rose. How many roses does he need to buy?
def solve() -> int: length = 7 width = 5 distance = 2 perimeter = (length + width) * 2 result = perimeter // distance return result
In a garden, there are 16 rows of tulips. Each row has 8 tulips. How many tulips are there in the garden?
def solve() -> int: num_rows = 16 num_tulips_in_row = 8 total_num_tulips = num_rows * num_tulips_in_row result = total_num_tulips return result
Student: A company has 50 employees. Out of those 50 employees, 20 employees work 40 hours per week, 15 employees work 35 hours per week, and 15 employees work 30 hours per week. What is the average number of hours worked per employee per week?
def solve() -> int: total_employees = 50 full_time = 20 part_time_1 = 15 part_time_2 = 15 total_hours = full_time * 40 + part_time_1 * 35 + part_time_2 * 30 average_hours = total_hours / total_employees result = average_hours return result
A shop sells chocolates for $2 each. If John buys 5 chocolates, how much does he have to pay in total?
def solve() -> int: chocolates = 5 price = 2 total_cost = chocolates * price result = total_cost return result
A coffee shop sells small, medium, and large cups of coffee. A small cup costs $2, a medium cup costs $3, and a large cup costs $4. The shop sells 25% small cups, 50% medium cups, and 25% large cups. If the shop makes $600 in one day, how many small cups did it sell?
def solve() -> int: total_cups = 600 / (2*0.25 + 3*0.5 + 4*0.25) small_cups = 0.25 * total_cups result = small_cups return result
Sara has twice as many stickers as Tom, and Bob has 12 more stickers than Sara. If Tom has 36 stickers, how many stickers does Bob have?
def solve() -> int: Tom = 36 Sara = 2 * Tom Bob = 2 * Sara + 12 result = Bob return result
Linda buys a dozen eggs from the store. Each egg costs $0.80 and is eligible for a cash refund of $0.05 per egg when she takes it to a recycling center. How much money will she save in total from the cash refund?
def solve() -> int: number_of_eggs = 12 cost_each = 0.80 refund_each = 0.05 cost_total = number_of_eggs * cost_each refund_total = number_of_eggs * refund_each result = refund_total return result
Student: If Tim finished 10 questions in a math quiz, plus an additional 2 questions for every grade below an A he got on his semester exams, how many questions did he finish if he got 5 grades below an A?
def solve() -> int: questions_in_quiz = 10 bonus_questions = 2 grades_below_A = 5 total_questions = questions_in_quiz + bonus_questions * grades_below_A result = total_questions return result
Grace has 40 marbles. She put half of them in a box and gave the rest to her friend. How many marbles did she gave away?
def solve() -> int: num_marbles = 40 num_marbles_left = num_marbles / 2 num_marbles_given = num_marbles - num_marbles_left result = num_marbles_given return result
Sunny Seahorse collects twice as many seashells as Zippy Zebra. If Zippy Zebra collects 30 seashells, how many seashells do they collect together?
def solve() -> int: zebra_seashells = 30 seahorse_seashells = 2 * zebra_seashells total_seashells = zebra_seashells + seahorse_seashells result = total_seashells return result
Maya has a garden of 50 flowers, each day she picks 2 flowers. At the end of 6 days she plants 5 more flowers into the garden but picks an additional 3 flowers same day. How many flowers does she have at the end?
def solve() -> int: x = 50 for i in range(1,7): x -= 2 x += 5 x -= 3 result = x return result
A candy box contains an equal number of chocolate candies and peppermint candies. If there are 60 total candies, how many chocolate candies are in the box?
def solve() -> int: total_candies = 60 chocolate_candies = total_candies // 2 result = chocolate_candies return result
Possible questions and programs: Bruno has 6 times as many stickers as Carlos. Dani has 15 fewer stickers than Bruno. Ela has a third of the number of stickers Dani has. If Carlos has 10 stickers, what is the total number of animal stickers they all have?
def solve() -> int: carlos = 10 bruno = 6 * carlos dani = bruno - 15 ela = dani / 3 total = carlos + bruno + dani + ela result = total return result
A group of 7 friends order 4 pitchers of beer for $18 each, 2 dozen wings for $10 each, and 3 orders of nachos for $15 each. If they split the bill equally, how much will each person owe?
def solve() -> int: pitchers_of_beer = 4 price_per_pitcher = 18 dozen_wings = 2 price_per_dozen_wings = 10 orders_of_nachos = 3 price_per_order_of_nachos = 15 total_cost = (pitchers_of_beer * price_per_pitcher) + (dozen_wings * price_per_dozen_wings) + (orders_of_nachos * price_per_orde...
A jar contains 60 marbles. If the ratio of green to blue marbles is 3:7, how many green marbles are in the jar?
def solve() -> int: total_marbles = 60 green_ratio = 3/10 green_marbles = total_marbles * green_ratio result = green_marbles return result
Rafael is painting a room. For each wall, it takes him 30 minutes to paint the base coat and 45 minutes to add the second coat. How many minutes does Rafael spend on painting a room with 4 walls?
def solve() -> int: base_coat_time = 30 second_coat_time = 45 num_walls = 4 total_time = (base_coat_time + second_coat_time) * num_walls result = total_time return result
A train travels 300 miles in 6 hours. What is the average speed of the train?
def solve() -> int: distance = 300 time = 6 speed = distance/time result = speed return result
Rachel is paid $10 per hour and works 7 hours a day. If she takes a two week vacation with 4 paid vacation days, how much pay will she miss?
def solve() -> int: hours_per_day = 7 pay_per_hour = 10 vacation_days = 4 weeks_in_a_year = 52 total_hours_worked = hours_per_day * (weeks_in_a_year - 2) * 5 total_pay = total_hours_worked * pay_per_hour pay_missed = vacation_days * hours_per_day * pay_per_hour result = to...
David is storing his books on his bookshelf. His bookshelf can hold 120 books, but if he adds larger books, he can only fit 80 books. He has already put 10 large books and 20 small books on his shelf. How many small books can he fit in the remainder of his bookshelf?
def solve() -> int: large_books = 10 small_books = 20 bookshelf_capacity = 120 large_book_capacity = 80 remaining_capacity = bookshelf_capacity - (large_books + small_books) small_books_capacity = remaining_capacity result = small_books_capacity return result
Bob buys a book for $12 and a pen for $2. He gets a 10% discount on the book and a 20% discount on the pen. He also pays a 5% sales tax on the final price. How much does Bob pay in total?
def solve() -> int: book_price = 12 pen_price = 2 book_discount = 0.1 pen_discount = 0.2 sales_tax = 0.05 book_price_discounted = book_price * (1 - book_discount) pen_price_discounted = pen_price * (1 - pen_discount) subtotal = book_price_discounted + pen_price_discounted tax...
At the amusement park, John is in charge of counting the number of visitors who ride the roller coaster. He always inflates the number of riders to impress his boss. Originally, there were 100 riders in the morning, 150 during afternoon, and 200 late at night. He adds an extra 50 riders in the morning, 75 in the aftern...
def solve() -> int: morning_original = 100 afternoon_original = 150 night_original = 200 morning_added = 50 afternoon_added = 75 night_added = 80 total_original = morning_original + afternoon_original + night_original total_added = morning_added + afternoon_added + night_added ...