question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
If a rectangle has a perimeter of 26 units and a width of 3 units, what is its length?
def solve() -> int: perimeter = 26 width = 3 length = (perimeter - 2 * width) / 2 result = length return result
A pizza costs $10 plus $2 per topping. If John orders 5 pizzas with 3 toppings each, how much will he have to pay in all?
def solve() -> int: pizza_cost = 10 topping_cost = 2 num_pizzas = 5 num_toppings = 3 total_cost = pizza_cost * num_pizzas + topping_cost * num_toppings * num_pizzas result = total_cost return result
A family goes on a vacation and rents a house for a week. The rental rate is $200 per night, but there is a 10% discount on the total cost for rentals of 7 nights or more. If the family stays for exactly 7 nights, what is the total cost of the rental?
def solve() -> int: rental_rate = 200 discount = 0.1 num_nights = 7 total_cost = rental_rate * num_nights if num_nights >= 7: total_cost *= (1 - discount) result = total_cost return result
A car travels 45 miles in 30 minutes. What is its average speed in miles per hour?
def solve() -> int: distance = 45 time = 0.5 speed = distance/time*2 result = speed return result
Jamie had some stickers. She gave 1/5 of them to her brother and then 1/4 of what she had left to her friend. If she now has 18 stickers left, how many stickers did she have originally?
def solve() -> int: jamie_stickers_left = 18 brother_stickers = jamie_stickers_left * 5 jamie_stickers_left = brother_stickers * (4/5) original_stickers = brother_stickers + jamie_stickers_left result = original_stickers return result
A rectangular room measures 25 feet by 18 feet. If tiles measure 1.5 feet by 1.5 feet, how many tiles are needed to cover the floor completely?
def solve() -> int: room_length = 25 room_width = 18 tile_length = 1.5 tile_width = 1.5 area_of_room = room_length * room_width area_of_tile = tile_length * tile_width num_tiles = area_of_room / area_of_tile result = num_tiles return result
A recipe calls for 2 1/2 cups of flour. If there are 4 cups in a pound of flour, how many pounds of flour are needed for the recipe?
def solve() -> int: cups_needed = 2.5 cups_per_pound = 4 pounds_needed = cups_needed / cups_per_pound result = pounds_needed return result
City worker Emma is tasked with digging a trench for a new pipeline. She dug 15 feet in 3 hours. Then, a sudden mudslide caused half of the trench to fill back up. After that, she dug an additional 5 feet. How much time will it take her to finish digging the trench?
def solve() -> int: dug_distance = 15 dug_time = 3 half_filled_distance = dug_distance / 2 additional_distance = 5 remaining_distance = dug_distance - half_filled_distance + additional_distance speed = dug_distance / dug_time time_needed = remaining_distance / speed r...
Ben sells cupcakes for $3 each and makes $2 of profit per cupcake. He also sells brownies for $4 each and makes $1.5 of profit per brownie. How much profit will he make if he sells 12 cupcakes and 8 brownies?
def solve() -> int: profit_from_cupcakes = 2 * 12 profit_from_brownies = 1.5 * 8 result = profit_from_cupcakes + profit_from_brownies return result
Two teammates, Kate and Emma, decide to buy a new basketball, a volleyball, and a football. The basketball costs $50, the volleyball costs $30, and the football costs $25. Kate agrees to pay for the basketball while Emma agrees to pay for the football. Then Kate agrees to pay 1/4 of the price of the volleyball and the ...
def solve() -> int: basketball_cost = 50 volleyball_cost = 30 football_cost = 25 kate_contribution = basketball_cost volleyball_split = volleyball_cost / 4 kate_contribution += volleyball_split emma_contribution = football_cost emma_contribution += volleyball_cost - volleyball_...
Emily decides to sell her handmade jewelry instead of wearing it. If she has 20 necklaces that weigh 2 ounces each and 30 earrings that weigh 0.5 ounces each, and she sells each for $5, how much money can she make?
def solve() -> int: num_necklaces = 20 necklace_weight = 2 num_earrings = 30 earring_weight = 0.5 price_per_item = 5 total_weight = num_necklaces * necklace_weight + num_earrings * earring_weight total_profit = price_per_item * (num_necklaces + num_earrings) result = total_prof...
A store sells shoes at $50 per pair. A customer bought 2 pairs of shoes and a pair of socks for $10. What was the price of the pair of socks?
def solve() -> int: price_shoes = 50 num_shoes = 2 total_cost = 2 * price_shoes + 10 price_socks = (total_cost - (2 * price_shoes)) / 1 result = price_socks return result
A class of 25 students collected a total of 650 cans for a recycling project. If each student needs to collect 20 cans, how many more cans does each student need to collect?
def solve() -> int: cans_total = 650 students = 25 cans_per_student = 20 cans_left = cans_total - (students*cans_per_student) result = cans_left/students return result
In a zoo, there are 90 animals in total. Three-tenths of the animals are reptiles and the rest are mammals. Among the reptiles, one-fourth are snakes and the rest are lizards. How many more lizards are there than snakes in the zoo?
def solve() -> int: rep = 90 * 3 / 10 sna = rep / 4 liz = rep - sna diff = liz - sna result = diff return result
Daniel sold some lemonade at a stand. He sold 22 cups of lemonade for $0.50 each, 18 cups of lemonade for $0.75 each, and 14 cups of lemonade for $1.00 each. How much money did Daniel make in total?
def solve() -> int: cups_50 = 22 cups_75 = 18 cups_100 = 14 price_50 = 0.50 price_75 = 0.75 price_100 = 1.00 revenue_50 = cups_50 * price_50 revenue_75 = cups_75 * price_75 revenue_100 = cups_100 * price_100 total = revenue_50 + revenue_75 + revenue_100 result ...
A printer normally costs $100. Rick is buying the printer at a 25% discount. How much does Rick save in total?
def solve() -> int: original_price = 100 discount_rate = 0.25 discount = original_price * discount_rate final_price = original_price - discount savings = original_price - final_price result = savings return result
Sarah wanted to bake cookies. She had 12 chocolate chips, but accidentally dropped 3 on the floor. She went to the store and bought 5 more chocolate chips. How many chocolate chips does Sarah have now?
def solve() -> int: chocolate_chips = 12 dropped_chips = 3 store_chips = 5 total_chips = chocolate_chips - dropped_chips + store_chips result = total_chips return result
A recipe calls for 2/3 cups of flour. If you want to make 1/6 of the recipe, how many cups of flour should you use?
def solve() -> int: flour_needed = 2/3 flour_for_1_recipe = flour_needed*6 flour_needed_for_1_6_recipe = flour_for_1_recipe/6 result = flour_needed_for_1_6_recipe return result
Dina is baking cookies for her friends. She has a recipe that makes 24 cookies and uses 2 cups of flour, 1 cup of sugar, and 0.5 cup of butter. She wants to make 36 cookies and has 4 cups of flour, 2.5 cups of sugar, and 1.5 cups of butter. How much of each ingredient does she need to use?
def solve() -> int: ratio = 36 / 24 flour_needed = ratio * 2 sugar_needed = ratio * 1 butter_needed = ratio * 0.5 result = (flour_needed, sugar_needed, butter_needed) return result
Dan and Mike are working on a construction project. Dan can build 3 walls in 4 hours, while Mike can build 4 walls in 6 hours. If Dan takes a 1-hour break and Mike takes a 30-minute break, what is the difference in the number of walls they will have built after 8 hours?
def solve() -> int: time = 8 dan_rate = 3 / 4 mike_rate = 4 / 6 dan_walls = dan_rate * (time - 1) mike_walls = mike_rate * (time - 0.5) result = mike_walls - dan_walls return result
Adam is filling a bin with socks. In the first hour, he puts in 30 socks. During the next two hours, he puts in 10 socks each time. During the fourth hour, he puts in 25 socks. How many socks are in the bin after four hours?
def solve() -> int: first_hour_socks = 30 next_two_hours_socks = 10 * 2 fourth_hour_socks = 25 total_socks = first_hour_socks + next_two_hours_socks + fourth_hour_socks result = total_socks return result
A ishmael was given $50 for the birthday. He bought 2 t-shirts for $15 each and 4 DVDs for $7 each. How much money is left over?
def solve() -> int: tshirt_cost = 15 * 2 dvd_cost = 7 * 4 total_cost = tshirt_cost + dvd_cost change = 50 - total_cost result = change return result
In a race to the top of a mountain, Korah has climbed twice as much as Jack. If they have climbed a total of 130 m, how much as Jack climbed?
def solve() -> int: total = 130 korah = total / 3 jack = total - korah result = jack return result
John is solving math problems. He can solve 5 problems every 8 minutes. He spends 15 minutes reviewing the theory. He solves a total of 30 problems. Then he spends 55 minutes checking his answers. How many hours did he spend solving the problems?
def solve() -> int: problems_per_minute = 5/8 time_solving_problems = (30 / problems_per_minute) total_time = time_solving_problems + 15 + 55 time_solving_problems_hours = total_time / 60 result = time_solving_problems_hours return result
Peter has a fruit garden where he growsLucas wants to buy 50 apples for $0.25 each. However, on the day he goes to the store, the price has increased to $0.30. How many apples can Lucas buy now?
def solve() -> int: apples_wanted = 50 price_per_apple = 0.25 price_increase = 0.30 - 0.25 total_cost = apples_wanted * price_per_apple extra_cost = apples_wanted * price_increase total_cost_with_increase = total_cost + extra_cost apples_can_buy = total_cost_with_increase // 0.30 ...
David currently holds 870 blank pieces of paper, if he bought 10 boxes of 225 pieces of paper and sold 7 boxes, how many pieces of paper does David have in total?
def solve() -> int: Number_of_papers = 870 Total_boxes_bought = 10 Number_of_papers_per_box = 225 Total_box_sold = 7 Number_in_total = Number_of_papers + Total_boxes_bought*Number_of_papers_per_box - Total_box_sold*Number_of_papers_per_box result = Number_in_total return result
A basketball team made 80% of their free throws and 50% of their 3-pointers. If they attempted 20 free throws and 10 3-pointers, how many points did they score?
def solve() -> int: points_free_throws = 20*0.80*1 points_3_pointers = 10*0.50*3 total_points = points_free_throws + points_3_pointers result = total_points return result
Student: A local bakery bought 24 cupcakes for a client. The client then requested for 18 more cupcakes. If the bakery charged $2.50 for each cupcake, how much did the client pay for the total amount of cupcakes?
def solve() -> int: num_cupcakes_bought = 24 num_cupcakes_requested = 18 price_per_cupcake = 2.50 total_cupcakes = num_cupcakes_bought + num_cupcakes_requested total_cost = total_cupcakes * price_per_cupcake result = total_cost return result
If 6 beers and 8 sodas cost $17.00 and 2 beers and 10 sodas cost $11.50, how much does one soda cost?
def solve() -> int: soda_cost = ((17 * 10) - (11.5 * 8)) / ((6 * 10) - (2 * 8)) result = soda_cost return result
Student: Jeff lives in a small town where carrots cost $1.50 per pound. If Jeff wants to buys 3 pounds of carrots, how much money does he need to pay?
def solve() -> int: cost_per_pound = 1.5 pounds = 3 total_cost = cost_per_pound * pounds result = total_cost return result
Lucas is counting cookies in the jar. He knows that 25% of the cookies will be chocolate chip and the rest will be other flavors. On Monday he counts 20 cookies. On Tuesday he counts twice as many. How many chocolate chip cookies did he count over those two days?
def solve() -> int: monday_cookies = 20 tuesday_cookies = 2 * monday_cookies total_cookies = monday_cookies + tuesday_cookies chocolate_chip_cookies = total_cookies * 0.25 result = chocolate_chip_cookies return result
Sophie spent nine hours doing 1200 work tasks at $0.25 each. Then she spent nine hours doing 15 work tasks at $3.50 each. How much more did Sophie make doing the higher-paying work compared to the lower-paying work?
def solve() -> int: hours1 = 9 tasks1 = 1200 rate1 = 0.25 hours2 = 9 tasks2 = 15 rate2 = 3.50 total1 = hours1 * tasks1 * rate1 total2 = hours2 * tasks2 * rate2 difference = total2 - total1 result = difference return result
A recipe calls for 3 1/4 cups of flour to make 16 cookies. How many cups of flour are needed to make 32 cookies?
def solve() -> int: flour_for_16_cookies = 3.25 cookies_required = 32 flour_required = (flour_for_16_cookies / 16) * cookies_required result = flour_required return result
A student has scored 85, 90 and 92 on his first three tests. What is the average score?
def solve() -> int: score1 = 85 score2 = 90 score3 = 92 average = (score1 + score2 + score3) / 3 result = average return result
Student: A pizza contains 18 slices, each slice is cut from 1/8 of a whole pizza. How many pizzas does the restaurant need to make?
def solve() -> int: slices = 18 fraction = 1/8 pizzas = slices / fraction result = pizzas return result
Each tree in the orchard produces 200 peaches. 1/8th of the peaches are too small and not suitable for sale. 1/4th of the starting number are taken by the owner for personal use. Half the remainder are sold at the market. How many peaches are left in the orchard?
def solve() -> int: peaches_per_tree = 200 unsuitable_ratio = 1/8 owner_ratio = 1/4 market_ratio = 1/2 unsuitable_peaches = peaches_per_tree * unsuitable_ratio suitable_peaches = peaches_per_tree - unsuitable_peaches owner_peaches = suitable_peaches * owner_ratio remaining_peaches =...
A swimming pool 20 meters long, 8 meters wide, and 2 meters deep. If the pool is being filled with water at a rate of 10 liters per minute, how many minutes will it take to fill the pool?
def solve() -> int: length = 20 width = 8 depth = 2 volume = length * width * depth fill_rate = 10/1000 fill_time = volume / fill_rate result = fill_time return result
Two bikes are bought for $80 each. There is a 10% discount on both bikes. What is the total cost of both bikes?
def solve() -> int: cost1 = 80 cost2 = 80 discount1 = 0.1 discount2 = 0.1 totalcost = (cost1 * (1 - discount1)) + (cost2 * (1 - discount2)) result = totalcost return result
In a fundraising event for an orphanage, 50 donors pledged $100 each. If 10 of them only paid $50, how much did the orphanage collect in total?
def solve() -> int: donors = 50 pledge_amount = 100 partial_payment = 10 partial_payment_amount = 50 total_amount_collected = (donors - partial_payment) * pledge_amount + partial_payment * partial_payment_amount result = total_amount_collected return result
Student: If Maria drives 140 miles in 1 hour and 30 minutes, and the speed limit is 54 mph, how many mph above the speed limit was Maria driving?
def solve() -> int: time = 1.5 speed = 140 / time difference = speed - 54 result = difference return result
Diego and his friends love skiing and went to a ski resort for a weekend. They paid $50 for each ski pass and $25 for each ski rental. They also bought some snacks and drinks for $15 each. There were 8 people in the group, but 2 of them brought their own skis and did not rent. How much did they spend in total for the s...
def solve() -> int: pass_price = 50 rental_price = 25 snack_price = 15 people = 8 people_with_skis = 2 pass_cost = pass_price * people people_renting = people - people_with_skis rental_cost = rental_price * people_renting snack_cost = snack_price * people total = pass_cost +...
Student: A candy store has a sale where you can buy 4 bags of candy for $5. Another candy store sells the same bags of candy for $1.50 each. How many cents can you save per bag of candy by buying from the first store instead of the second?
def solve() -> int: bags = 4 price_first_store = 5 price_second_store = 1.50 total_price_first_store = bags * price_first_store total_price_second_store = bags * price_second_store savings = total_price_second_store - total_price_first_store savings_per_bag = savings / bags result = savi...
A certain type of seed can produce 10 flowers in one day. After each day, the amount produced doubles. After 5 days, how many flowers will have been produced?
def solve() -> int: flowers_day1 = 10 days = 5 flowers_day2 = flowers_day1 * 2 flowers_day3 = flowers_day2 * 2 flowers_day5 = flowers_day1 * (2 ** (days-1)) result = flowers_day5 return result
Student: A chicken farmer has 120 chickens. He sells 25 chickens at the farmers' market. How many chickens does he have left in the farm?
def solve() -> int: chickens = 120 sold = 25 remaining = chickens - sold result = remaining return result
A class of 25 students is going on a field trip to the museum. The museum charges $8 per student and $12 per adult for admission. The class also needs to pay $50 for the bus. The class has 2 teachers and 3 parent volunteers as chaperones. How much does the class need to pay in total for the field trip?
def solve() -> int: students = 25 adults = 2 + 3 bus_fee = 50 student_fee = 8 adult_fee = 12 admission_fee = students * student_fee + adults * adult_fee total_cost = admission_fee + bus_fee result = total_cost return result
A restaurant has 48 bottles of wine. They serve the wine in glasses that hold 1/6 of a bottle. How many glasses of wine can they serve?
def solve() -> int: num_bottles = 48 wine_per_glass = 1/6 num_glasses = num_bottles / wine_per_glass result = num_glasses return result
Samantha bought a flight ticket at a discounted price of 150 dollars, which was 25% off its original price. How much was the original price of the ticket?
def solve() -> int: discounted_price = 150 discount_percentage = 25 original_price = discounted_price / (1 - discount_percentage/100) result = original_price return result
In a soccer game, the first half ended with a score of 2-1 and the final score was 4-3. How many goals were scored in the second half?
def solve() -> int: first_half_score = 3 final_score = 7 second_half_score = final_score - first_half_score result = second_half_score return result
Brad bought 8 meters of fabric at $3.50 per meter. Write an expression to calculate the total cost of the fabric bought.
def solve() -> int: cost_per_meter = 3.50 num_meters = 8 total_cost = cost_per_meter * num_meters result = total_cost return result
A car travels 40 km/h for 3 hours, then 60 km/h for 2 hours. What is the average speed of the car for the entire trip?
def solve() -> int: total_distance = 40 * 3 + 60 * 2 total_time = 3 + 2 average_speed = total_distance / total_time result = average_speed return result
Mark saves $15 each week. If he saves for 6 months, how much money does he have saved up?
def solve() -> int: savings_weekly = 15 months = 6 weeks_in_month = 4 savings_total = savings_weekly * weeks_in_month * months result = savings_total return result
Student: Ken bought a hat, a scarf, and a shirt, the total cost for all three items was $35. The hat cost $15, how much did the other two items cost?
def solve() -> int: hat_cost = 15 total_cost = 35 other_two_cost = total_cost - hat_cost each_cost = other_two_cost / 2 result = each_cost return result
A bowling alley has 24 lanes. Each game costs $5 per person. If each game lasts an average of 30 minutes and at full capacity, the bowling alley can have 6 people on each lane during each game. On a Saturday night, the bowling alley was at full capacity for 4 straight hours. How much revenue did they generate?
def solve() -> int: num_of_lanes = 24 game_price = 5 game_duration = 0.5 max_people_per_lane = 6 total_time = 4 total_revenue = (num_of_lanes * max_people_per_lane * game_price * (total_time / game_duration)) result = total_revenue return result
Lily wants to bake 4 dozen cupcakes for her classmates. She needs 3 cups of flour, 2 cups of sugar, 4 eggs, and 1 cup of milk for every dozen cupcakes. The flour costs $3.00 per pound, the sugar costs $0.50 per cup, the eggs cost $0.25 each, and the milk costs $0.10 per ounce. How much will she spend on the ingredients...
def solve() -> int: dozens = 4 flour_per_dozen = 3 sugar_per_dozen = 2 eggs_per_dozen = 4 milk_per_dozen = 1 flour_price = 3.00 sugar_price = 0.50 egg_price = 0.25 milk_price = 0.10 ounces_per_cup = 8 cups_per_pound = 4 total_flour = dozens * flour_per_dozen ...
Mark has to finish his project. It takes him 6 hours to complete all the tasks. He can complete each task in 45 minutes. How many tasks are there in the project?
def solve() -> int: total_time = 6 * 60 task_time = 45 num_tasks = total_time // task_time result = num_tasks return result
Juanita has a rectangular garden that measures 8 meters by 10 meters. If she wants to put a fence around the perimeter of the garden, how many meters of fence does she need?
def solve() -> int: length = 8 width = 10 perimeter = 2 * (length + width) result = perimeter return result
There are 150 students in a class and 35% of them have taken a coding class. 60% of the students are willing to participate in a coding competition. If a student is randomly selected from the class, what is the probability that the student has taken a coding class and is willing to participate in a competition on weeke...
def solve() -> int: total_students = 150 coding_students = total_students * 0.35 willing_students = total_students * 0.6 coding_and_willing_students = coding_students * 0.6 probability = coding_and_willing_students / total_students result = probability return result
Sarah took a loan of $1000 from the bank. She paid back $250 per month for the first 4 months. She then paid back half of the remaining money. How much does she still owe 6 months from now?
def solve() -> int: loan_amount = 1000 monthly_payment = 250 remaining_amount = loan_amount - (monthly_payment * 4) remaining_amount = remaining_amount / 2 owed_amount = remaining_amount - (monthly_payment * 2) result = owed_amount return result
Paul is baking cookies and needs 2 1/2 cups of flour for the recipe. If he has only 5/8 cups of flour left, how much more does he need?
def solve() -> int: needed_flour = 2.5 - 0.625 result = needed_flour return result
A phone plan costs $50 per month, requires a $20 activation fee, and charges 5 cents per text message sent. If someone sends 200 text messages in a month, how much do they pay?
def solve() -> int: plan_cost_per_month = 50 activation_fee = 20 texts_sent = 200 cost_per_text = 0.05 total_cost = activation_fee + plan_cost_per_month + (texts_sent * cost_per_text) result = total_cost return result
A garden is 20 meters long and 8 meters wide. What is the area of the garden in square meters?
def solve() -> int: area_of_garden = 20 * 8 result = area_of_garden return result
Kate's rowing competition is 2 miles long. If Kate rowed the first mile in 7 minutes and the second mile in 8 minutes 30 seconds, what was her average speed in (m/s) for the entire competition?
def solve() -> int: distance_mile1 = 1 distance_mile2 = 1 time_mile1 = 7 * 60 time_mile2 = 8 * 60 + 30 total_distance = distance_mile1 + distance_mile2 total_time = time_mile1 + time_mile2 average_speed = total_distance / total_time result = average_speed return result...
A recipe calls for 2 eggs to make 12 cookies. How many eggs are needed to make 48 cookies?
def solve() -> int: eggs_for_12_cookies = 2 num_cookies = 48 eggs_for_one_cookie = eggs_for_12_cookies / 12 total_eggs = eggs_for_one_cookie * num_cookies result = f'{total_eggs} eggs are needed' result = total_eggs return result
Jonathan wants to buy a car that costs $25,000. If he gets a loan with a 4% interest rate over a 5 year period, how much will he pay in total?
def solve() -> int: original_price = 25000 interest_rate = 0.04 loan_time_period = 5 interest_payment = original_price * interest_rate * loan_time_period total_payment = original_price + interest_payment result = total_payment return result
Mira sold her old laptop for $400 and bought a new one for $800. She also paid $50 for a warranty and $30 for a delivery fee. How much money did Mira need to save up for the new laptop if she had $300 in her bank account before the transaction?
def solve() -> int: old_laptop = 400 new_laptop = 800 warranty = 50 delivery = 30 bank = 300 net_cost = new_laptop + warranty + delivery - old_laptop to_save = net_cost - bank result = to_save return result
There are 200 people at a meeting. 52% of them are men and 18% of them are children. How many people are neither men nor children?
def solve() -> int: num_men = 200 * 0.52 num_children = 200 * 0.18 result = 200 - num_men - num_children return result
ally drove for 3 hours at a speed of 70 km/h and then drove for 2 hours at a speed of 90 km/h. What was her average speed for the entire trip?
def solve() -> int: distance1 = 70 * 3 distance2 = 90 * 2 total_distance = distance1 + distance2 total_time = 3 + 2 average_speed = total_distance / total_time result = average_speed return result
The town of Pineville dedicates 28% of its budget for education. If they spend $3,500 on textbooks and also spend 22% on park renovations, what percentage of their budget is not used?
def solve() -> int: budget = 100 education_budget = budget * 0.28 textbook_spending = 3500 park_renovation_budget = budget * 0.22 remaining_budget = budget - (education_budget + textbook_spending + park_renovation_budget) percentage_not_used = (remaining_budget / budget) * 100 resu...
arah has $100 in her savings account and she deposited $25 each week for 5 weeks. How much money does she have in her savings account now?
def solve() -> int: start_balance = 100 weekly_deposits = 25 num_weeks = 5 final_balance = start_balance + (weekly_deposits * num_weeks) result = final_balance return result
Erin baked 12 muffins and 8 cookies for a party. She gave away 3 muffins and 4 cookies to her friends. At the party, she sold each muffin for $1.50 and each cookie for $1.00. How much money did she make?
def solve() -> int: muffins = 12 cookies = 8 muffins = muffins - 3 cookies = cookies - 4 money = muffins * 1.5 + cookies * 1 result = money return result
Student: A shipment of merchandise was sent by a company, with an invoice value of $6,000. The company pays sales tax of 5%. How much is the sales tax on the shipment?
def solve() -> int: invoice_value = 6000 sales_tax_rate = 0.05 sales_tax = invoice_value * sales_tax_rate result = sales_tax return result
John bought 5 apples for $10 and 3 bananas for $6. If he has $24 left in his pocket, how many dollars did he have at first?
def solve() -> int: apples_price = 10/5 bananas_price = 6/3 total_spent = 10+6 total_left = 24 total_starting_money = (total_spent+total_left)/(1-(apples_price+bananas_price)) result = total_starting_money return result
If Susan can climb a mountain in 6 hours, but it takes her friend Andrew twice as long to climb the same mountain, how many hours will Andrew take to reach the peak?
def solve() -> int: susan_time = 6 andrew_time = susan_time * 2 result = andrew_time return result
Student: Sarah received $1200 from her grandmother. She spent 1/5 of it on clothes, 1/3 of the remainder on books, and the rest went into savings. How much money did Sarah save?
def solve() -> int: amount_received = 1200 amount_spent_on_clothes = amount_received / 5 amount_remaining = amount_received - amount_spent_on_clothes amount_spent_on_books = amount_remaining / 3 amount_saved = amount_remaining - amount_spent_on_books result = amount_saved return result
A grocery store sells bags of apples and bags of oranges. If a bag of apples weighs 3 pounds and costs $4, and a bag of oranges weighs 5 pounds and costs $7, what is the total cost of buying 4 bags of apples and 3 bags of oranges?
def solve() -> int: num_bags_apples = 4 num_bags_oranges = 3 weight_apple_bag = 3 cost_apple_bag = 4 weight_orange_bag = 5 cost_orange_bag = 7 result =... return result
A cat shelter has 15 kittens and 9 cats. If each cat needs 2 cans of cat food per day and each can contains enough food for 3 animals, how many cans of cat food will they need for a week?
def solve() -> int: num_kittens = 15 num_adult_cats = 9 food_per_day = 2 food_per_can = 3 days_in_week = 7 total_food_needed = (num_kittens + num_adult_cats) * food_per_day * days_in_week total_cans_needed = total_food_needed / food_per_can result = total_cans_needed return result
Haley is making pizza for a game night. 1/10 of the pizzas have pepperoni, 50% have mushrooms, and the rest have both pepperoni and mushrooms. If Haley puts 20 slices of mushrooms in each mushroom pizza, and makes 80 pizzas, how many mushroom slices does she need?
def solve() -> int: pepperoni_pizzas = 80 * 1/10 mushroom_pizzas = 80 * 50/100 both_pizzas = 80 - pepperoni_pizzas - mushroom_pizzas mushroom_slices = mushroom_pizzas * 20 + both_pizzas * 20 result = mushroom_slices return result
A cake requires 2 1/2 cups of sugar. If Fred has 10 cups of sugar, how many cakes can he bake without buying more sugar?
def solve() -> int: needed_sugar = 2.5 total_sugar = 10 cakes_possible = total_sugar // needed_sugar result = cakes_possible return result
In a music class, 30 students finished rehearsing. 1/2 of the remaining students needed help from the instructor and the rest need more practice. How many students need more practice?
def solve() -> int: students_finished = 0 students_needed_help = 0 students_need_more_practice = 0 students_finished = 30 students_needed_help = (30 - students_finished)* 1/2 students_need_more_practice = 30 - students_finished - students_needed_help result = students_need_more_pra...
Possible new questions: Maria has 20 GB of storage on her laptop. She has already filled up 12 GB with photos and videos. If a video takes up about 200 MB of storage and a photo takes up about 10 MB of storage, how many more videos and photos can Maria store on her laptop? (Assume she wants to store an equal number of ...
def solve() -> int: storage_left = 20 - 12 storage_left = storage_left * 1000 video_photo = 200 + 10 result = storage_left // video_photo return result
A store has a sale on T-shirts with a discount of 20%. A T-shirt normally costs $20. How much is the T-shirt during the sale?
def solve() -> int: discount = 20 * 0.01 price = 20 - (20 * discount) result = price return result
Ben has 16 trading cards. He wants to give 4 cards to each of his friends. If he has 3 friends, how many trading cards will he have left?
def solve() -> int: cards = 16 friends = 3 cards_per_friend = 4 total_cards_given = friends * cards_per_friend cards_left = cards - total_cards_given result = cards_left return result
Joe has $325. He wants to buy a $68 shirt and equally divide the remaining money among his 4 friends. How much money will each friend receive?
def solve() -> int: money = 325 shirt = 68 remaining = money - shirt friends = 4 money_per_friend = remaining//friends result = money_per_friend return result
A gym membership costs $60 per month. If Alex wants to join the gym for 6 months, how much does he have to pay?
def solve() -> int: membership_cost_per_month = 60 membership_duration_in_months = 6 total_cost = membership_cost_per_month * membership_duration_in_months result = f'Alex has to pay {total_cost}' result = total_cost return result
Mrs. Perez bought a rental property for $500000. Eight years later, she sold it for a 25% profit and paid a 10% commission to the broker from the original price. How much did the rental property sell for?
def solve() -> int: original_price = 500000 profit_percent = 25 commission_percent = 10 profit = original_price * (profit_percent/100) selling_price = original_price + profit commission = original_price * (commission_percent/100) final_selling_price = selling_price - comm...
A rectangular garden has a length of 12 meters and a width of 8 meters. If a fence costs $5 per meter, how much would it cost to surround the garden with a fence?
def solve() -> int: length = 12 width = 8 perimeter = 2 * (length + width) cost_per_meter = 5 total_cost = perimeter * cost_per_meter result = total_cost return result
Student: Lisa invests $1000 When her investment earns 8% interest annually, how much money will she earn after 5 years?
def solve() -> int: investment = 1000 interest_rate = 0.08 years = 5 total_earned = investment * (1 + interest_rate) ** years interest_earned = total_earned - investment result = interest_earned return result
John’s electricity bill costs $75 per month. In the first month, he got a promotional rate of one-fifth the normal price. However, in the fourth month he forgot to turn off his AC unit and was charged an extra fee of $35. How much did John pay for his electricity bill in the first 7 months?
def solve() -> int: bill_per_month = 75 promotional_rate = 1/5 extra_fee = 35 first_month_bill = bill_per_month * promotional_rate fourth_month_bill = bill_per_month + extra_fee total_bill = first_month_bill + fourth_month_bill + (bill_per_month * 5) result = total_bill return ...
Henry wants to buy a used bike. He sees one that costs $140. The shop owner allows him to buy it with a down payment of $50 and pay the rest in installments. If he decides to pay in 4 payments, how much would each payment be?
def solve() -> int: total_cost = 140 down_payment = 50 num_payments = 4 balance = total_cost - down_payment payment_amount = balance // num_payments result = payment_amount return result
- Josh is a baker. He made 48 cupcakes for a party; 6 more cupcakes than the party ones that he sold at his shop; and 3 times as many cupcakes as the shop ones that he donated to a charity. How many cupcakes did Josh make in all?
def solve() -> int: party = 48 shop = party + 6 charity = shop * 3 total = party + shop + charity result = total return result
Example: Carlos earned $27 from mowing lawns in June, $32 in July, and $25 in August. He wanted to buy a skateboard that cost $80, but his dad said he would pay for half of it if Carlos saved at least $60. How much more money did Carlos need to save to buy the skateboard?
def solve() -> int: total_earned = 27 + 32 + 25 half_skateboard = 80 / 2 target = 60 remaining = target - total_earned - half_skateboard result = remaining return result
If a school has 900 students and 25% of them are boys, how many girls are enrolled?
def solve() -> int: students = 900 boys_percentage = 25 boys = (students * boys_percentage) / 100 girls = students - boys result = girls return result
Explanation if needed <|endofexplanation|> Emma wants to buy a new laptop that costs $800. She has a coupon that gives her 15% off. How much will she pay for the laptop after paying a 7% sales tax?
def solve() -> int: discount = 0.15 * 800 final_price_before_tax = 800 - discount tax = 0.07 * final_price_before_tax total_amount = final_price_before_tax + tax result = total_amount return result
Leo is saving money for a trip. He earns $15 per hour at his part-time job and spends $10 per day on average. If he started with $100 in his bank account and wants to save $500 for the trip, how many hours does he have to work and how many days will it take him?
def solve() -> int: earn = 15 spend = 10 start = 100 goal = 500 save_per_day = earn - spend days = (goal - start) // save_per_day hours = (goal - start) / save_per_day result = "Leo has to work " + str(hours) + " hours and it will take him " + str(days) + " days to save $500." ...
If a painting costs $4000 and is sold at $5000. What is the profit percentage?
def solve() -> int: cost_price = 4000 selling_price = 5000 profit = selling_price - cost_price profit_percentage = (profit / cost_price) * 100 result = profit_percentage return result
In a library, the number of fiction books is twice the number of non-fiction books. If there are 200 books in the library, how many non-fiction books are there?
def solve() -> int: x = int(66.67) result = x return result
A scalene triangle has perimeter of 22 inches. If the side lengths are consecutive odd integers, what are the lengths of the sides?
def solve() -> int: perimeter = 22 odd_number = (perimeter / 3) - 1 smaller_side = odd_number - 1 larger_side = odd_number + 1 result = (smaller_side, odd_number, larger_side) return result
If x = 5 and y = 10, what is the value of (2x + y) / 3?
def solve() -> int: value = (2*5 + 10) / 3 result = value return result
John built a warehouse that measures 50 by 30 feet. He divides the warehouse into 9 parts. All parts are the same size, except for the office which is twice as large as the other parts. What is the area of the office section?
def solve() -> int: width = 50 length = 30 total_parts = 9 office_size = 2 warehouse_area = width * length part_area = warehouse_area / total_parts non_office_area = part_area * (total_parts - 1) office_area = non_office_area * office_size result = office_are...
Mary bought a dress which was originally priced at $50, but it was on a 20% discount. How much did Mary end up paying for the dress?
def solve() -> int: original_price = 50 discount = 0.2 discount_amount = original_price * discount final_price = original_price - discount_amount result = final_price return result