question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Emily baked 50 cupcakes for her party and twice as many brownies. How many more cupcakes than brownies did she make?
def solve() -> int: cupcakes = 50 brownies = cupcakes * 2 difference = cupcakes - brownies result = difference return result
A box of crayons costs $4. If Sally wants to buy 6 boxes of crayons, how much will she need to pay?
def solve() -> int: num_of_boxes = 6 cost_per_box = 4 total_cost = num_of_boxes * cost_per_box result = total_cost return result
David collects 8 quarters, 12 dimes, and 16 nickels from his piggy bank. How much money does he have in total?
def solve() -> int: quarters_value = 8 * 0.25 dimes_value = 12 * 0.1 nickels_value = 16 * 0.05 total_value = quarters_value + dimes_value + nickels_value result = total_value return result
Jake earns $8 per hour working as a cashier at a supermarket. He works 5 hours every weekday and 8 hours every weekend day. How much money does he earn in a month that has 30 days?
def solve() -> int: wage_per_hour = 8 hours_per_weekday = 5 hours_per_weekend = 8 days_in_month = 30 weekdays_in_month = 4 * 5 + (days_in_month % 7) weekend_in_month = 4 * 2 - (days_in_month % 7) weekday_earnings = wage_per_hour * hours_per_weekday * weekdays_in_month weekend_earning...
At the craft fair, Amy sold jewelry, pottery, and paintings. She made a total of $480, with $120 coming from her jewelry sales. Her pottery sales were twice that amount. Her paintings sold for $40 more than half of her pottery sales. How much did she make from selling pottery?
def solve() -> int: jewelry_sales = 120 pottery_sales = jewelry_sales * 2 paintings_sales = (pottery_sales / 2) + 40 result = pottery_sales return result
Result: 1000 A machine can produce 10 toys in 2 hours. How many toys can the machine produce in 8 hours? If each toy sells for $5, how much revenue will be generated from the sale of these toys?
def solve() -> int: toys_per_hour = 10/2 no_of_hours = 8 toy_price = 5 total_toys = toys_per_hour * no_of_hours total_revenue = total_toys * toy_price result = (total_toys, total_revenue) return result
Laila wants to fill a 50-liter tank. She wants to fill it by letting the water run for 30 seconds then turning it off for 30 seconds and so on, alternating theSamantha practices piano 3 hours per day for 7 days a week. On the weekends, she plays for 4 hours a day. If her next recital is in 4 weeks, how much time will S...
def solve() -> int: weeks = 4 days_per_week = 7 hours_per_day = 3 weekend_hours_per_day = 4 total_weekdays = weeks * (days_per_week - 2) total_weekend_days = weeks * 2 total_weekday_hours = total_weekdays * hours_per_day total_weekend_hours = total_weekend_days * weekend_ho...
A student has a test grade average of 85%. If their two test grades so far are 80% and 90%, what grade do they need to get on the third test to maintain an 85% average?
def solve() -> int: total_grades = 3 desired_average = 85 current_average = (80 + 90) / 2 needed_grade = ((desired_average * total_grades) - (current_average * 2)) / 1 result = needed_grade return result
A tank initially contains 250 liters of water. After 3/5 of the water is drained out, it is refilled with 120 liters of water. What is the final volume of water in the tank?
def solve() -> int: tank_volume = 250 drained_volume = tank_volume * 3/5 remaining_volume = tank_volume - drained_volume refilled_volume = remaining_volume + 120 result = refilled_volume return result
A store has a buy 2, get 1 50% off deal on all toys. If a toy costs $15, how much would someone pay for 4 toys during this deal?
def solve() -> int: toy_price = 15 num_toys = 4 num_full_sets = num_toys // 3 num_toys_to_pay = num_toys - num_full_sets total_price = (num_full_sets * 2 + num_toys_to_pay) * toy_price * 0.75 result = total_price return result
Jasmine is baking cupcakes for a fundraiser. She uses 3 eggs for every 12 cupcakes and she needs to make 240 cupcakes. How many eggs does she need to use?
def solve() -> int: eggs_per_cupcake = 3 / 12 total_eggs = 240 * eggs_per_cupcake result = total_eggs return result
A company's revenue is $500,000 per year. If their revenue increases by 5% every 2 years, what is the total revenue after 10 years?
def solve() -> int: current_revenue = 500000 two_years = current_revenue*1.05 four_years = two_years*1.05 six_years = four_years*1.05 eight_years = six_years*1.05 ten_years = eight_years*1.05 total_revenue = current_revenue + two_years + four_years + six_years + eight_years + ten_years r...
Six years ago, the total of Sarah's age and her brother's age equaled 3/4 of their grandmother's age now. If Sarah is 48 years old and her brother is 4 years older than her, how old is their grandmother now?
def solve() -> int: sarah_age = 48 brother_age = sarah_age + 4 total_6_years_ago = (sarah_age - 6) + (brother_age - 6) grandmother_age_now = total_6_years_ago / (3/4) result = grandmother_age_now return result
Student: Adam is 15 years younger than Chloe. David is 12 years older than Adam and half of Chloe's age. If Chloe is 42, how old is David?
def solve() -> int: adam_age = 0 chloe_age = 42 david_age = 0 adam_age = chloe_age - 15 david_age = adam_age + 12 + (chloe_age / 2) result = david_age return result
A car can travel 60 miles on a full tank of gas. If the car travels 20 miles to work and 20 miles back home each day, how many days can it travel before needing to refill the gas tank?
def solve() -> int: total_miles_on_tank = 60 daily_miles_driven = 20+20 days_before_refill = total_miles_on_tank/daily_miles_driven result = days_before_refill return result
The Snip 'N Clip Hair Salon offers haircuts that require 4 inches of hair to be cut off and a teaspoon of hair serum. If a single hair strand is 2 inches long, and the Hair Salon has a new customer every 20 minutes, how many hair strands are needed to serve all customers during an 8-hour day?
def solve() -> int: haircut_length = 4 hair_serum = 1 hair_strand_length = 2 time_per_customer = 20 hours_per_day = 8 haircut_per_customer = haircut_length / hair_strand_length hair_serum_per_customer = hair_serum total_haircut_length = haircut_per_customer * 2 total_h...
There were 9 boys and 4 more girls in a class. Each student received 3 pencils and 2 erasers. If a pencil costs $0.10 and an eraser costs $0.20, how much money did the teacher spend on pencils and erasers for the class?
def solve() -> int: students = 9 + 4 pencils = students * 3 erasers = students * 2 total_cost = (pencils * 0.1) + (erasers * 0.2) result = 5.2 return result
Student: Bob has 36 chips, Mila has 18 chips and Theo has 15 chips. How many chips do Bob and Mila have together?
def solve() -> int: bob_chips = 36 mila_chips = 18 theo_chips = 15 total_chips = bob_chips + mila_chips result = total_chips return result
In a city map, 1/32 inch represents 100 meters of actual street distance. The distance between two museums on the map is 5 1/4 inches. What is the actual distance, in meters, between the museums?
def solve() -> int: scale = 1/32 street_distance = 100 map_distance = 5 + 1/4 actual_distance = map_distance * scale * street_distance result = actual_distance return result
Student: Susan wants to buy a new bike that costs $200. She can earn $10 for every hour she spends babysitting her neighbor's child. How many hours does she need to babysit in order to save enough money for the bike?
def solve() -> int: cost_of_bike = 200 earning_per_hour = 10 total_hours = cost_of_bike / earning_per_hour total_hours = round(total_hours) result = total_hours return result
A store had a sale on clothing where the original price was discounted by 30%, and then an additional discount of $15 was applied to the discounted price. If a shirt originally cost $60, what was the final sale price?
def solve() -> int: original_price = 60 discounted_price = original_price * 0.7 final_price = discounted_price - 15 result = final_price return result
Meg is making a total of 900 cookies for a party. She has already made 200 cookies so far. How many more cookies does Meg need to make?
def solve() -> int: total_cookies = 900 cookies_made = 200 cookies_remaining = total_cookies - cookies_made result = cookies_remaining return result
Jack bought a basketball for 3.50$ plus an additional fee of 8%. How much did Jack pay in total for the basketball?
def solve() -> int: original_price = 3.50 additional_charge = 8 additional_charge_amount = original_price * (additional_charge/100) total_price = original_price + additional_charge_amount result = 3.78 return result
Mia sells cupcakes at a bake sale. She makes 4 batches of chocolate, 3 batches of vanilla, and 2 batches of red velvet cupcakes. Each batch has 12 cupcakes. She sells each cupcake for 2 dollars. She spends 20 dollars on ingredients and 10 dollars on packaging. How much profit does she make?
def solve() -> int: total_cupcakes = 4 * 12 + 3 * 12 + 2 * 12 revenue = total_cupcakes * 2 cost = 20 + 10 profit = revenue - cost result = profit return result
David is twice as old as his sister. If his sister is 12 years old, how old is David?
def solve() -> int: sister_age = 12 david_age = sister_age * 2 result = david_age return result
A school has a total of 500 students. If 60% of the students are girls and the rest are boys, how many boys are in the school?
def solve() -> int: total_students = 500 pct_girls = 0.60 pct_boys = 1 - pct_girls num_girls = total_students * pct_girls num_boys = total_students * pct_boys result = int(num_boys) return result
John bought 5 shirts for $100. He got a discount of 10% for each shirt after the second one. How much did John save in total?
def solve() -> int: price_per_shirt = 100 / 5 discounted_price_per_shirt = price_per_shirt * 0.9 discounted_price_for_last_3 = discounted_price_per_shirt * 3 total_savings = (price_per_shirt - discounted_price_per_shirt) * 3 result = total_savings return result
Andrew wants to buy a new TV that costs $1000. There is a 12% tax on the TV. If Andrew also buys a soundbar for $150, how much will he spend in total? 10 years ago, John was three times Maria's age. In 12 years, John will turn 40. Cindy was born when Maria turned 2. How old will Cindy be in 6 years?
def solve() -> int: tv_cost = 1000 tax_rate = 0.12 soundbar_cost = 150 total_cost = tv_cost + (tv_cost * tax_rate) + soundbar_cost result = total_cost return result
Calvin needs to cut 8 boards into 2 equal parts. The boards measure 2 feet in length. How many feet of boards does Calvin need in total?
def solve() -> int: num_boards = 8 length_board = 2 total_length = num_boards*length_board result = total_length return result
Mark bought 2 pizzas for $15.50 each and 4 sandwiches for $5 each. What was the average price of the food he bought?
def solve() -> int: pizzas = 2 sandwiches = 4 pizza_price = 15.5 sandwich_price = 5 total_cost = (pizzas * pizza_price) + (sandwiches * sandwich_price) total_food = pizzas + sandwiches avg_price = total_cost / total_food result = avg_price return result
During a week, a student scored 85 points on Monday's quiz, 95 points on Tuesday's test, 70 points on Wednesday's essay, 80 points on Thursday's exam, and 90 points on Friday's quiz. On Saturday, they did not receive any grades, and on Sunday they did not do anything school-related. What was the student's average daily...
def solve() -> int: monday_score = 85 tuesday_score = 95 wednesday_score = 70 thursday_score = 80 friday_score = 90 total_score = monday_score + tuesday_score + wednesday_score + thursday_score + friday_score average_score = total_score / 5 result = average_score retur...
10. Jessica's teacher sent the class an assignment to collect 180 quills from their backyard. Porcupines have 6 quills each, hedgehogs have 8 quills each, and raccoons have 4 quills each. Jessica has 5 porcupines, 6 hedgehogs, and 8 raccoons. How many more quills does she need to fulfill her assignment?
def solve() -> int: po = 5 he = 6 ra = 8 a = 6 b = 8 c = 4 result = 180 - (po*a + he*b + ra*c) return result
If a recipe calls for 2 cups of sugar for 12 cookies, how much sugar will be needed for 36 cookies?
def solve() -> int: cups_of_sugar_per_cookie = 2/12 total_cups_of_sugar = cups_of_sugar_per_cookie * 36 result = total_cups_of_sugar return result
A farmer has 27 horses and 112 cows on his farm. Each horse needs 2.5 acres of land and each cow needs 1.2 acres of land. How many acres of land does the farmer need in total?
def solve() -> int: horses = 27 cows = 112 horse_acres = horses * 2.5 cow_acres = cows * 1.2 total_acres = horse_acres + cow_acres result = total_acres return result
Aaron has a total of 100 stickers. If he started collecting stickers when he was 5 and got 5 more stickers every year on his birthday, how many stickers did he receive on his 10th birthday?
def solve() -> int: age = 10 start_age = 5 increase = 5 stickers = age - start_age result = stickers * increase return result
Student: Ms. Wong buys a new bicycle for $720. She pays $300 upfront and the rest in 6 equal monthly installments. How much does she pay each month?
def solve() -> int: price = 720 down_payment = 300 num_installments = 6 monthly_payment = (price - down_payment) / num_installments result = monthly_payment return result
Max has seven jars of nuts. One jar is filled with almonds, one with cashews, two with peanuts, one with hazelnuts, one with walnuts, and one with mixed nuts. He has twice as many walnuts as he does hazelnuts. He has three times as many peanuts as he does almonds. If he has 240 almonds, how many nuts does he have in to...
def solve() -> int: almonds = 240 cashews = 1 peanuts = 2 * 3 * almonds hazelnuts = 1 walnuts = 2 * hazelnuts mixed_nuts = 1 total_nuts = almonds + cashews + peanuts + hazelnuts + walnuts + mixed_nuts result = total_nuts return result
Alex wants to create a hot air balloon with his neighbor Tom. They have a budget of $500. They spend $150 on a basket, $50 on a burner, and $75 on a rope. If they want to use the rest of their budget on helium, which costs $2 per ounce, and for every ounce they purchase the balloon can fly 200 feet higher, how high can...
def solve() -> int: budget = 500 basket_cost = 150 burner_cost = 50 rope_cost = 75 remaining_budget = budget - basket_cost - burner_cost - rope_cost helium_cost_per_ounce = 2 height_increase_per_ounce = 200 helium_ounces = remaining_budget / helium_cost_per_ounce height_inc...
A plane flies 300 miles in 2 hours at a constant speed. How far can it fly in 3 hours at the same speed?
def solve() -> int: plane_speed = 300 / 2 distance = plane_speed * 3 result = distance return result
Celeste received a $30 gift card for her birthday. She spent three times that amount. How much money did Celeste spend?
def solve() -> int: gift_card_amount = 30 spent_amount = gift_card_amount * 3 result = spent_amount return result
A school fundraiser sells 400 tickets for $5 each. If they keep 5% of the profits for administrative fees, how much money do they keep?
def solve() -> int: total_profit = 400 * 5 admin_fees = 0.05 * total_profit money_kept = total_profit - admin_fees result = money_kept return result
Emily washes her hands for 15 seconds every hour for 12 hours a day for a week. If she uses 1 tablespoon of water per wash, how much water does she use in the week?
def solve() -> int: seconds_per_wash = 15 hours_per_day = 12 days_per_week = 7 tablespoons_per_wash = 1 total_washes = hours_per_day * days_per_week total_seconds = total_washes * seconds_per_wash total_tablespoons = total_washes * tablespoons_per_wash water_used = total_tables...
A shopkeeper bought 60 necklaces. She sold 70% of them and then received 12 new ones. How many necklaces does she have now?
def solve() -> int: initial_necklaces = 60 sold_necklaces_percent = 0.7 new_necklaces = 12 remaining_necklaces = (initial_necklaces * (1-sold_necklaces_percent)) + new_necklaces result = remaining_necklaces return result
A restaurant sold 35 bowls of pho, 40 bowls of banh mi, and 15 bowls of spring rolls. If 80% of the pho and banh mi bowls combined were consumed, how many bowls of food were consumed in total?
def solve() -> int: pho_banhmi_sold = 35 + 40 pho_banhmi_consumed = pho_banhmi_sold * 0.8 total_bowls_consumed = pho_banhmi_consumed + 15 result = total_bowls_consumed return result
Tom is making toast. He sets the toaster to level 5. Each minute the bread toasts another level. Once the toaster reaches level 9, Tom needs to wait for 2 minutes before adding butter. Then it will take him 1/3 that time to pour his coffee. How long does it take Tom to have breakfast?
def solve() -> int: toaster_level = 5 toast_time = 0 while toaster_level < 9: toaster_level += 1 toast_time += 1 toast_time += 2 coffee_time = toast_time / 3 breakfast_time = toast_time + coffee_time result = breakfast_time return result
Samantha runs a gym that employs trainers and receptionists in different positions in the gym. If there are 20 more receptionists than trainers and 80 people working for Samantha, how many trainers does she employ?
def solve() -> int: result = 30 return result
A teacher bought 12 L of juice for a class party. She poured the juice equally into 30 cups. How many milliliters of juice were in each cup?
def solve() -> int: juice_in_mL = 12 * 1000 juice_per_cup = juice_in_mL / 30 result = juice_per_cup return result
Emily planted 50 seeds in her backyard. Eleven of the seeds didn't develop. Half of the remaining seeds grew, but the plants were damaged by a hailstorm. One-third of the uneaten plants were strangled by vines. Emily left two weeds in her garden because they were low maintenance. How many plants did Emily end up with?
def solve() -> int: seeds_planted = 50 seeds_not_developed = 11 seeds_remaining = seeds_planted - seeds_not_developed seeds_grew = seeds_remaining / 2 plants_damaged = seeds_grew * 0.5 uneaten_plants = seeds_grew - plants_damaged strangled_plants = uneaten_plants / 3 plants_left = uneate...
Tom has baked 4 cakes and took an average of 45 minutes per cake. If he wants to keep his overall average baking time under 60 minutes per cake, how long can he spend on the next cake?
def solve() -> int: num_cakes = 4 avg_time_per_cake = 45 total_time = num_cakes * avg_time_per_cake max_total_time = (num_cakes + 1) * 60 max_time_next_cake = max_total_time - total_time result = max_time_next_cake return result
Lily is studying bikes and their weight. The first bike she weighs is 15 pounds and is 2 feet long. The second bike she weighs is 20 pounds and is 2.5 feet long. The third bike she weighs is 25 pounds and is 3 feet long. The final bike she weighs is 30 pounds and is 3.5 feet long. On average, how many pounds per foot a...
def solve() -> int: bike1_weight = 15 bike1_length = 2 bike2_weight = 20 bike2_length = 2.5 bike3_weight = 25 bike3_length = 3 bike4_weight = 30 bike4_length = 3.5 total_weight = bike1_weight + bike2_weight + bike3_weight + bike4_weight total_length = bike1_le...
A coach asked Mark, Ben, and Sophie to purchase basketballs and track their bounce heights. Mark bought half the number of basketballs that Ben bought, while Sophie got 30 fewer than Ben. If Mark purchased 12 basketballs, what is the average number of basketballs the three bought?
def solve() -> int: mark_basketballs = 12 ben_basketballs = mark_basketballs * 2 sophie_basketballs = ben_basketballs - 30 total_basketballs = mark_basketballs + ben_basketballs + sophie_basketballs average_basketballs = total_basketballs / 3 result = average_basketballs return res...
There are 360 degrees in a circle. If 126 degrees have already been used, how many degrees are left in the circle?
def solve() -> int: total_degrees = 360 used_degrees = 126 left_degrees = total_degrees - used_degrees result = left_degrees return result
A company has 300 employees. 2/5 of them are managers, and 1/4 are salespeople. 1/6 of the remaining employees are IT professionals, and the rest are support staff. How many employees are support staff?
def solve() -> int: total_employees = 300 manager_employees = total_employees * 2/5 sales_employees = total_employees * 1/4 remaining_employees = total_employees - manager_employees - sales_employees it_employees = remaining_employees * 1/6 support_employees = total_employees - manager_employees...
During a sunny Sunday drive, Jane's car traveled 54 less than 132 miles, and she saw 3 more than 42 stop signs. How many stop signs per mile did Jane see on her Sunday drive?
def solve() -> int: distance = 132 - 54 stop_signs = 42 + 3 result = stop_signs/distance return result
A lemonade stand sells a small cup for 25 cents and a large cup for 50 cents. On Monday, they sold 24 small cups and 16 large cups. On Tuesday, they sold 18 small cups and 20 large cups. How much money did they make in total on both days?
def solve() -> int: result = 2850 / 100 return result
Kyle received 12 green marbles, 10 blue marbles, and 8 yellow marbles from his grandma. But, he was so excited that he ended up dropping one of each color. How many marbles does Kyle have in total now?
def solve() -> int: green = 12 blue = 10 yellow = 8 green-=1 blue-=1 yellow-=1 result = green + blue + yellow return result
A box of candy has 25 pieces. If 4 candy pieces are taken out, how many pieces are left in the box?
def solve() -> int: remaining_candy = 25 - 4 result = remaining_candy return result
Student: In a rectangular garden, with length of 8m and width of 16m, what is the perimeter of the garden?
def solve() -> int: length = 8 width = 16 perimeter = 2 * (length + width) result = perimeter return result
There are four times as many students as teachers in a school and twice as many desks as students. How many desks and teachers in total are in the school if the number of students is 80?
def solve() -> int: teachers = 80 / 4 desks = 80 * 2 total = desks + teachers result = total return result
Student: The dimensions of a rectangle are 8 cm and 11 cm. What is the perimeter of the rectangle?
def solve() -> int: length = 8 width = 11 perimeter = 2 * (length + width) result = perimeter return result
- Lily has a square sheet of paper that has a side length of 12 inches. She wants to cut it into smaller squares that have a side length of 3 inches. How many smaller squares can she cut?
def solve() -> int: large_side = 12 small_side = 3 large_area = large_side ** 2 small_area = small_side ** 2 squares = large_area / small_area result = int(squares) return result
A rectangular garden is 10 meters long and 8 meters wide. If Sara plants flowers in the garden leaving a 1-meter-wide path around it, what is the area of the path in square meters?
def solve() -> int: length = 10 width = 8 path_width = 1 area_of_inner_garden = (length - (2*path_width)) * (width - (2*path_width)) area_of_outer_garden = length * width area_of_path = area_of_outer_garden - area_of_inner_garden result = area_of_path return result
If the price of a shirt at a store is $25, and the cost of a pair of jeans is $40, and if John went to the store with a $100 bill and bought two shirts and three pairs of jeans, calculate the change he received.
def solve() -> int: shirt_price = 25 jeans_price = 40 john_cash = 100 num_shirts = 2 num_jeans = 3 total_cost = (shirt_price*num_shirts) + (jeans_price*num_jeans) change = john_cash - total_cost result = change return result
A rectangular box has a length of 28 cm, a width of 15 cm, and a height of 10 cm. If the box is filled with water, calculate the total volume of water the box can hold, in liters.
def solve() -> int: length = 28 width = 15 height = 10 total_volume = length*width*height/1000 result = round(total_volume, 2) return result
Yesterday, Paul spent $60 on 3 notebooks, dividing the cost equally between them. Today, he plans to spend four times as much as he did yesterday on textbooks. Tomorrow, he'll spend 5 times as much as he did yesterday on notebooks. How much will Paul spend on textbooks and notebooks over these three days?
def solve() -> int: notebook_cost = 60/3 textbook_cost_today = 4*60 notebook_cost_tomorrow = 5*notebook_cost total_cost = textbook_cost_today + notebook_cost*3 + notebook_cost_tomorrow*3 result = total_cost return result
A rectangle has dimensions 10 inches by 6 inches. If a square of maximum side is cut from the corner, what is the area of the remaining shape?
def solve() -> int: length = 10 width = 6 square_side = min(length, width) new_length = length - square_side new_width = width - square_side new_area = new_length * new_width result = new_area return result
A company produced 10% more products in the second quarter than in the first quarter, and 25% more products in the third quarter than in the second quarter. If they produced 1000 products in the first quarter, how many products did they produce in the third quarter?
def solve() -> int: second_quarter_production = 1.1*1000 third_quarter_production = 1.25*second_quarter_production result = third_quarter_production return result
A store offers a 20% discount on all items over $100. A customer buys a jacket for $125 and a shirt for $70. The sales tax is 9.75%. How much does the customer pay in total?
def solve() -> int: jacket_cost = 125 shirt_cost = 70 subtotal = jacket_cost + shirt_cost if subtotal > 100: discount = 0.20 discount_amount = subtotal * discount subtotal -= discount_amount sales_tax = 0.0975 tax_amount = subtotal * sales_tax total_cost = subtotal + tax_am...
Rachel takes a 25-minute bus ride to the mall. After shopping, she walks to the restaurant which is 1 mile away. If she walks a total of 3 miles, how far is the mall from her house?
def solve() -> int: bus_ride_time = 25 walking_distance_to_restaurant = 1 total_walking_distance = 3 distance_to_mall = total_walking_distance - walking_distance_to_restaurant result = distance_to_mall return result
Student: A jar has 50 marbles, 30 of which are blue and the rest are red. What percentage of the marbles are red?
def solve() -> int: total = 50 blue = 30 red = total - blue percentage = red / total * 100 result = percentage return result
Student: An ice cream shop sold a total of 54 ice creams. 11 customers bought one scoop of ice cream, three customers bought three scoops, and the rest bought two scoops. How many customers bought two scoops of ice cream?
def solve() -> int: total_ice_creams = 54 one_scoop_customers = 11 three_scoop_customers = 3 two_scoop_customers = total_ice_creams - (one_scoop_customers + three_scoop_customers * 3) result = two_scoop_customers // 2 return result
Possible math questions and programs are: Mia and Leo are making bracelets with beads. Mia uses 12 beads for each bracelet and makes 8 bracelets. Leo uses 9 beads for each bracelet and makes 10 bracelets. How many more beads does Mia use than Leo?
def solve() -> int: mia_beads_per_bracelet = 12 mia_bracelets = 8 leo_beads_per_bracelet = 9 leo_bracelets = 10 mia_total_beads = mia_beads_per_bracelet * mia_bracelets leo_total_beads = leo_beads_per_bracelet * leo_bracelets difference = mia_total_beads - leo_total_beads result = differ...
A candy store sells candy for $1.25 per piece. During a sale, they offer a discount of 2 candies for every 3 purchased. If a customer purchases 20 pieces of candy during the sale, how much do they pay?
def solve() -> int: regular_price = 1.25 num_candies = 20 discounted_candies = num_candies // 3 * 2 num_to_pay = num_candies - discounted_candies total_price = num_to_pay * regular_price result = total_price return result
Mike needs to buy some wood boards for his new project. A woodpack contains 24 boards, each board is 2 ft long. How many packs of wood does Mike need to buy to get 286 ft?
def solve() -> int: packs = 286 // 2 result = packs//24 return result
Student: A factory can produce 10 items per hour. How many hours does it take to produce 150 items?
def solve() -> int: items_per_hour = 10 items_to_produce = 150 hours = items_to_produce / items_per_hour result = hours return result
Student: Christina has 18 coins spread equally among 3 jars. If she puts the same number of coins in each jar, how many coins are in each jar?
def solve() -> int: coins = 18 jars = 3 coins_per_jar = 0 coins_per_jar = coins // jars result = coins_per_jar return result
Student: A rectangle has a length of 8 cm and a width of 3 cm. What is its perimeter?
def solve() -> int: length = 8 width = 3 perimeter = 2 * (length + width) result = perimeter return result
Student: Tom bought a book for $15, pens for $5 and a calculator for $20. He paid with a fifty-dollar bill. How much change, in dollars, did Tom get?
def solve() -> int: book = 15 pens = 5 calculator = 20 bill = 50 total_cost = book + pens + calculator change = bill - total_cost result = change return result
Ava goes to a flower shop and buys 12 bouquets for her friends. Each bouquet contains 5 flowers. If she wants to distribute the flowers equally among her friends, how many friends will receive flowers?
def solve() -> int: bouquets = 12 flowers_per_bouquet = 5 total_flowers = bouquets * flowers_per_bouquet friends = total_flowers // 12 result = friends return result
A company sells a product for $50 and makes a profit of 20% on each sale. How much profit does the company make if it sells 100 units?
def solve() -> int: profit_per_unit = 50 * 0.2 profit = profit_per_unit * 100 result = profit return result
The park has 6 benches and 24 people. If each bench can fit 4 people, how many of the benches will be left unoccupied?
def solve() -> int: no_of_unoccupied_benches = 0 no_of_benches = 6 no_of_people = 24 no_of_people_each_bench_can_sit = 4 no_of_people_total_benches_can_fit = no_of_benches * no_of_people_each_bench_can_sit no_of_unoccupied_benches = no_of_people_total_benches_c...
A train travels from Station A to Station B at a speed of 50 miles per hour and then travels from Station B to Station C at a speed of 60 miles per hour. The distance from A to B is 100 miles and from B to C is 75 miles. How long does the train take to travel from A to C in hours?
def solve() -> int: time_AB = 100 / 50 time_BC = 75 / 60 total_time = time_AB + time_BC result = f'The train takes {total_time} hours to travel from A to C' result = total_time return result
Francesco has collected 150 baseball cards. He arranges them in groups of 10. How many groups did he make?
def solve() -> int: baseball_cards = 150 group_size = 10 result = baseball_cards / group_size return result
The circumference of a circle is 22 meters. What is the diameter of the circle?
def solve() -> int: circumference = 22 diameter = circumference/3.14 result = 7.01 return result
Alice buys 100 pieces of gum for her classmates. There are 25 classmates in her class. If each classmate gets 3 pieces, how many pieces of gum will be left?
def solve() -> int: gum_bought = 100 classmates = 25 pieces_per_classmate = 3 total_pieces_needed = classmates * pieces_per_classmate pieces_left = gum_bought - total_pieces_needed result = pieces_left return result
A toy store receives a shipment of 500 toys, with 40% of them being dolls and the rest being action figures. How many action figures did they receive?
def solve() -> int: total_toys = 500 percent_dolls = 40 num_dolls = total_toys * (percent_dolls / 100) num_action_figures = total_toys - num_dolls result = num_action_figures return result
Four-fifths of the households in a neighborhood have a cat. One-third of the households with a cat also have a dog. If there are 12 households with both cats and dogs, how many households are in the neighborhood in total?
def solve() -> int: cat_households = 4/5 dog_households = 1/3 * cat_households both_households = 12 total_households = both_households / (1/3) result = total_households / (1/4/5) return result
A basketball team scored 82 points in one game. If they scored twice as many points in the second game, how many points did they score in both games combined?
def solve() -> int: points_in_first_game = 82 points_in_second_game = 2 * points_in_first_game total_points = points_in_first_game + points_in_second_game result = total_points return result
You have 120$ to spend on electronics. You buy a phone worth 80$, and 1/4 of what's left on a pair of headphones. How much money do you have left?
def solve() -> int: phone = 80 left = 120 - phone headphones = left / 4 result = left - headphones return result
In a jar of honey, there are 240 ounces. If two-thirds of the jar is 20 pints of honey and one pint is 16 ounces, how many ounces are in one-third of a pint?
def solve() -> int: jar_of_honey = 240 pints_of_honey = 20 ounces_in_pint = 16 total_ounces = pints_of_honey * ounces_in_pint one_third_pint = total_ounces / 3 result = one_third_pint return result
Student: Emily is ordering pizza online for her family. She wants to get two medium pizzas and one large pizza. One medium pizza has 8 slices and one large pizza has 12 slices. She also wants to get two drinks, one for $2.5 and one for $3. She has a coupon code that gives her a 20% discount on the pizza order, but not ...
def solve() -> int: medium_pizza_slices = 8 large_pizza_slices = 12 num_medium_pizzas = 2 num_large_pizzas = 1 drink_1_price = 2.5 drink_2_price = 3 discount_percentage = 0.2 delivery_fee = 5 tip_percentage = 0.15 total_pizza_price = (num_medium_pizzas * medium_pizza_slices + num...
The distance between two cities is 600 miles. If a car travels at 60 mph, how long does it take to get there?
def solve() -> int: distance = 600 speed = 60 time = distance / speed result = time return result
Mia drives for 30 minutes each day for the first 180 days of the year and 45 minutes for the remaining days. How many hours did she drive in total for the year?
def solve() -> int: minutes_per_day = 30 days_first_half = 180 days_second_half = 365 - days_first_half minutes_first_half = minutes_per_day * days_first_half minutes_second_half = minutes_per_day * days_second_half total_minutes = minutes_first_half + minutes_second_half total_hou...
Mark is counting paper clips. Out of every pile of 50 paper clips, he loses 10 of them. He needs to pack 5 packets with 30 paper clips in each packet. How many paper clips should he start with to make up for the lost ones?
def solve() -> int: pile_size = 50 lost_per_pile = 10 num_packets = 5 packet_size = 30 total_lost = (lost_per_pile / pile_size) * (num_packets * packet_size) clips_needed = total_lost / (1 - (lost_per_pile / pile_size)) result = clips_needed return resu...
If it costs $10 to fill up a car's gas tank and the tank can hold 15 gallons, how much does one gallon of gas cost?
def solve() -> int: tank_size = 15 fillup_cost = 10 cost_per_gallon = fillup_cost / tank_size result = cost_per_gallon return result
A right triangle has sides of length 3, 4, and 5 (an example of a Pythagorean triple). What is the perimeter of this triangle?
def solve() -> int: a = 3 b = 4 c = 5 perimeter = a + b + c result = perimeter return result
amantha wants to make cookies. She has 2 cups of sugar and 1 cup of butter. The recipe calls for 1/2 cup of sugar and 1/4 cup of butter for each batch. How many batches of cookies can Samantha make?
def solve() -> int: sugar_cups = 2 butter_cups = 1 sugar_per_batch = 0.5 butter_per_batch = 0.25 batches = min(sugar_cups // sugar_per_batch, butter_cups // butter_per_batch) result = batches return result
Student: A recipe calls for 2 1/2 cups of flour to make 24 cookies. How much flour is needed to make 60 cookies?
def solve() -> int: cookies = 60 recipe_cookies = 24 recipe_flour = 2.5 flour = (cookies / recipe_cookies) * recipe_flour result = flour return result
Leah loves to play the piano. She played a piece that was 10 minutes long. Then she played 2 pieces that were one-tenth as long as the first piece. She finished by playing a piece that was 3 minutes shorter than her first piece. What was the average length of the pieces that Leah played?
def solve() -> int: first_piece = 10 second_piece = first_piece / 10 third_piece = first_piece / 10 fourth_piece = first_piece - 3 total_time = first_piece + second_piece + third_piece + fourth_piece average_length = total_time / 4 result = average_length return result
Student: A car rental company charges a flat rate of $50 per day plus $0.30 per mile driven. If a customer rented a car for 5 days and drove 250 miles, how much did they owe?
def solve() -> int: flat_rate = 50 mile_rate = 0.3 days = 5 miles = 250 total_cost = flat_rate * days + mile_rate * miles result = total_cost return result