question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Student: A pizza has a diameter of 14 inches and costs $12. If another pizza has a diameter of 20 inches, how much should it cost assuming the price is proportional to the area of the pizza?
def solve() -> int: radius_14 = 14 / 2 area_14 = 3.14 * (radius_14 ** 2) radius_20 = 20 / 2 area_20 = 3.14 * (radius_20 ** 2) price_20 = (area_20 / area_14) * 12 result = price_20 return result
A sports club has 250 members. The number of members who prefer to swim is twice the number of those who prefer to play tennis. The rest of the members prefer other sports. If 40 members prefer to play tennis, how many members prefer other sports?
def solve() -> int: total_members = 250 tennis_members = 40 swim_members = 2 * tennis_members tennis_or_swim_members = tennis_members + swim_members other_sports_members = total_members - tennis_or_swim_members result = other_sports_members return result
A store gives a discount of 10% on all items. If the original price of an item is $50, what will be the discounted price?
def solve() -> int: original_price = 50 discount = 10/100 discounted_price = original_price - (original_price * discount) result = discounted_price return result
Mark writes 4 articles every day. Two of them are 500 words long and 1 of them is 4 times as long. Assuming a 5-day week, how many words of writing does he produce per week?
def solve() -> int: articles_per_day = 4 article_length_1 = 500 article_length_2 = 500 article_length_3 = 4 * article_length_1 words_per_day = articles_per_day * (article_length_1 + article_length_2 + article_length_3) words_per_week = words_per_day * 5 result = word...
Emily is making burgers. It takes her 10 minutes to cook the patties and two-fifths of that time to grill the vegetables. It takes her 15 minutes to assemble the buns, the sauces, and the toppings, four times as long to fry the fries, and 1/20th the combined assembling and frying time to set the table. How many minutes...
def solve() -> int: patties_cooking_time = 10 vegetables_grilling_time = (2/5) * patties_cooking_time buns_assembling_time = 15 fries_frying_time = 4 * buns_assembling_time table_setting_time = (1/20) * (buns_assembling_time + fries_frying_time) total_time = patties_cooking_time + vegetable...
Joshua bought an item worth $87. After discount, he paid only $67. What is the discounted rate of the item?
def solve() -> int: original_price = 87 discounted_price = 67 discount_rate = (original_price - discounted_price)/original_price * 100 result = discount_rate return result
Ethan is a construction worker who needs to build a wall. It takes him twice as long to prepare the surface as it does to actually lay the bricks. Laying the bricks takes 2 days. The total time Ethan spends preparing the surface is equivalent to 1 full day of work. If Ethan works 8 hours per day, how many days does it ...
def solve() -> int: bricks_laying_time = 2 surface_preparation_time = bricks_laying_time * 2 total_preparation_time = 1 hours_per_day = 8 total_hours_worked = total_preparation_time * hours_per_day + bricks_laying_time * hours_per_day total_days_worked = total_hours_worked / 24 res...
Anna has a rectangular garden that measures 12 meters by 8 meters. She wants to plant sunflowers along the perimeter of the garden. Each sunflower needs 0.4 meters of space. How many sunflowers can she plant?
def solve() -> int: garden_length = 12 garden_width = 8 sunflower_space = 0.4 perimeter = 2 * (garden_length + garden_width) result = perimeter / sunflower_space return result
Tom ran the 800m event at a track meet. He finished the race in 2 minutes and 7 seconds. His average speed during the race was 6.2 m/s. How long is the 800m race in kilometers?
def solve() -> int: time = 2 * 60 + 7 distance = 800 speed = distance / (time) km_distance = distance / 1000 result = km_distance return result
Amy is trying to lose weight and wants to burn 1500 calories each day through exercise. If she runs for 30 minutes, how much longer does she need to exercise and at what intensity to achieve her goal of burning 1500 calories?
def solve() -> int: calories_burned_per_minute_running = 10 exercise_goal = 1500 time_spent_running = 30 calories_burned_running = time_spent_running * calories_burned_per_minute_running calories_left_to_burn = exercise_goal - calories_burned_running calories_burned_per_minute_other = 8 time...
A rectangular prism has a length of 10 cm, a width of 7 cm, and a height of 4 cm. What is the surface area of the rectangular prism?
def solve() -> int: prism_length = 10 prism_width = 7 prism_height = 4 prism_surface_area = 2*(prism_length*prism_width + prism_width*prism_height + prism_height*prism_length) result = prism_surface_area return result
A rectangle has a length of 10 cm and a width of 5 cm. What is the area of the rectangle?
def solve() -> int: rectangle_length = 10 rectangle_width = 5 rectangle_area = rectangle_length * rectangle_width result = rectangle_area return result
The price of a laptop was reduced by 15%. Now, the laptop sells for $850. What was the original price of the laptop?
def solve() -> int: original_price = 0 reduction_percentage = 15 selling_price = 850 reduction_amount = selling_price * (reduction_percentage / 100) original_price = selling_price + reduction_amount result = original_price return result
Student: At the zoo, there are five times as many monkeys as lions. If there are 6 lions, how many mammals are there?
def solve() -> int: lions = 6 monkeys = 5 * lions mammals = lions + monkeys result = mammals return result
Brynn has 8 tokens worth $3 each. She spends half of them and gains an additional 3 tokens. How much money did Brynn spend?
def solve() -> int: tokens = 8 price = 3 spent = (tokens/2)*price new_tokens = 3 result = spent + (new_tokens*price) return result
Lily had 12 candies. She ate 3 candies and shared the rest equally with her 3 friends. How many candies did each friend get?
def solve() -> int: candies = 12 candies = candies - 3 candies_per_friend = candies / 3 result = candies_per_friend return result
Emma filled a container with water that weighed 20 L. Every day, she uses one-third of the water. How much water will be left in the container on the fourth day?
def solve() -> int: container_weight = 20 water_used_per_day = container_weight / 3 water_left_after_four_days = container_weight - (water_used_per_day * 4) result = water_left_after_four_days return result
Mr. Brown has 50 birds where 3/10 are pigeons and the rest are parrots. Only three-fifths of those parrots can speak. How many birds does Mr. Brown have that cannot speak?
def solve() -> int: pigeons = 3/10 * 50 parrots = 50 - pigeons speaking_parrots = 3/5 * parrots non_speaking_parrots = parrots - speaking_parrots non_speaking_birds = pigeons + non_speaking_parrots result = non_speaking_birds return result
arah wants to buy a dress and a necklace. The dress's price is $90, and the necklace is twice as expensive as the dress. How much will Sarah spend in total?
def solve() -> int: dress_cost = 90 necklace_cost = 2 * dress_cost total_cost = dress_cost + necklace_cost result = total_cost return result
Student: John is 5 years older than Lila. In 3 years, John will be twice as old as Lila. How old is Lila currently?
def solve() -> int: john_age = 0 lila_age = 0 john_age += 3 lila_age += 3 john_age += 5 lila_age = john_age / 2 result = lila_age return result
Student: A company has a total of 1000 employees. If 40% of the employees are female, what is the total number of male employees in the company?
def solve() -> int: total_employees = 1000 percent_female = 0.4 total_female = total_employees * percent_female total_male = total_employees - total_female result = total_male return result
Jason walks to the park. During the first third of his walk, he walks at a speed of 2 miles per hour. During the second third of his walk, he walks at a speed of 3 miles per hour. During the last third of his walk, he walks at a speed of 4 miles per hour. If each third of his walk takes 20 minutes, what is the distance...
def solve() -> int: first_third_distance = 2/3 second_third_distance = 1 last_third_distance = 4/3 total_distance = first_third_distance + second_third_distance + last_third_distance result = total_distance return result
Student: A computer’s motherboard has 40 expansion slots. Each expansion slot is 0.8 cm in width. What is the total width of the motherboard?
def solve() -> int: expansion_slots = 40 width = 0.8 total_width = expansion_slots * width result = total_width return result
Result: 85 Tyler has 100 baseball cards. He gave 40 baseball cards to his friend. He then bought 50 more baseball cards. How many baseball cards does Tyler have now?
def solve() -> int: cards = 100 cards = cards - 40 cards = cards + 50 result = cards return result
Student: 1. Mary has 15 bags of popcorn. Each bag contains 10 kernels. How many kernels are in all of Mary's bags?
def solve() -> int: bags = 15 kernels_per_bag = 10 total_kernels = bags * kernels_per_bag result = total_kernels return result
A store sells laptops for a fixed price of $800. During a sale, they offer a discount of 15% on the purchase price. If a customer buys 2 laptops, how much do they pay?
def solve() -> int: price = 800 discount = price*0.15 total_price = price - discount customer_price = total_price*2 result = customer_price return result
If there are 30 cars to be distributed equally among six dealers, and Alex has twice as many cars as each dealer will end up with and Jack has eight fewer cars than Alex, then how many cars does each dealer have after the distribution?
def solve() -> int: num_cars = 30 num_dealers = 6 cars_per_dealer = num_cars // num_dealers alex_cars = cars_per_dealer * 2 jack_cars = alex_cars - 8 cars_per_dealer_after_distribution = cars_per_dealer result = cars_per_dealer_after_distribution return result
Bob can clean a house in 2 hours and mow the lawn in 30 minutes. How long will it take him to clean 2 houses and mow 3 lawns?
def solve() -> int: houses_cleaned = 2 lawns_mowed = 3 time_for_2_houses = 2 * 2 time_for_3_lawns = 3 * 0.5 total_time = time_for_2_houses + time_for_3_lawns result = total_time return result
Tony recently bought a car with a loan. The loan cost him $17,500 and he also had to pay 4% interest rate per month. How much money did he have to pay in total?
def solve() -> int: loan_money = 17500 interest_rate = 0.04 months = 12 total = loan_money*(1 + months*interest_rate) result = total return result
Student: Sara had 120 chocolate bars. She decided to give her 4 cousins 8 chocolate bars each. Then, she gave a quarter of the remaining chocolate bars to her best friend. If she only wants to eat 20 chocolate bars, how many chocolate bars are left to be shared with others?
def solve() -> int: chocolate_bars = 120 cousins = 4 cousin_share = 8 best_friend_share = 0.25 sara_eat = 20 chocolate_bars -= cousins * cousin_share best_friend_bars = chocolate_bars * best_friend_share chocolate_bars -= best_friend_bars chocolate_bars -= sara_eat resul...
A pizza has 8 slices. Sarah ate 2 slices and her brother ate 3 slices. How many slices are left?
def solve() -> int: slices = 8 slices -= 2 slices -= 3 result = slices return result
A music player costing $75 was discounted at 15% and an additional 10% discount applied during the holiday sale. How much did the music player cost after the holiday discount?
def solve() -> int: player_cost = 75 discount1 = 0.15 discount2 = 0.10 discounted_price1 = player_cost * (1 - discount1) discounted_price2 = discounted_price1 * (1 - discount2) result = discounted_price2 return result
Yesterday, Lily spent $42 on 7 board games. Today, she's going to spend twice as much on board games as she did yesterday. Tomorrow, she'll spend 4 times as much on board games than she did yesterday. How much will Lily spend on board games in total over these three days?
def solve() -> int: yesterday_spending = 42 today_spending = 2 * yesterday_spending tomorrow_spending = 4 * yesterday_spending total_spending = yesterday_spending + today_spending + tomorrow_spending result = total_spending return result
Five hours ago, Mike made a bowl of popcorn. Every hour he ate half of the remaining popcorn. After eating half of the remainder on the fifth hour, he now has 2 popcorns left. How many popcorns were in the bowl when Mike made it?
def solve() -> int: popcorn = 2 for i in range(5): popcorn *= 2 popcorn /= 2 popcorn *= 2 result = popcorn return result
A train travels a distance of 360 miles in 6 hours. If the train travels at a constant speed, what is the speed of the train in miles per hour?
def solve() -> int: speed_of_train = 360 / 6 result = speed_of_train return result
If Alex received 40 turtles at the animal rescue center, and Brooke received one third the amount of turtles Alex received, how many turtles did they receive together?
def solve() -> int: alex_turtles = 40 brooke_turtles = alex_turtles / 3 total_turtles = alex_turtles + brooke_turtles result = total_turtles return result
Alice had 100 coins. She dropped 1/4 of them on the way home, then gave 1/2 of what remained to her brother. How many coins did Alice give to her brother?
def solve() -> int: coins = 100 coins_dropped = coins * 1/4 coins_remaining = coins - coins_dropped coins_given = coins_remaining * 1/2 result = coins_given return result
Student: Ava is buying candles for her birthday party. She goes to a candle store where small candles cost $1, medium candles cost $2, and large candles cost $3. For every 6 candles that customers buy, the store gives a 10% discount on the total. Ava buys 5 small candles, 4 medium candles, and 3 large candles. How much...
def solve() -> int: small_candles = 5 medium_candles = 4 large_candles = 3 total_cost = small_candles * 1 + medium_candles * 2 + large_candles * 3 total_candles = small_candles + medium_candles + large_candles sets_of_6 = total_candles // 6 discount = sets_of_6 * 0.1 * total_cost result ...
Enterra Industries has been fined 1% of its monthly profits for illegal waste dumping. Every month Enterra Industries earns $7,500,000 from recycling and $2,000,000 from waste management. Its monthly expenses are $20,000,000. What is Enterra Industries' fine in dollars?
def solve() -> int: recycling_earnings = 7500000 waste_management_earnings = 2000000 expenses = 20000000 total_earnings = recycling_earnings + waste_management_earnings monthly_profit = total_earnings - expenses fine = monthly_profit * 0.01 result = fine return result
Tyler is preparing for a marathon. He needs an outfit ($80), shoes ($120), and energy supplies. The energy supplies will include 10 energy gels ($2 each) and 5 packs of electrolyte tablets ($5 each). How much will the marathon supplies cost?
def solve() -> int: outfit_cost = 80 shoes_cost = 120 energy_gels_cost = 10 * 2 electrolyte_tablets_cost = 5 * 5 total_cost = outfit_cost + shoes_cost + energy_gels_cost + electrolyte_tablets_cost result = total_cost return result
Mark and Sarah want to split the cost of a new TV evenly. If the TV cost $798, how much will each pay?
def solve() -> int: cost_tv = 798 num_payers = 2 cost_per_payer = cost_tv / num_payers result = cost_per_payer return result
I have a bag of 25 pencils and I shared them between 5 people. How many pencils does each person get?
def solve() -> int: TotalAmountOfPencils = 25 AmountOfPeople = 5 PencilsPerPerson = TotalAmountOfPencils / AmountOfPeople result = PencilsPerPerson return result
People are getting new laptops for the school year. The supplier has enough laptops for 20 people. However, every 5 laptops come in packs and the supplier cannot break the packs. How many packs of laptops will they need to buy?
def solve() -> int: people = 20 laptops_in_pack = 5 total_packs = people / laptops_in_pack result = round(total_packs) return result
Jimmy earned 25 more points than Alex in a game. If Alex scored 70 points, and they decide to combine and share the points equally, how many points do they each get?
def solve() -> int: alex_score = 70 jimmy_score = alex_score + 25 total_score = alex_score + jimmy_score each_score = total_score / 2 result = each_score return result
Julia made a reservation for a tour package with 20 tourists. She has to pay a deposit for the reservation, and the deposit is a flat $100 plus an extra $10 per adult but only $3 per child. Five of the tourists are children, and the rest are adults. How many dollars does Julia have to pay as a deposit for the tour pack...
def solve() -> int: adults = 20 - 5 adult_deposit = adults * 10 child_deposit = 5 * 3 total_deposit = 100 + adult_deposit + child_deposit result = total_deposit return result
Ben harvested 25 potatoes from his garden. From the potatoes he harvested, for each that Ben cooked, he gave five to his neighbors from the remaining ones. How many potatoes did Ben cook?
def solve() -> int: potatoes_harvested = 25 potatoes_cooked = potatoes_harvested - (potatoes_harvested // 6) result = potatoes_cooked return result
4. Steve has 27 books in total. This week he read 8 of them. Next week, he will read 1/3 of the remaining books. How many books will be left after next week?
def solve() -> int: books = 27 books -= 8 books_third = books * (1/3) books -= books_third result = books return result
Ethan and Maya go to the bank. Ethan has $3250 and Maya has $2800. If they plan to buy gold bars that cost $1250 each, how many can they afford to buy with their combined savings?
def solve() -> int: total_savings = 3250+2800 cost_of_each_gold_bar = 1250 max_gold_bars = total_savings//cost_of_each_gold_bar result = max_gold_bars return result
Ryan has an office renovation project he needs to complete. He needs to buy 5 new desks that each cost $125.00 and the store is offering 30% off. How much money will Ryan need to spend in order to buy the desks?
def solve() -> int: price_per_desk = 125.00 num_desks = 5 discount_percentage = 0.30 total_cost_before_discount = price_per_desk * num_desks discount_amount = total_cost_before_discount * discount_percentage total_cost = total_cost_before_discount - discount_amount result = total_c...
Lisa is trying to prevent her dog from digging in the backyard. The first fence she tries stalls it for 4 minutes. The next fence stalls it for 5 minutes more than three times as long as the first fence. When Lisa tries both fences at once, it stalls her dog for eight times the duration of the second fence alone. How l...
def solve() -> int: fence1 = 4 fence2 = 3*fence1 + 5 both_fences = 8*fence2 result = both_fences return result
Student: If Tom runs 3 laps around the park every day. How many days will it take him to complete 100 laps?
def solve() -> int: laps_per_day = 3 target_laps = 100 days = target_laps / laps_per_day result = days return result
A train travels 60 miles per hour for 3 hours. If the train stops for 15 minutes in the middle, how long does the entire trip take in minutes?
def solve() -> int: speed = 60 hours = 3 distance_traveled = speed * hours total_time_in_hours = hours + (15/60) total_time_in_minutes = total_time_in_hours * 60 result = total_time_in_minutes return result
Seven bees gathered pollen by making 15 round trips. If the flowers were located 1 kilometer from their hive, what is the total distance the bees traveled?
def solve() -> int: num_bees = 7 num_round_trips = 15 distance_per_trip = 1 * 2 total_distance = num_bees * num_round_trips * distance_per_trip result = total_distance return result
Bill can solve a math problem in 12 seconds, how long does it take him to solve 5 problems?
def solve() -> int: time_1 = 12 problems = 5 result = time_1 * problems return result
At the park, there are 25 ducks and 12 geese. If 8 ducks and 5 geese fly away, how many birds are left at the park?
def solve() -> int: ducks = 25 geese = 12 ducks_fly_away = 8 geese_fly_away = 5 ducks_left = ducks - ducks_fly_away geese_left = geese - geese_fly_away birds_left = ducks_left + geese_left result = birds_left return result
Ella has a bottle of juice that contains 1.5 liters. She drinks 250 milliliters every day. How many days will the bottle last and how much juice will be left on the last day?
def solve() -> int: juice_volume = 1.5 * 1000 days = juice_volume // 250 juice_left = juice_volume % 250 result = (days, juice_left) return result
Tyler has 5 more baseball cards than his brother Ben, while Ben has 4 more than his sister Casey. If Casey has 7 baseball cards, how many baseball cards do they have in total?
def solve() -> int: casey_cards = 7 ben_cards = casey_cards + 4 tyler_cards = ben_cards + 5 total_cards = casey_cards + ben_cards + tyler_cards result = total_cards return result
Emma rode on her bicycle all day. She cycled 10 miles to the beach. Then she cycled 3 miles less than twice as far to the ice cream parlor, and finally cycled 4 miles less than her first ride back home. How many miles did Emma cycle in total?
def solve() -> int: beach_distance = 10 ice_cream_distance = (2 * beach_distance) - 3 home_distance = beach_distance - 4 total_distance = beach_distance + ice_cream_distance + home_distance result = total_distance return result
Possible questions and programs: Maria loves to collect stamps. She has 75 stamps from different countries. She gave away 10 stamps to her friend and bought 20 new stamps at a fair. How many stamps does she have now?
def solve() -> int: stamps_after_giving = 75 - 10 stamps_after_buying = stamps_after_giving + 20 result = stamps_after_buying return result
Tom wants to switch to a low-flow showerhead to reduce water usage. If switching to a low-flow showerhead releases 5 pounds of carbon dioxide, and each shower releases 4 pounds of carbon dioxide, how many showers would Tom have to take for the carbon dioxide emissions savings to exceed the emissions of switching to a l...
def solve() -> int: low_flow_savings = 5 shower_emissions = 4 num_showers = low_flow_savings / shower_emissions num_showers = int(num_showers) + 1 result = num_showers return result
Ethan is planning a party and wants to make sure he has enough food for everyone. He plans to make tacos, sandwiches, and pizza. He wants to keep half of the pizza slices for himself, throw away any sandwiches with wilted lettuce, and save the tacos for his vegetarian friends. If he has 36 food items, how many tacos do...
def solve() -> int: total_food_items = 36 tacos = total_food_items // 2 result = tacos return result
If a soccer team scored 4 goals in the first half and 2 goals in the second half, how many goals did the team score in total?
def solve() -> int: first_half_goals = 4 second_half_goals = 2 total_goals = first_half_goals + second_half_goals result = total_goals return result
There are 20 children in a class. If each child brings 2 cookies, how many cookies are there in total?
def solve() -> int: num_children = 20 cookies_per_child = 2 total_cookies = num_children * cookies_per_child result = total_cookies return result
Sophie wants to buy a new laptop but needs to save up first. She has $350 saved up and gets paid $12 per hour for her work. In addition, she has earned $70 in tips. How many hours has Sophie worked in total?
def solve() -> int: savings = 350 hourly_pay = 12 tips = 70 total_money = savings + tips money_from_work = total_money - savings hours_worked = money_from_work / hourly_pay result = hours_worked return result
A farmer has 30 cows in his herd. If he sells 10% of his cows, how many cows will he have remaining? Hint: 10% can be written as 0.1, and to find how many cows are being sold you can multiply 30 (the total number of cows) by 0.1.
def solve() -> int: cowSold = 30 * 0.1 cowRemaining = 30 - cowSold result = cowRemaining return result
Student: A rectangular garden has a length of 10 meters and a width of 8 meters. If 1 square meter of garden needs 10 grams of fertilizer, how many grams of fertilizer are needed for the entire garden?
def solve() -> int: length = 10 width = 8 area = length * width fertilizer_per_square_meter = 10 total_fertilizer = area * fertilizer_per_square_meter result = total_fertilizer return result
A grocery store sells apples by the pound. If a customer purchases 3.5 pounds of apples for $7, what is the cost per pound of apples?
def solve() -> int: pounds_of_apples = 3.5 total_cost = 7 cost_per_pound = total_cost / pounds_of_apples result = cost_per_pound return result
A mobile phone company charges $15 per month for a basic plan plus $0.25 per minute of talk. If a customer spends 95 minutes talking this month, how much will their bill be?
def solve() -> int: basic_plan = 15 cost_per_minute = 0.25 minutes_talked = 95 total_cost = basic_plan + cost_per_minute * minutes_talked result = total_cost return result
Brendan bought 5 coffee makers at the store for $35 each and 3 toasters for $20 each. How much did he spend in total?
def solve() -> int: num_coffee_makers = 5 cost_coffee_makers = 35 num_toasters = 3 cost_toasters = 20 cost_total_coffee_makers = num_coffee_makers * cost_coffee_makers cost_total_toasters = num_toasters * cost_toasters total_cost = cost_total_coffee_makers + cost_total_toasters ...
Alvin can solve 15 math problems in 30 minutes. Bella can solve the same problems in 45 minutes. How long will it take for both of them to solve the problems if they work together?
def solve() -> int: problems = 15 portionOfTheProblemsAlvinCanSolveInOneHour = problems * 2 portionOfTheProblemsBellaCanSolveInOneHour = problems * 4 / 3 hoursTakenByBothToSolveTheProblems = problems / (portionOfTheProblemsAlvinCanSolveInOneHour + portionOfTheProblemsBellaCanSolveInOneHour) result =...
Mia is painting 48 tiles for a mural. She has already painted 16 tiles with blue, 8 tiles with yellow, and 4 tiles with green. She wants to paint the remaining tiles with red. How many tiles does she need to paint with red?
def solve() -> int: blue_painted = 16 yellow_painted = 8 green_painted = 4 total_painted = blue_painted + yellow_painted + green_painted total_left = 48 - total_painted red_painted = total_left result = red_painted return result
Madison needs to spread mulch around her garden: it's 36 feet long and 24 feet wide, and each bag of mulch covers 5 square feet. How many bags does Madison need?
def solve() -> int: length = 36 width = 24 mulch_area = 5 total_area = length * width num_bags = total_area / mulch_area result = num_bags return result
Maya is collecting stamps from different countries. She knows that 15% of her stamps are from Canada, 10% are from France, and 20% are from Japan. The rest are from other countries. She has 200 stamps in total. How many more stamps from France does she need to have the same number as Japan?
def solve() -> int: total_stamps = 200 canada_stamps = total_stamps * 0.15 france_stamps = total_stamps * 0.1 japan_stamps = total_stamps * 0.2 other_stamps = total_stamps - canada_stamps - france_stamps - japan_stamps difference = japan_stamps - france_stamps result = differen...
Tom and Jerry go to the grocery store. Tom buys 8 apples and 4 carrots, each costing $0.50. Jerry buys 10 oranges and 3 bananas, each costing $0.75. How much money do they spend together?
def solve() -> int: numApplesTom = 8 priceApplesTom = 0.5 numCarrotsTom = 4 priceCarrotsTom = 0.5 numOrangesJerry = 10 priceOrangesJerry = 0.75 numBananasJerry = 3 priceBananasJerry = 0.75 totalCost = numApplesTom * priceApplesTom + numCarrotsTom * priceCarrotsTom...
A bookstore has 200 books. If they sell 1/10 of the books at half price, how much money do they earn?
def solve() -> int: books = 200 sold_books = books * (1/10) discount_price = 0.5 original_price = 10 amount_earned = sold_books * original_price * discount_price result = amount_earned return result
Emily swims for 1 hour. She uses $0.25 for every 3 minutes. How much money did she spend, in dollars?
def solve() -> int: minutes_swam = 60 cost_per_minute = 0.25 / 3 total_cost = minutes_swam * cost_per_minute result = total_cost return result
Nick walks 70 steps to the gym and 30 steps to the pharmacy both located along the same road. He walks back and forth between these locations and home every day. How many steps does he take in total over the course of three days?
def solve() -> int: steps_to_gym = 70 steps_to_pharmacy = 30 total_steps = steps_to_gym + steps_to_pharmacy steps_to_and_fro = total_steps * 2 total_steps_in_three_days = steps_to_and_fro * 3 result = total_steps_in_three_days return result
A pizza parlor sells pizzas for $12 each and also charges $1 per topping. If you order a pizza with 4 toppings, what is the total cost?
def solve() -> int: pizza_price = 12 topping_cost = 1 num_toppings = 4 total_cost = pizza_price + num_toppings*topping_cost result = total_cost return result
In a class of 30 students, 12 take Spanish, 18 take French, and 6 students take both. How many students take neither Spanish nor French?
def solve() -> int: total_students = 30 spanish_students = 12 french_students = 18 students_both = 6 students_neither = total_students - spanish_students - french_students + students_both result = students_neither return result
A clothing store sells 1000 shirts per day. Each shirt is priced at $30. If they sold 3 days' worth of production, how much money will the store earn?
def solve() -> int: shirts_per_day = 1000 price_per_shirt = 30 days_sold = 3 total_shirts_sold = shirts_per_day * days_sold total_earnings = total_shirts_sold * price_per_shirt result = total_earnings return result
Student: Joe and Jan went banana picking. Joe picked 8 bunches of bananas and Jan picked twice as much as Joe. How many bunches of bananas did Jan pick?
def solve() -> int: joe_bunches = 8 jan_bunches = joe_bunches * 2 result = jan_bunches return result
Adam can make 8 cupcakes in 20 minutes. Charlotte can make as fast as Adam but at half the rate of Bella. How many minutes does it take Bella to make 24 cupcakes?
def solve() -> int: time = 24 / ((1/2) * 8/20) * 60 result = time return result
Laura is a nurse. Every day she spends 20 minutes preparing medications, 5 minutes per patient taking vitals, and 10 minutes per patient administering medications. If there are 8 patients in her ward, how long does Laura's daily routine take?
def solve() -> int: med_prep_time = 20 vitals_time = 5 med_admin_time = 10 num_patients = 8 routine_time = med_prep_time + (vitals_time * num_patients) + (med_admin_time * num_patients) result = routine_time return result
A triangle has a base that is 6 cm longer than twice its height. If the area of the triangle is 24 cm^2, what is the base length of the triangle?
def solve() -> int: base = 0 height = 0 for i in range(1, 8): for j in range(1, 8): if j == 6 + i * 2 and i*j/2 == 24: base = j height = i result = base return result
A gym has some machines and a number of personal trainers equal to three times the number of machines minus two. If the total number of staff is 53, counting the owner's office, how many machines does the gym have?
def solve() -> int: machines = (53 - 1) / (3 * 1 - 2) result = machines return result
A phone has 12 buttons. Olivia has 3 boxes, each with 2 compartments that can hold 24 phones each. If the compartments are filled up to 40%, how many buttons are there on all the phones?
def solve() -> int: total_buttons = 12 boxes = 3 compartments = 2 phones_per_compartment = 24 fill_percentage = 0.4 total_phones = boxes * compartments * phones_per_compartment buttons_on_all_phones = total_phones * total_buttons result = buttons_on_all_phones ret...
If a recipe calls for 4 times as much sugar as flour, and the total amount of flour and sugar used is 180 grams, how many grams of flour were used?
def solve() -> int: flour = 180 / (4 + 1) result = flour return result
Student: A circle has an area of 16*pi square units. What is its radius?
def solve() -> int: area = 16 * 3.14 radius = (area / 3.14) ** 0.5 result = radius return result
A group of friends want to split the bill at a restaurant. The total bill is $125, and they want to tip 15%. If there are 5 people in the group, how much does each person need to pay in total?
def solve() -> int: total_bill = 125 tip_percentage = 0.15 num_of_people = 5 total_bill_with_tip = total_bill * (1 + tip_percentage) amount_per_person = total_bill_with_tip / num_of_people result = amount_per_person return result
Sophia was on a walking tour and walked for 3 hours at a pace of 1.5 miles per hour. She then saw an interesting shop and walked back to it at the same pace. How many miles did Sophia walk in total?
def solve() -> int: hours = 3 pace = 1.5 distance = hours * pace total_distance = distance * 2 result = total_distance return result
A pizza has 8 slices. John ordered 2 pizzas and wants to eat 3 slices. Mary wants to eat 2 slices from one pizza and 1 slice from the other. If there are 4 people in total, each wanting to eat an equal number of slices, then how many slices will each person receive?
def solve() -> int: pizzas_ordered = 2 total_slices = pizzas_ordered*8 john_slices = 3 mary_slices = 2+1 remaining_slices = total_slices - john_slices - mary_slices people = 4 slices_per_person = remaining_slices / people result = slices_per_person return result
A crate contains 24 oranges, 18 apples, and 12 bananas. What is the percentage of apples in the crate?
def solve() -> int: total_fruits = 24 + 18 + 12 apple_fruits = 18 apple_percentage = round((apple_fruits/total_fruits)*100) result = f'Apples: {apple_percentage}%' result = apple_percentage return result
Paul can complete his work in 5 hours. If he does 1/3 of the work, how much time will it take him to complete the rest?
def solve() -> int: total_work = 1 fraction_done = 1/3 fraction_remaining = 1 - fraction_done paul_hours_per_work = 5 hours_remaining = fraction_remaining * paul_hours_per_work result = hours_remaining return result
rena is baking cupcakes for a fundraiser. She has 4 bags of flour, 3 bags of sugar, and 2 bags of cocoa powder. She uses 2 cups of flour, 1 cup of sugar, and 1/2 cup of cocoa powder for each batch of cupcakes. If she can make a maximum of 24 batches of cupcakes, how many bags of each ingredient will she have left over?
def solve() -> int: flour_used = 2 * 24 sugar_used = 1 * 24 cocoa_used = 0.5 * 24 flour_leftover = 4 * 16 - flour_used sugar_leftover = 3 * 16 - sugar_used cocoa_leftover = 2 * 16 - cocoa_used result = (flour_leftover, sugar_leftover, cocoa_leftover) return result
On a class test, a student received 70 points out of 80. What is the student's score as a percentage?
def solve() -> int: points_received = 70 total_points = 80 percent_score = (points_received / total_points) * 100 result = percent_score return result
Bob owes $18,000 on a 5-year loan at 4.75% interest rate compounded annually. calculate the total amount he paid, rounding to the nearest cent.
def solve() -> int: loan_amount = 18000 interest_rate = 4.75/100 years = 5 total_amount = loan_amount*(1+interest_rate/12)**(12*years) result = round(total_amount,2) return result
A box contains 100 marbles. 40% are blue, 25% are red, and the rest are green. How many green marbles are in the box?
def solve() -> int: total_marbles = 100 blue_percent = 40 red_percent = 25 green_percent = 100 - blue_percent - red_percent green_marbles = (green_percent / 100) * total_marbles result = green_marbles return result
Mark has a rectangular garden that is 8 feet by 10 feet. He wants to increase the size of the garden by 1/4 on each side. What is the area of the new garden?
def solve() -> int: width = 8 length = 10 width *= 1.25 length *= 1.25 area = width * length result = area return result
A pizza costs $20. If you and 3 friends split the cost equally, how much will each person pay?
def solve() -> int: cost_of_pizza = 20 number_of_people = 4 cost_per_person = cost_of_pizza / number_of_people result = cost_per_person return result
In a carnival, for every 10 cotton candies, there are 100 popcorns. If 25% of popcorns have burnt kernels, and there are 50 popcorns with burnt kernels in the carnival, how many cotton candies are there?
def solve() -> int: cotton_candies = 10 popcorns = 100 burnt_popcorns = 50 burnt_popcorns_percentage = (burnt_popcorns / popcorns) * 100 cotton_candies = (burnt_popcorns_percentage / 25) * cotton_candies result = cotton_candies return result