question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Taylor is throwing a baby shower. She’s sending invitations to 15 of her friends from work and 10 of her friends from college. Each friend is allowed to bring 3 more guests. How many people are attending the baby shower?
def solve() -> int: work_friends = 15 college_friends = 10 extra_guests = 3 total_attendees = (work_friends + college_friends) + (work_friends * extra_guests) + (college_friends * extra_guests) result = total_attendees return result
David is filling a bucket with water from a tap. The tap can fill the bucket with 8 liters of water per minute. The bucket can hold 40 liters of water when it is full. However, there is a hole in the bottom of the bucket that leaks 2 liters of water per minute. How many minutes will it take for the bucket to be full?
def solve() -> int: tap = 8 bucket = 40 leak = 2 water = 0 minutes = 0 while water < bucket: water = water + tap water = water - leak minutes = minutes + 1 result = minutes return result
A grocery store owner wants to order packets of rice for the upcoming month. Each pack comes with 5 kg of rice. In the upcoming month, the store aims to sell 195kg of rice. How many packets should the owner order?
def solve() -> int: rice_needed = 195 pack_size = 5 packets = rice_needed // pack_size result = packets return result
A group of 6 friends went to a restaurant and the bill came out to be $124. If they want to split it evenly, how much does each person have to pay?
def solve() -> int: number_of_friends = 6 total_bill = 124 amount_per_person = total_bill / number_of_friends result = amount_per_person return result
Casey went on a road trip and drove 200 miles. He filled up petrol twice and each time he spent $30 on petrol. How much did the petrol cost per mile?
def solve() -> int: distance = 200 total_cost = 30 cost_per_mile = total_cost / distance result = cost_per_mile return result
William, James, and Benjamin have their football collection. Currently, James has twice as many footballs as William but has 8 fewer footballs than Benjamin. If Benjamin has 40 footballs now, how many more footballs should they collect so that all three of them will have a total of 200 footballs?
def solve() -> int: william_footballs = 0 james_footballs = 0 benjamin_footballs = 40 james_footballs = 2 * william_footballs james_footballs = benjamin_footballs - 8 total_footballs = william_footballs + james_footballs + benjamin_footballs additional_footballs = 200 - total_footb...
Three years ago, Harper was seven times the age of her little brother Owen. Owen is half the age of their father who is 64. How old is Harper now?
def solve() -> int: father_age = 64 owen_age = father_age / 2 harper_age_three_years_ago = 7 * (owen_age - 3) harper_age = harper_age_three_years_ago + 3 result = harper_age return result
Amanda is baking a cake for her brother's birthday party. If the recipe requires 3 cups of eggs and 5 cups of sugar, how many total cups of ingredients will she need to make the cake?
def solve() -> int: def totalCups (x, y): result = x + y return result totalCups = totalCups(3, 5) result = totalCups return result
Sophie works at a daycare center and the kids love to play with Lego. Each day, they use 15 Lego bricks to build different structures. If Sophie already has 50 Lego bricks, how many more does she need to keep the kids entertained for the entire week? A store sells 4 more than triple the amount of t-shirts as sweatshirt...
def solve() -> int: bricks_per_day = 15 starting_bricks = 50 days_in_week = 7 total_bricks_needed = bricks_per_day * days_in_week additional_bricks_needed = total_bricks_needed - starting_bricks sweatshirts = (98 - 4) / 4 t_shirts = 98 - sweatshirts res...
If 17 tomatoes cost $4, how much will 6 tomatoes cost?
def solve() -> int: cost_17_tomatoes = 4 number_6_tomatoes = 6 cost_6_tomatoes = (cost_17_tomatoes / 17) * number_6_tomatoes result = cost_6_tomatoes return result
Alejandra has 4/5 of a liter of water. She needs to pour enough water to fill a 3/5 liter jug. How much additional water does she need?
def solve() -> int: water_amount = 4/5 jug_amount = 3/5 amount_missing = jug_amount - water_amount result = amount_missing return result
Emma is calculating the distance between different cities. She notes that the distance between City A and City B is 120 miles and the distance between City C and City A is 0.33 times bigger than City B to City A. How far is City C from City B in miles?
def solve() -> int: distance_AB = 120 distance_CA = distance_AB * 1.33 distance_CB = distance_CA - distance_AB result = distance_CB return result
Kevin has 102 marbles. If he gives away 25% of them to his friend Jack and then buys another 70 marbles, how many marbles does he have now?
def solve() -> int: num_marbles = 102 num_given = num_marbles / 4 num_remaining = num_marbles - num_given num_total = num_remaining + 70 result = num_total return result
Rachel wants to make a fruit salad with apples, bananas, and oranges. She has 12 apples that each weigh 4 ounces, 18 bananas that each weigh 6 ounces, and 15 oranges that each weigh 8 ounces. She also wants to add 10 ounces of yogurt and 4 ounces of granola to the salad. How many ounces of fruit salad can she make in t...
def solve() -> int: apple_weight = 12 * 4 banana_weight = 18 * 6 orange_weight = 15 * 8 fruit_weight = apple_weight + banana_weight + orange_weight salad_weight = fruit_weight + 10 + 4 result = salad_weight return result
Ethan and his friends decide to bring their basketballs together for a game. 3 of his friends come first, each having twice as many basketballs as Ethan has. Another four of his friends have 1 basketball each. If Ethan has 2 basketballs, what's the total number of basketballs they have together?
def solve() -> int: ethan_basketballs = 2 friend_basketballs = ethan_basketballs * 2 first_three_friends_basketballs = friend_basketballs * 3 next_four_friends_basketballs = 1 * 4 total_basketballs = first_three_friends_basketballs + next_four_friends_basketballs + ethan_basketba...
Simon had 56 pencils. He lost a fifth of them and then found 8 more. He then gave away a third of his remaining pencils. How many pencils does he have left?
def solve() -> int: pencils = 56 lost_pencils = pencils / 5 remaining_pencils = pencils - lost_pencils found_pencils = remaining_pencils + 8 given_away_pencils = found_pencils / 3 remaining_pencils = found_pencils - given_away_pencils result = remaining_pencils return result
Olivia wants to visit her grandmother, who is 120 miles away. Her car can go 25 miles per gallon, and she has a 10-gallon gas tank. How many additional miles can she cover after reaching granny's house without refueling again?
def solve() -> int: distance_to_granny = 120 miles_per_gallon = 25 gas_tank_size = 10 gallons_to_granny = distance_to_granny / miles_per_gallon gallons_left = gas_tank_size - gallons_to_granny additional_miles = gallons_left * miles_per_gallon result = additional_miles ...
Lisa wants to buy some books for her summer reading. She has a coupon that gives her 20% off the original price of each book. She buys 4 books, each of which costs $12. She also needs to pay 7% sales tax on the discounted price. How much does she pay in total?
def solve() -> int: price = 12 discount = 0.2 tax = 0.07 book_cost = price * (1 - discount) total_cost = book_cost * 4 * (1 + tax) result = total_cost return result
A triangle has a base of 8 meters and a height of 12 meters. What is the area of the triangle?
def solve() -> int: base = 8 height = 12 area = 1/2 * base * height result = area return result
Student: Rachel ordered 5 boxes of books that each weighed 9 kg. How much did the 5 boxes of books weigh together?
def solve() -> int: num_boxes = 5 weight_per_box = 9 total_weight = num_boxes * weight_per_box result = total_weight return result
A bakery sells cakes for $30 each. If the bakery sells 20 cakes in one day, how much revenue did the bakery generate?
def solve() -> int: num_cakes_sold = 20 price_per_cake = 30 revenue = num_cakes_sold * price_per_cake result = revenue return result
An electronics store offers 36 batteries for $12. WalMart offers 24 batteries for $10. How much more expensive, per battery, in cents, is the electronics store?
def solve() -> int: electronics_batteries = 36 electronics_price = 12 walmart_batteries = 24 walmart_price = 10 electronics_price_per_battery = electronics_price / electronics_batteries walmart_price_per_battery = walmart_price / walmart_batteries price_difference = (electronics_pr...
A car travels 150 miles in 2.5 hours. What is the average speed of the car in miles per hour?
def solve() -> int: distance_traveled = 150 time_taken = 2.5 average_speed = distance_traveled / time_taken result = average_speed return result
Student: Anna has 4 bags of candy. If each bag contains 15 pieces of candy, how many pieces of candy does she have?
def solve() -> int: bag_count = 4 pieces_per_bag = 15 total_pieces = bag_count * pieces_per_bag result = total_pieces return result
Student: At a market, 12 apples cost $6. How much will 6 apples cost?
def solve() -> int: num_apples = 6 cost_12_apples = 6 cost_6_apples = cost_12_apples / 2 * num_apples result = cost_6_apples return result
Student: **** Nathan buys 60 tomatoes from the farmer's market. He wants to buy 10% more vegetables than the amount of tomatoes he bought. How many vegetables does he need to buy in total?
def solve() -> int: tomatoes = 60 increase = tomatoes * 0.1 vegetables = tomatoes + increase result = vegetables return result
A pet store gives away 1 chew toy per dog adoption. If there are 25 dog adoptions in a week and it takes 20 minutes to process each adoption, how many chew toys are given away in a week?
def solve() -> int: adoptions_per_week = 25 minutes_per_adoption = 20 toys_given_away = adoptions_per_week * 1 total_minutes = adoptions_per_week * minutes_per_adoption result = toys_given_away return result
A shop sells two types of rice - A and B. 2 pounds of A and 3 pounds of B cost $10, while 5 pounds of A and 6 pounds of B cost $20. What is the price per pound of rice A?
def solve() -> int: pounds_A1 = 2 pounds_B1 = 3 pounds_A2 = 5 pounds_B2 = 6 cost1 = 10 cost2 = 20 A_price = (cost2 * pounds_A1 - cost1 * pounds_A2) / (pounds_B1 * pounds_A2 - pounds_A1 * pounds_B2) result = A_price return result
A gas station sells regular gasoline for $2.50 per gallon. If a car's gas tank can hold 15 gallons, how much would it cost to fill up the tank?
def solve() -> int: price_per_gallon = 2.50 tank_size = 15 total_cost = price_per_gallon * tank_size result = total_cost return result
In a bookstore’s yearly budget of $1.5 million, 20% goes towards rent and $200,000 goes towards advertising. How much is left for paying employees?
def solve() -> int: budget = 1500000 rent = budget * 0.2 advertising = 200000 employees = budget - rent - advertising result = employees return result
If the sum of three numbers is 54 and the difference of the same three numbers is 6, what are the three numbers?
def solve() -> int: sum_of_three = 54 difference_of_three = 6 x = 54 - sum_of_three/3 y = 54 - x z = 54 - x - y x = 6 + difference_of_three/3 y = x - 6 z = x - y - 6 result = x, y, z return result
If John drinks 2 cups of water every 3 hours and drinks 6 cups of water before bedtime, how many cups of water does he drink in 24 hours?
def solve() -> int: water_per_hr = 2 hours_awake = 24 water_before_bed = 6 water_per_day = (water_per_hr * (hours_awake // 3)) + water_before_bed result = water_per_day return result
A company wants to increase their sales by 25%. If they currently sell $10,000 worth of items per month, how much would they sell per month after the increase?
def solve() -> int: current_sales = 10000 increase_percentage = 0.25 increase_amount = current_sales * increase_percentage new_sales = current_sales + increase_amount result = new_sales return result
Student: A company has 50 employees, each earning a salary of $2000 per month. The employees are given a 10% raise. How much does the company pay in total per month after the raise?
def solve() -> int: num_employees = 50 salary_per_month = 2000 raise_percentage = 0.1 total_salary_before_raise = num_employees * salary_per_month total_salary_after_raise = total_salary_before_raise + (total_salary_before_raise * raise_percentage) result = total_salary_after_raise return r...
a digital store sells a game for $30. In one month, the store sells an average of 120 copies of the game. How much money do they make in one month selling this game?
def solve() -> int: total_money = 120*30 result = total_money return result
Rachel prepares for an exam for 10 hours every week for 2 months, but she's only 20% prepared. If she increases her studying hours to 15 a week, how much longer will it take her to be fully prepared?
def solve() -> int: hours_per_week = 10 months = 2 percent_prepared = 20 total_hours = hours_per_week * months * 4 hours_needed = total_hours / (percent_prepared / 100) new_hours_per_week = 15 new_total_hours = new_hours_per_week * months * 4 additional_hours_needed = new_...
Fiona has 20 more Lego pieces than Jonathan. If Jonathan has 30 Lego pieces, how many Lego pieces do they both have combined?
def solve() -> int: jonathan_legos = 30 fiona_legos = jonathan_legos + 20 total_legos = jonathan_legos + fiona_legos result = total_legos return result
Possible new questions and programs are: Kamal has 10 pencils, three times as many erasers as pencils, and four more sharpeners than erasers. What percentage of his stationery items are sharpeners, rounded to the nearest percent?
def solve() -> int: pencils = 10 erasers = 3 * pencils sharpeners = erasers + 4 total = pencils + erasers + sharpeners percentage = sharpeners / total * 100 result = round(percentage) return result
Alex can mow the lawn in 25 minutes and trim the hedges in 10 minutes. How long will it take him to mow 3 lawns and trim 5 sets of hedges?
def solve() -> int: mow_time = 25 hedge_time = 10 lawns = 3 hedges = 5 total_mow_time = mow_time * lawns total_hedge_time = hedge_time * hedges total_time = total_mow_time + total_hedge_time result = total_time return result
A farmer had 800 bags of potatoes, intending to sell each for $20. But 350 bags of potatoes were spoiled. To sell the remaining bags of potatoes, the farmer had to reduce the price to $17 per bag. How much money did the farmer lose compared to what he would have made if he sold all 800 bags at the original price?
def solve() -> int: bags_of_potatoes = 800 original_price = 20 spoiled_bags = 350 reduced_price = 17 remaining_bags = bags_of_potatoes - spoiled_bags original_earning = bags_of_potatoes * original_price reduced_earning = remaining_bags * reduced_price money_lost = original_earning -...
An online store is offering free shipping for purchases over $50. If Tina spent $75 on a new laptop case, how much did she save on shipping costs?
def solve() -> int: purchase_amount = 75 free_shipping_threshold = 50 if purchase_amount > free_shipping_threshold: saved_shipping_costs = purchase_amount else: saved_shipping_costs = 0 result = saved_shipping_costs return result
Student: A car is travelling at 25 mph for 1 hour and 40 minutes. How many miles has the car travelled?
def solve() -> int: speed = 25 time = 100 distance = speed * (time/60) result = distance return result
If Laura's house is worth 15% more than what she bought it for, and she wants to buy a new house that costs $800,000, but she needs to take a loan for 70% of the cost, how much did Laura buy her old house for?
def solve() -> int: old_house_cost = 800000 / (1 - 0.7) result = old_house_cost / 1.15 return result
If a circle has a radius of 5 units, what is the circumference of the circle?
def solve() -> int: circle_radius = 5 pi = 3.14159 circumference = 2 * pi * circle_radius result = circumference return result
A bag contains 3 red balls, 2 blue balls, and 5 yellow balls. If you pick a ball at random, what is the probability that it will be a blue ball?
def solve() -> int: total_balls = 10 blue_balls = 2 probability_blue_ball = blue_balls / total_balls result = f'{probability_blue_ball}' result = probability_blue_ball return result
Ronaldo and Dakota are skaters, if Ronaldo did 10 jumps while Dakota did 8 jumps, how many jumps did they do together?
def solve() -> int: ronaldo_jumps = 10 dakota_jumps = 8 result = ronaldo_jumps + dakota_jumps return result
If a bicycle goes 10 miles in 45 minutes, how fast is it going in miles per hour?
def solve() -> int: distance = 10 time = 0.75 speed = distance / time result = speed return result
If the sum of two numbers is 60 and one number is twice the other, what are the numbers?
def solve() -> int: number2 = 2/(1+2)*60 number1 = 60 - number2 result = (number1, number2) return result
Student: Amy paid $17 for 5 dozen apples and 2 bunches of bananas. How much does a dozen of apples cost?
def solve() -> int: cost_of_apples = 17 num_of_dozen_apples = 5 num_of_bunches_bananas = 2 cost_of_dozen_apples = cost_of_apples / num_of_dozen_apples result = cost_of_dozen_apples return result
David wants to learn French. He studies for 1 hour every weekday, on Saturdays he studies for 2 hours, and he takes Sundays off. How many hours will he study in the next month, if his French exam is in 5 weeks?
def solve() -> int: weekday_hours = 1 saturday_hours = 2 sunday_hours = 0 days_in_week = 7 weeks_in_month = 5 weekday_study_hours = weekday_hours * (days_in_week - 1) saturday_study_hours = saturday_hours sunday_study_hours = sunday_hours total_study_hours = (weekday_s...
A company makes two products, product X and product Y. The fixed cost to produce products X and Y is $50,000 and $30,000, respectively. The variable cost per unit for product X is $10 and for product Y is $15. If each unit of product X is sold for $30 and each unit of product Y is sold for $40, how many units of each p...
def solve() -> int: X_fixed_cost = 50000 Y_fixed_cost = 30000 X_variable_cost = 10 Y_variable_cost = 15 X_sale_price = 30 Y_sale_price = 40 X_break_even = X_fixed_cost / (X_sale_price - X_variable_cost) Y_break_even = Y_fixed_cost / (Y_sale_price - Y_variable_cost) result = (X_break_...
Sarah has twice as many apples as Jane. If Jane has 10 apples, how many apples does Sarah have?
def solve() -> int: jane_apples = 10 sarah_apples = jane_apples * 2 result = sarah_apples return result
Alex is baking muffins with chocolate chips, blueberries, and nuts. He wants to use three times as many chocolate chips as nuts, and 1/2 as many blueberries as chocolate chips. If he uses 120 nuts, how many blueberries does he need to use?
def solve() -> int: nuts = 120 chocolate_chips = 3 * nuts blueberries = chocolate_chips / 2 result = blueberries return result
Student: A recipe calls for 2 and 1/2 cups of sugar. If you want to make half of the recipe, how much sugar do you need?
def solve() -> int: original_amount = 2.5 fraction = 0.5 result = original_amount * fraction return result
Ron and Rachel bought 1 large pizza. Ron paid $20 and Rachel paid $13. They split the rest by half. How much did they have to pay in total?
def solve() -> int: total_cost = 20 + 13 + (13/2) result = total_cost return result
A train is traveling at 70 km/h. How long will it take to cover 210 km?
def solve() -> int: distance = 210 speed = 70 time_in_hours = distance / speed result = time_in_hours return result
Maddie has saved $160 and she wants to buy a new phone that costs $200. How much money does Maddie need to get the new phone?
def solve() -> int: saved_money = 160 phone_price = 200 result = phone_price - saved_money return result
A recipe calls for 3 cups of flour for every 2 cups of sugar. If you have 8 cups of sugar, how much flour do you need?
def solve() -> int: sugar = 8 flour = (3/2) * sugar result = flour return result
35% of phone calls received by a customer service center are complaints. If there are 100 calls received in a day, how many of them are likely to be complaints?
def solve() -> int: calls_received = 100 complaints_percentage = 35 complaints = (complaints_percentage / 100) * calls_received result = complaints return result
Some possible questions and programs are: A baker used 3 kg of flour and 2 kg of sugar to make 20 cakes. If the flour cost $1.5 per kg and the sugar cost $2 per kg, how much did the baker spend on the ingredients?
def solve() -> int: flour_cost = 3 * 1.5 sugar_cost = 2 * 2 ingredients_cost = flour_cost + sugar_cost result = ingredients_cost return result
A family goes grocery shopping. At the first store, they spend $50 on food. At the second store, they buy 3 items for $20 and 5 items for $40. How much did they spend in total?
def solve() -> int: store1_spending = 50 store2_spending = 20*3 + 40*5 total_spending = store1_spending + store2_spending result = total_spending return result
``` A juice bottle has a capacity of 500 milliliters and it is filled up to 65% of its capacity. How many milliliters of juice is in the bottle?
def solve() -> int: capacity_in_ml = 500 filled_up_to = 0.65 juice_in_bottle = capacity_in_ml*filled_up_to result = juice_in_bottle return result
A family orders two pizzas. The first pizza has a diameter of 15 inches and the second pizza has a diameter of 12 inches. If the pizzas cost $1.50 per square inch, how much did the family pay for both pizzas combined?
def solve() -> int: pizza1_diameter = 15 pizza2_diameter = 12 pizza_price_per_sq_inch = 1.5 pizza1_radius = pizza1_diameter / 2 pizza1_area = 3.14159 * (pizza1_radius ** 2) pizza2_radius = pizza2_diameter / 2 pizza2_area = 3.14159 * (pizza2_radius ** 2) total_pizza_cost = (pizza1_area + ...
For his graduation, Ethan received gadgets and money. His grandma gave him €25, his uncle €35 and his parents €60. With what he already had, he now has €185 in his wallet. He goes to an electronic store and buys a phone that costs €90. How much does he have left after this purchase?
def solve() -> int: grandma_money = 25 uncle_money = 35 parents_money = 60 total_money = grandma_money + uncle_money + parents_money phone_cost = 90 remaining_money = total_money - phone_cost result = remaining_money return result
One roll of tape is 36 yards long. If each piece of tape used is 12 inches long, how many pieces of tape can be made from 4 rolls of tape?
def solve() -> int: yards_per_roll = 36 inches_per_piece = 12 rolls = 4 total_yards = yards_per_roll*rolls*3 total_pieces = total_yards//inches_per_piece result = total_pieces return result
John wants to buy a shirt worth $25, but he has a coupon that gives a 20% discount. However, the store has a sales tax of 8%. What is the final amount John has to pay?
def solve() -> int: shirt_price = 25 discount = 0.2 discounted_price = shirt_price * (1 - discount) sales_tax = 0.08 final_price = discounted_price * (1 + sales_tax) result = final_price return result
A food recipe calls for 1/2 cup of sugar to make 6 cookies. If a baker wants to make 24 cookies, how much sugar will she need?
def solve() -> int: num_cookies = 24 sugar_per_cookie = 1/12 total_sugar = num_cookies * sugar_per_cookie result = f'The baker will need {total_sugar} cups of sugar.' result = total_sugar return result
Student: It cost $6 to make 3 drinks. If 22 drinks were made, how much was the total cost to make all 22 drinks?
def solve() -> int: cost_per_drink = 6 number_of_drinks = 22 total_cost = cost_per_drink * number_of_drinks result = total_cost return result
Michael painted a room that took him 2 more hours than it took Lisa to paint the same room. Lisa took 4 hours to paint the room. How many hours in total did Michael and Lisa spend on painting the room?
def solve() -> int: lisa_time = 4 michael_time = lisa_time + 2 total_time = lisa_time + michael_time result = total_time return result
Rachel is filling up her water tank with rainwater. If she collects 6 inches of rainwater in the first hour, and it keeps raining at a continuous rate of 3 inches per hour, how long will it take to fill up the tank if the tank is 48 inches tall?
def solve() -> int: rainwater_collected_first_hour = 6 rainwater_collected_per_hour = 3 tank_height = 48 hours_to_fill_tank = (tank_height - rainwater_collected_first_hour) / rainwater_collected_per_hour result = hours_to_fill_tank return result
A square has a perimeter of 20 cm. Find the area of the square.
def solve() -> int: perimeter = 20 side_length = perimeter / 4 area = side_length**2 result = area return result
Jana ordered 8 chocolate cupcakes and 3 lemon cupcakes from the bakery. She ate 5 cupcakes in total. What percentage of the cupcakes she ate were lemon cupcakes?
def solve() -> int: total_cupcakes = 11 lemon_cupcakes = 3 eaten_cupcakes = 5 lemon_percentage = lemon_cupcakes / total_cupcakes * eaten_cupcakes * 100 result = lemon_percentage return result
A store just received a shipment of 28 apples. If each apple costs $2, how much money does the store make after selling all apples?
def solve() -> int: num_apples = 28 price_apple = 2 total_cost = num_apples * price_apple result = total_cost return result
A student can type 60 words per minute. How long does it take him to type a 3-page essay if there are 350 words on each page?
def solve() -> int: words_per_minute = 60 words_per_page = 350 pages = 3 total_words = words_per_page * pages time_taken = total_words / words_per_minute result = time_taken return result
The ratio of boys to girls in a class is 5:3. If there are 120 students in the class, how many girls are there? Emma is taking a 40-question science exam and a 20-question history exam. She has 2 hours to complete both tests. If she wants to spend equal time on each question, how many more minutes does she have to answ...
def solve() -> int: total_students = 120 boy_ratio = 5 girl_ratio = 3 total_ratio = boy_ratio + girl_ratio girl_fraction = girl_ratio / total_ratio num_girls = girl_fraction * total_students result = num_girls total_time = 2 * 60 num_questions = 40 + 20 time_per_...
Mike wants to renovate his bathroom. He needs to pay $500 for permits. He hires a construction team which charges $250 per day and works for 2 weeks, with 8-hour workdays. He also pays an inspector who gives him a 60% discount to ensure the bathroom meets all code requirements. What is the total cost?
def solve() -> int: permit_cost = 500 construction_cost = 250 days_worked = 10 hours_per_day = 8 inspector_discount = 0.6 total_construction_cost = construction_cost * days_worked * hours_per_day inspector_cost = permit_cost * (1 - inspector_discount) total_cost = permit_c...
At a car garage, Jay's Check Engine Light repair costs $125 and he needs to pay 6% tax on the total. How much does Jay's total bill become?
def solve() -> int: repair_cost = 125 tax = 0.06 total_price = repair_cost * (1+tax) result = round(total_price,2) return result
Student: Susie has $35 to go to the supermarket. She bought 5 oranges and 10 cartons of grapefruit juice. Each orange cost $2 and each carton of grapefruit juice cost $2.50. How much money does Susie have left?
def solve() -> int: money = 35 oranges = 5 juice = 10 orange_price = 2 juice_price = 2.50 total_cost = oranges * orange_price + juice * juice_price result = money - total_cost return result
Mia is a waitress at a restaurant. She gets paid $10 per hour and gets an additional $2 for every order she serves. Mia gets a tip of $15 for serving a table of six or more. If Mia worked for 5 hours and served 70 orders to customers, and served seven tables of six or more, how much money did she make today?
def solve() -> int: hours_worked = 5 orders_served = 70 tables_served = 7 hourly_rate = 10 order_bonus = 2 tip_amount = 15 total_earnings = hours_worked * hourly_rate total_earnings += orders_served * order_bonus total_earnings += tables_served * tip_amount result ...
Edward needs to fill up his car with 35 liters of fuel. He pays $5.45 per liter. He also needs to pay 8% in taxes. How much total did Edward pay for the fuel, in dollars?
def solve() -> int: fuel_volume = 35 unit_price = 5.45 tax_rate = 0.08 total_cost_without_tax = fuel_volume * unit_price total_cost_with_tax = total_cost_without_tax * (1+tax_rate) result = round(total_cost_with_tax, 2) return result
There are 288 students in a school. If there are 32 students in each classroom, how many classrooms are there in the school?
def solve() -> int: total_students = 288 students_per_classroom = 32 classrooms = total_students // students_per_classroom result = classrooms return result
Emma won $75 in a scratch-off game. She decided to use the money to donate to charity. She donated $15 to the local food bank and twice as much to the children's hospital. Finally, she donated half of what she donated to the children's hospital to the animal shelter. How much money did she have left after donating?
def solve() -> int: scratch_off_winnings = 75 donation_food_bank = 15 donation_children_hospital = donation_food_bank * 2 donation_animal_shelter = donation_children_hospital / 2 money_left = scratch_off_winnings - (donation_food_bank + donation_children_hospital + donation_animal_shelter) ...
A basketball team won 60% of the 30 games they have played. How many games did they win in total?
def solve() -> int: total_games = 30 win_percentage = 0.6 games_won = total_games * win_percentage result = games_won return result
In a soccer game, 11 players enter the field. If 3 players are sent off, how many players are left?
def solve() -> int: players_original = 11 players_sentoff = 3 players_remaining = players_original - players_sentoff result = players_remaining return result
A bag contains 10 red marbles and 20 blue marbles. If two marbles are drawn randomly from the bag without replacement, what is the probability that they are both blue?
def solve() -> int: total_marbles = 30 total_draws = 2 blue_marbles = 20 blue_draws = 2 probability = (blue_marbles/total_marbles) * ((blue_marbles-1)/(total_marbles-1)) result = probability return result
Student: A supermarket has a sale where you can buy 3 bags of chips for $5. If each bag of chips normally costs $2, how much do you save with this deal if you buy 9 bags of chips?
def solve() -> int: normal_price = 2 sale_price = 5 bags = 9 total_normal = normal_price * bags groups = bags // 3 total_sale = groups * sale_price difference = total_normal - total_sale result = difference return result
John caught 15 fish on his first day of fishing. The next day he caught 10 more than the previous day. How many fish did he catch on the second day?
def solve() -> int: fish_on_first_day = 15 fish_on_second_day = fish_on_first_day + 10 result = fish_on_second_day return result
John bought a used car for $6,000. If he plans to pay back the money in 5 years, how much will he have to pay every month with an annual interest rate of 5%?
def solve() -> int: annual_interest_rate = 0.05 num_of_months = 5 * 12 monthly_interest_rate = annual_interest_rate/12 payment = (monthly_interest_rate * 6000) / (1 -(1+monthly_interest_rate)**(-num_of_months)) result = payment return result
Tom has 5 apples and 7 oranges in a basket. He gives 2 apples and 3 oranges to his friend. Then he eats 1 apple and 2 oranges. How many fruits does he have left in the basket?
def solve() -> int: apples = 5 oranges = 7 given_apples = 2 given_oranges = 3 eaten_apples = 1 eaten_oranges = 2 remaining_apples = apples - given_apples - eaten_apples remaining_oranges = oranges - given_oranges - eaten_oranges remaining_fruits = remaining_apples + remaining_oranges...
Student: There are 54 pencils in a box. Nate takes half of them while his sister takes one-third of them. How many pencils do Nate and his sister have together?
def solve() -> int: pencils_in_box = 54 nate_pencils = pencils_in_box / 2 sister_pencils = pencils_in_box / 3 total_pencils = nate_pencils + sister_pencils result = total_pencils return result
There are 10 pizzas that need to be divided among 4 people. How much pizza does each person get?
def solve() -> int: pizza_per_person = 10 / 4 result = pizza_per_person return result
Student: A cube has a volume of 216 cm³. What is the area of each face of the cube?
def solve() -> int: volume = 216 side_length = volume ** (1/3) area = side_length ** 2 result = area return result
A recipe calls for 2/3 cup of sugar and makes 12 cookies. How much sugar is needed to make 24 cookies?
def solve() -> int: sugar_per_cookie = 2/3 cookies_wanted = 24 sugar_needed = sugar_per_cookie * cookies_wanted result = sugar_needed return result
Erica has to take her daughter to daycare, which is 2.3 miles away, and then to the library, which is 1.5 miles away. She does this round trip to the daycare twice a day for 4 days a week and to the library once a week. What is the mileage of her car for a typical week?
def solve() -> int: daycare_distance = 2.3 library_distance = 1.5 round_trip_daycare = 2 * daycare_distance round_trip_library = 2 * library_distance weekly_daycare_distance = round_trip_daycare * 4 weekly_library_distance = round_trip_library * 1 total_weekly_distance = weekly_daycare_dista...
A soup recipe calls for 6 cups of water and 2 cups of noodles. For every cup of water added, another cup of noodles is added. If you want to make a pot of soup that has 12 cups of noodles in it, how many cups of water should be used?
def solve() -> int: water = 6 noodles = 2 total = water + noodles noodles_wanted = 12 water_wanted = (noodles_wanted - noodles) + water result = water_wanted return result
-A baker made 120 cupcakes for a party. He used 3 eggs for every 10 cupcakes. He also used 2 cups of flour for every 15 cupcakes. How many eggs and cups of flour did he use in total?
def solve() -> int: e = 3 * 12 f = 2 * 8 result = (e, f) return result
Harry runs 10 kilometers a day for 5 days a week. How many kilometers will he run in 4 weeks?
def solve() -> int: daily_distance = 10 days_per_week = 5 number_of_weeks = 4 distance = daily_distance * days_per_week * number_of_weeks result = distance return result
You have a rectangular garden that is 20 feet by 30 feet. You want to plant flowers in 1/4 of the garden. What is the area of the garden you will plant flowers in?
def solve() -> int: length = 30 width = 20 garden_area = length * width flower_area = garden_area / 4 result = flower_area return result
ve wants to plant a vegetable garden in his backyard and needs to measure the area of the area that he wants to use. The dimensions of the rectangle are 9 meters by 4 meters. How many square meters will Steve use for his garden?
def solve() -> int: length = 9 width = 4 area = length * width result = area return result
A pizza place charges a delivery fee of $5 plus $1.50 per mile traveled. If the delivery driver travels 10 miles to deliver a pizza, how much does the delivery cost?
def solve() -> int: mileage = 10 delivery_fee = 5 cost_per_mile = 1.5 total_cost = delivery_fee + (mileage * cost_per_mile) result = total_cost return result