question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Student: A bakery uses 1.25 cups of sugar for every 2 dozen cupcakes. If they want to make 5 dozen cupcakes, how much sugar will they need?
def solve() -> int: num_cupcakes = 5 sugar_per_dozen = 1.25 sugar_needed = num_cupcakes * sugar_per_dozen result = sugar_needed return result
A rectangular box has a length of 5 cm, a width of 10 cm, and a height of 8 cm. What is its volume?
def solve() -> int: volume = 5*10*8 result = volume return result
If you purchase more than eight laptops, the price per unit will be lowered by 10%. If you pay $3200 for ten laptops, what was the original price of each laptop?
def solve() -> int: laptops_purchased = 10 total_price = 3200 if laptops_purchased > 8: discount = 0.10 original_price = total_price / laptops_purchased / (1 - discount) else: original_price = total_price / laptops_purchased result = original_price return result...
Noah has been saving up to buy a new phone worth $600. He gets a monthly allowance of $20 and earns $30 per hour working part-time. After buying the phone, he had $50 left. How many hours did he work?
def solve() -> int: monthly_allowance = 20 phone_cost = 600 remaining_money = 50 total_savings = remaining_money + phone_cost total_allowance = monthly_allowance * 12 total_savings -= total_allowance hourly_earning = 30 hours_worked = total_savings / hourly_earning ...
Rita makes bracelets. Every hour, she can make 5 bracelets. Every 3 hours, she sells 7 bracelets to a customer. Every 6 hours, she gives 3 bracelets to her sister. She started with 2 bracelets and gave one to her mom. After 18 hours, how many bracelets does she have?
def solve() -> int: makes = 0 sells = 0 gives = 0 bracelets = 2 mom = 1 for hour in range(1, 19): makes += 5 if hour % 3 == 0: sells += 7 if hour % 6 == 0: gives += 3 bracelets = bracelets + makes - sells - gives - mom result = bracelets ...
Mike can run a mile in 6 minutes. How long will it take him to run 3 miles?
def solve() -> int: time_per_mile = 6 distance = 3 total_time = time_per_mile * distance result = total_time return result
John can complete a job in 3 hours while his friend Mark can complete it in 5 hours. If they work together, how long will it take to complete the job?
def solve() -> int: hours_for_john = 3 hours_for_mark = 5 johns_rate = 1/hours_for_john marks_rate = 1/hours_for_mark combined_rate = johns_rate + marks_rate time_to_complete_job = 1/combined_rate result = time_to_complete_job return result
A technology store bought 500 fewer than four times as many laptops as it did tablets at $400 per laptop. If the cost of a tablet was $250, and the store ordered 25 boxes, each having 30 tablets, calculate how much they spent on technology.
def solve() -> int: tablets = 25 * 30 laptops = 4 * tablets - 500 tablet_cost = tablets * 250 laptop_cost = laptops * 400 total_cost = tablet_cost + laptop_cost result = total_cost return result
A box contains 60 red marbles, 40 blue marbles, and 30 green marbles. What is the probability of picking a green marble randomly from the box?
def solve() -> int: total_marbles = 130 green_marbles = 30 probability = green_marbles / total_marbles result = probability return result
Jackson's dad is selling his car for $15,000 and using the money to buy a boat that costs $25,000. How much more money does he need to buy the boat?
def solve() -> int: car_price = 15000 boat_price = 25000 money_needed = boat_price - car_price result = money_needed return result
Kim, Lee, and Min collect buttons. Kim had 48 buttons in her collection, Lee had 36 buttons in her collection, and Min had 24 buttons in her collection. Lee gave Kim one fourth of her collection as a thank you gift, and then Kim gave Min six buttons for a bracelet. How many buttons did Lee have in the end?
def solve() -> int: kim = 48 lee = 36 min = 24 lee_gives = lee // 4 lee = lee - lee_gives kim = kim + lee_gives kim_gives = 6 kim = kim - kim_gives min = min + kim_gives result = lee return result
Ethan is a landscaper. He can mow 6 lawns at once. He gets paid $25 for a 45-minute mowing and $35 for a 75-minute mowing. Ethan works for 6 hours per day. If he always mows the maximum number of lawns possible and 10 lawns have 75-minute mowings per day, how much money does he make in a week where he works 5 days?
def solve() -> int: lawns_at_once = 6 payment_45_min = 25 payment_75_min = 35 hours_per_day = 6 lawns_75_min = 10 days_per_week = 5 total_lawns = lawns_at_once * hours_per_day * days_per_week total_payment_45_min = (total_lawns - lawns_75_min) * payment_45_min total_payment_75_m...
A train moves at a constant speed of 90 kilometers per hour. How far does the train travel in 12 minutes?
def solve() -> int: speed = 90 time = 12 / 60 distance = speed * time result = distance return result
An aquarium is 1 meter (m) long, 0.5 m wide, and 0.25 m deep. What is its volume in liters (L)?
def solve() -> int: length = 1 width = 0.5 depth = 0.25 volume_m3 = length * width * depth volume_L = volume_m3 * 1000 result = volume_L return result
Kurt owns a retail store. He has 600 pieces of clothing. 240 pieces are shirts, 180 pieces are pants, and 180 pieces are dresses. What is the percentage of shirts in Kurt's store's inventory?
def solve() -> int: total_inventory = 600 shirts = 240 shirt_percentage = (shirts/total_inventory)*100 result = shirt_percentage return result
Madison cooked a stew that serves four people. She added half a cup of red wine to the mix. Red wine has 125 calories per 5 oz. How many calories were added to each serving of the stew?
def solve() -> int: serving_size = 4 wine_added = 0.5 calories_per_5oz = 125 wine_added_oz = wine_added * 8 total_calories_added = (wine_added_oz / 5) * calories_per_5oz calories_per_serving = total_calories_added / serving_size result = calories_per_serving ret...
Noah has 2000 dollars, and he decides to split them among his four children: Grace, Joe, Eric, and Lucas. He gives 2/5 of the money to Grace, and then divides the remaining money in the ratio of 3:2:1 with Joe, Eric, and Lucas, respectively. If Lucas receives 80 dollars, how much money did Eric get?
def solve() -> int: money = 2000 grace_share = (2/5) * money remaining_money = money - grace_share total_ratio = 3 + 2 + 1 eric_share = (2/total_ratio) * remaining_money result = eric_share return result
Alan harvested 412 strawberries from his garden and used 3/5 of them. How many strawberries did Alan have left?
def solve() -> int: initial_amount = 412 used_amount = 0.6 * initial_amount result = initial_amount - used_amount return result
At 36, Michael is 4 years younger than Ashley. What would be their average age in 9 years?
def solve() -> int: michael_age = 36 ashley_age = (michael_age+4) average_age = ((michael_age+9) + (ashley_age+9))/2 result = average_age return result
Possible new questions and programs: Angela and Ben are collecting bottle caps for a recycling project. They get 5 cents for each bottle cap they bring. Angela collected 120 bottle caps in one week. Ben collected 25% more bottle caps than Angela in the same week. How much more money did Ben earn for the project than An...
def solve() -> int: angela_caps = 120 ben_caps = angela_caps * 1.25 cap_value = 0.05 angela_money = angela_caps * cap_value ben_money = ben_caps * cap_value difference = ben_money - angela_money result = difference return result
David has some money. He spent $12 buying a book. He then spent one-third of the money he had left on a magazine. If the magazine cost $4, what is the amount of money, in dollars, David had at first?
def solve() -> int: money = 0 book_cost = 12 magazine_cost = 4 money -= book_cost money_spent_on_magazine = money / 3 money -= money_spent_on_magazine if money_spent_on_magazine == 4: result = money * 3 else: result = "Cannot determine the amount of money David ...
Ethan purchases 8 gourmet cupcakes for $4.50 each from a local confectionery. In addition, he buys a chocolate cake for $25.00 and a dozen cookies that cost half as much as one cupcake. How much did Ethan spend at the confectionery?
def solve() -> int: cupcakes = 8 cupcake_cost = 4.50 cake_cost = 25.00 cookies = 12 cookie_cost = cupcake_cost / 2 total_cupcake_cost = cupcakes * cupcake_cost total_cookie_cost = cookies * cookie_cost total_cost = total_cupcake_cost + cake_cost + total...
Ashley wants to buy 8 items from the store. Each item costs $15, but she has a coupon that allows her to get 10% off of her total purchase. How much money will Ashley save in total using the coupon?
def solve() -> int: number_of_items = 8 price_per_item = 15 discount_percentage = 10 total_price_without_discount = number_of_items * price_per_item discount = ((discount_percentage / 100) * total_price_without_discount) total_price_with_discount = total_price_without_discount -...
A pizza is cut into 8 equal slices. Kevin ate 2 slices and gave 1 slice to his friend. He then cut the remaining slices into halves and ate 3 more halves. What fraction of the pizza did he eat in total?
def solve() -> int: fraction_initial = 2 / 8 fraction_friend = 1 / 8 fraction_halves = 1 - fraction_initial - fraction_friend fraction_halves_eaten = 3 / (2 * fraction_halves) fraction_total = fraction_initial + fraction_halves_eaten result = fraction_total return result
A football team has sixteen players. If four players are injured, the remaining players will be two-fifths of the number of players before they were injured. How many players were originally in the team?
def solve() -> int: players_before_injury = 16 players_after_injury = players_before_injury - 4 remaining_players_ratio = 2/5 remaining_players = remaining_players_ratio * players_before_injury players_before_injury = remaining_players / remaining_players_ratio result = players_before_...
A bag of candy has 30 pieces. If John has 3 bags of candy and he eats 2 pieces everyday, how many days will it take him to finish all the candy?
def solve() -> int: total_candy = 30 * 3 candy_eaten_per_day = 2 days_to_finish = total_candy / candy_eaten_per_day result = round(days_to_finish) return result
Mike and Rachel were running a race. Mike finished the race in 25 minutes while Rachel finished the race 10% faster than Mike. When they went home, they ran for another 5 minutes and rested for 2 minutes. If they need to run for at least 1 hour for their daily exercise, how many more minutes should they run?
def solve() -> int: mike_time = 25 rachel_time = mike_time * 1.1 total_time = mike_time + rachel_time + 5 + 2 daily_exercise = 60 remaining_time = daily_exercise - total_time result = remaining_time return result
Student: A retailer is launching a promotion where if a customer buys three items, they get 20% off their total purchase. If the customer buys five items (with no other promotions), they spend $100. If the price of each item is the same, what is the discounted price of three items?
def solve() -> int: price_per_item = None total_price_for_five_items = 100 discount_percentage = 0.2 total_price_for_three_items = total_price_for_five_items * (3/5) price_per_item = total_price_for_three_items / 3 discounted_price = price_per_item * (1 - discount_percentage) * 3 result = di...
Bella has a jar of candy. She gives 10 candies to her friend Alice. Then she eats 20% of the remaining candies. After that, she adds 15 more candies to the jar. Finally, she gives half of the candies in the jar to her brother. How many candies does Bella have left in the jar?
def solve() -> int: candies = 100 candies -= 10 candies_eaten = 0.2 * candies candies -= candies_eaten candies += 15 candies_given = 0.5 * candies candies -= candies_given result = candies return result
A family is planning a road trip. If they will be driving 500 miles and their car gets 25 miles per gallon, how many gallons of gas will they need to buy?
def solve() -> int: distance = 500 miles_per_gallon = 25 gallons_needed = distance / miles_per_gallon result = gallons_needed return result
A jar of jelly beans weighs 12 ounces and consists of 3/4 jelly beans and the rest are peanuts. How many ounces of peanuts are in the jar?
def solve() -> int: total_weight = 12 fraction_jelly = 3/4 weight_jelly = fraction_jelly * total_weight weight_peanuts = total_weight - weight_jelly result = weight_peanuts return result
Grace saw an ad that said if she buys a pair of shoes worth $80, she could earn a $20 voucher. When she buys a bag worth $60, she receives another $15 voucher. How much does she need to pay for the shoes and bag?
def solve() -> int: shoe_price = 80 shoe_voucher = 20 bag_price = 60 bag_voucher = 15 total_price = shoe_price + bag_price total_voucher = shoe_voucher + bag_voucher amount_to_pay = total_price - total_voucher result = amount_to_pay return result
Billy needs to buy 8 paper notebooks for school. He can choose between small notebooks that cost $4 each and large notebooks that cost $6 each. How much money does he need to pay in total if he decides to buy 5 small notebooks and 3 large notebooks?
def solve() -> int: small_notebook_price = 4 large_notebook_price = 6 small_notebook_qty = 5 large_notebook_qty = 3 total_price = small_notebook_price * small_notebook_qty + large_notebook_price * large_notebook_qty result = "Billy needs to pay $" + str(total_price) + " in total."...
Mia is organizing her closet. She has three times as many dresses as she does skirts. She has two less pairs of shoes than skirts. Twelve of her items are black. How many items does she have in total?
def solve() -> int: skirts = 10 dresses = 3 * skirts shoes = skirts - 2 total_items = skirts + dresses + shoes total_items_black = 12 total_items_not_black = total_items - total_items_black result = total_items return result
Jackie is making a rectangular quilt with colorful patches. She uses 16 patches of red, 20 patches of blue, and 24 patches of green. She arranges the patches in 8 rows, with the same number of patches in each row. How many patches are in each row, and how many patches of each color are in each row?
def solve() -> int: total_patches = 16 + 20 + 24 patches_in_row = total_patches / 8 red_in_row = round(16 / total_patches * patches_in_row) blue_in_row = round(20 / total_patches * patches_in_row) green_in_row = round(24 / total_patches * patches_in_row) result = (patches_in_...
A rectangle has an area of 120 square meters and a length of 12 meters. What is the width of the rectangle?
def solve() -> int: area = 120 length = 12 width = area/length result = width return result
Sarah goes to a music festival and stays in different tents. The first 5 days she stays in a basic tent, where she is charged $10 per night. The sixth and seventh days she stays in a premium tent where she shares expenses with her friends, and they are charged $70 total per night. How much did Sarah spend on lodging?
def solve() -> int: basic_tent_cost = 10 premium_tent_cost = 70/2 days_in_basic_tent = 5 days_in_premium_tent = 2 total_cost = (basic_tent_cost * days_in_basic_tent) + (premium_tent_cost * days_in_premium_tent) result = total_cost return result
Jacob wants to buy a new video game. He is raising the money by mowing lawns. It costs him $10 in gas to mow each lawn and he charges $25 for each lawn. If he mows 9 lawns and still has $35 left over after buying the video game, how much did the video game cost?
def solve() -> int: gas_cost = 10 lawn_charge = 25 num_lawns = 9 total_cost = num_lawns * (gas_cost + lawn_charge) leftover = 35 game_cost = (total_cost - leftover) result = game_cost return result
Student: John had some balloons in three different colors. He had twice as many red balloons as yellow balloons, and five more blue balloons than yellow balloons. If John had a total of 42 balloons, how many red balloons did he have?
def solve() -> int: total_balloons = 42 yellow_balloons = 0 blue_balloons = 0 red_balloons = 0 yellow_balloons = total_balloons // 3 blue_balloons = yellow_balloons + 5 red_balloons = yellow_balloons * 2 result = red_balloons return result
A train travels 360 km in 6 hours. How long will it take the train to travel 540 km, assuming it maintains the same speed?
def solve() -> int: distance_1 = 360 time_1 = 6 distance_2 = 540 time_2 = time_1 * (distance_2/distance_1) result = time_2 return result
There are 6 slices of pizza in a box. If there are 3 boxes of pizza ordered, what is the total number of pizza slices?
def solve() -> int: slicesPerBox = 6 boxes = 3 totalSlices = slicesPerBox * boxes result = totalSlices return result
A company has a total budget of $50,000 to distribute as bonuses to its employees. If the company has 50 employees, and the manager wants to give managers $2,000 bonus, supervisors $1,000, and other employees $500, how many managers, supervisors, and employees are there?
def solve() -> int: num_managers = 1 num_supervisors = 5 num_employees = 44 total_bonus = (num_managers*2000) + (num_supervisors*1000) + (num_employees*500) result = (num_managers, num_supervisors, num_employees) return result
A travel agency sold 100 packages for a tour of Europe. However, 1/3 of the packages were cancelled and not refunded. If each package cost $3000, how much money did the travel agency earn from the sold packages?
def solve() -> int: total_packages = 100 cancelled_packages = total_packages/3 usable_packages = total_packages - cancelled_packages price_per_package = 3000 total_earnings = usable_packages * price_per_package result = total_earnings return result
A family went on a trip that cost $1500 in total. If they split the cost evenly among the 5 family members, how much money did each person pay?
def solve() -> int: trip_cost = 1500 num_people = 5 cost_per_person = trip_cost / num_people result = cost_per_person return result
A car travels 10 miles in 20 minutes. What is its speed in miles per hour?
def solve() -> int: distance = 10 time_in_hours = 20 / 60 speed = distance / time_in_hours result = speed return result
A group of friends went to a restaurant and ordered a total of 5 pizzas. Each pizza has 10 slices. If there are 7 people in the group and each person wants 2 slices, how many slices of pizza will be left uneaten?
def solve() -> int: total_slices = 5 * 10 people = 7 slices_per_person = 2 slices_needed = people * slices_per_person slices_left = total_slices - slices_needed result = slices_left return result
You have 60$ to spend on office supplies. You buy a pack of pens for 4$, a notebook for 5$, and 2/3 of what's left on sticky notes. How much money do you have left?
def solve() -> int: money = 60 pens = 4 notebook = 5 leftover1 = money - pens - notebook sticky_notes = leftover1 * (2/3) leftover2 = leftover1 - sticky_notes result = leftover2 return result
Student: Claire bought 10 boxes of cereal for $2.75 per box and 8 bags of chips for $2 per bag. How much did Claire spend in total?
def solve() -> int: cereal_boxes = 10 chip_bags = 8 cereal_price = 2.75 chip_price = 2 total_cost = cereal_boxes * cereal_price + chip_bags * chip_price result = total_cost return result
During a sale, a dress that was originally $60.00 is marked down by 33%. How much money will you save by buying it on sale?
def solve() -> int: original_price = 60.00 discount = original_price * 0.33 savings = discount result = savings return result
Mia likes to read books. She reads one book every week. The first book she reads has 200 pages, and every next book she reads has 10 more pages than the previous one. How many pages does she read in the first 10 weeks?
def solve() -> int: pages = 200 increment = 10 weeks = 10 total_pages = 0 for i in range(weeks): total_pages += pages pages += increment result = total_pages return result
A gymnast weighs 50 kg at 2 weeks from a championship. She is on a diet that allows her to lose 1 kg per week until the day of the championship. How much will she weigh on the day of the championship?
def solve() -> int: initial_weight = 50 weeks_to_championship = 2 weight_loss_per_week = 1 current_weight = initial_weight - (weeks_to_championship * weight_loss_per_week) result = current_weight return result
A company has a profit margin of 15%. If their revenue is $300,000, what is their profit?
def solve() -> int: revenue = 300000 profit_margin = 0.15 profit = revenue*profit_margin result = profit return result
A train is traveling at a speed of 60 km/hr. If it travels for 4 hours, how many kilometers will it have traveled?
def solve() -> int: speed = 60 time = 4 distance = speed * time result = distance return result
A school has a total of 850 students. If there are 50 classrooms, how many students are in each classroom on average?
def solve() -> int: total_students = 850 num_classrooms = 50 students_per_class = total_students // num_classrooms result = students_per_class return result
Michael wants to paint a rectangular wall that measures 12 feet by 10 feet. If he wants to leave a border of 1 foot around the wall unpainted, how many square feet of wall will he need to paint?
def solve() -> int: width = 12 height = 10 border = 1 unpainted_area = (width + 2 * border) * (height + 2 * border) painted_area = width * height result = unpainted_area - painted_area return result
Student: Mark and Steve went to a riverside market and bought 7 apples. Mark returned his 3 apples while Steve kept all of his. How many apples did they have in total at the end?
def solve() -> int: total_apples = 7 mark_apples = 3 steve_apples = total_apples - mark_apples result = steve_apples return result
Jane has $25 to buy clothes. She spends $7 on a shirt and $12 on a pair of pants. How much money does she have left?
def solve() -> int: money = 25 shirt = 7 pants = 12 remaining = money - shirt - pants result = remaining return result
A candy bag has 12 blue candies, 6 green candies, and 18 red candies. If 2 candies are picked randomly, what is the probability of selecting at least one blue candy?
def solve() -> int: num_blue = 12 num_gren = 6 num_red = 18 total_candies = num_blue + num_gren + num_red prob_no_blue = (num_gren/total_candies) * ((num_gren-1)/(total_candies-1)) prob_atleast_one_blue = 1 - prob_no_blue result = prob_atleast_one_blue return result
Noah is painting a mural on a wall. The wall is 8 meters long and 4 meters high. He has a paint can that covers 20 square meters. He wants to paint the wall with two coats of paint. How many paint cans will he need?
def solve() -> int: area_wall = 8 * 4 area_paint = area_wall * 2 cans = area_paint / 20 cans = round(cans, 0) result = cans return result
There are 30 students in a class. If the teacher divides them into groups of 5, how many groups are there?
def solve() -> int: students = 30 group_size = 5 num_groups = students / group_size result = num_groups return result
A class of 20 students takes a field trip to a farm and pays $8 per person for the admission. The farm also charges a flat fee of $50 for the bus rental and a $10 fee for a guided tour. The class also buys $6 worth of snacks per person. The total amount paid by the class is $370. How much, in dollars, did the teacher c...
def solve() -> int: total_cost = 8 * 20 + 50 + 10 + 6 * 20 difference = total_cost - 370 teacher = difference result = teacher return result
If a person needs 15 liters of water daily, and their pet needs 3 times less water, how many liters of water does the pet need in a week?
def solve() -> int: person_water_daily = 15 pet_water_daily = person_water_daily / 3 pet_water_weekly = pet_water_daily * 7 result = pet_water_weekly return result
A recipe calls for 2 1/2 cups of flour, but you only have 1 cup. How much more flour do you need to purchase?
def solve() -> int: required_flour = 2.5 available_flour = 1 remaining_flour = required_flour - available_flour result = remaining_flour return result
Alan’s new bike cost $800, but he paid in 3 monthly installments of $270. Calculate the total amount Alan paid for his bike.
def solve() -> int: original_price = 800 installment_price = 270 total_payments = 3 total_payment = original_price + installment_price * total_payments result = total_payment return result
Student: Stella wants to split 24 cookies into 3 equal parts. How many cookies does each part contain?
def solve() -> int: cookies = 24 parts = 3 cookies_per_part = cookies / parts result = cookies_per_part return result
A farmer has 80 cows and they need to be divided into equal groups. If each group can have a maximum of 10 cows, how many groups are needed?
def solve() -> int: num_cows = 80 max_cows_per_group = 10 num_groups = num_cows // max_cows_per_group result = num_groups return result
If Gavin buys a top with a 38% discount from the original price of $150, how much will he pay after the discount?
def solve() -> int: price = 150 discount_percentage = 38 discount = (price*discount_percentage)/100 total_cost = price - discount result = total_cost return result
In a school, the ratio of boys to girls is 3:2. If there are 150 boys, how many girls are there?
def solve() -> int: boys_ratio = 3 girls_ratio = 2 boys_count = 150 girls_count = (girls_ratio / boys_ratio) * boys_count result = girls_count return result
Student: John has 40 coins. He has twice as many dimes as quarters. How many dimes does John have?
def solve() -> int: coins = 40 dimes = 0 quarters = 0 dimes = 2 * quarters coins = dimes + quarters quarters = 40 / 3 dimes = 2 * quarters dimes = 2 * quarters result = dimes return result
The local grocery store is having a special sale. If you buy 5 items, you get a 10% discount and if you buy 10 items, you get a 20% discount. A customer wants to buy 12 items that each cost $2.50. How much will the customer have to pay for the 12 items?
def solve() -> int: item_cost = 2.50 * 12 if 12 >= 10: discount = item_cost * 0.20 else: discount = item_cost * 0.10 total_cost = item_cost - discount result = 27.00 return result
Jackson bought 4 packs of 24 markers, each costing $5. What was the total cost of all the markers he bought?
def solve() -> int: packs = 4 markers_per_pack = 24 cost_per_pack = 5 total_markers = packs * markers_per_pack total_cost = total_markers * cost_per_pack result = total_cost return result
If 15% of a number is 36, what is 40% of the same number?
def solve() -> int: percent = 0.15 num = 36 / percent new_percent = 0.4 new_num = num * new_percent result = new_num return result
Student: Michael has 81 stickers. He spreads them evenly amongst 14 of his friends. How many stickers does each friend get?
def solve() -> int: stickers = 81 friends = 14 result = stickers // friends return result
Mia has a collection of 12 books. She decided to lend some of them to her friends. She lent 3 books to Anna, 2 books to Leo, and 1 book to Sara. She also received 2 books from her cousin as a gift. How many books does Mia have now?
def solve() -> int: books_lent = 3 + 2 + 1 books_received = 2 books_now = 12 - books_lent + books_received result = books_now return result
Amanda is a wedding planner and needs to make sure she has enough chairs for all the guests at the wedding. Each stack of chairs contains 10 chairs. Amanda decides to bring 12 stacks of chairs, each of which has 5 chairs per stack, and this will be enough for every guest. How many guests are attending the wedding?
def solve() -> int: stacks_of_chairs = 12 chairs_per_stack = 5 chairs_per_guest = 1 total_chairs = stacks_of_chairs * chairs_per_stack total_guests = total_chairs / chairs_per_guest result = total_guests return result
A car company produces 200 cars a day. It takes 48 minutes to produce one car. How many cars can the company produce in a 10-hour day?
def solve() -> int: cars_per_minute = 1 / 0.8 time_in_minutes = 10 * 60 total_cars = cars_per_minute * time_in_minutes result = total_cars return result
Student: Brian cooks in a restaurant. He goes to the grocery store 4 times a week to get ingredients for the dishes he will cook. If it takes him 1 hour each time to drive to the store and back to the restaurant, how many hours does he spend driving each year?
def solve() -> int: times_per_week = 4 hours_per_time = 1 weeks_per_year = 52 hours_per_week = times_per_week * hours_per_time hours_per_year = hours_per_week * weeks_per_year result = hours_per_year return result
Holly purchased 12 items from a store that had a 20% discount. Her total bill was $153, how much was the original price of the items?
def solve() -> int: discount = 0.2 total_discounted = 153 original_cost = total_discounted / (1 - discount) result = 192.00 return result
Amy has a necklace that is made of 12 beads, each weighing 8 grams. She wants to add 3 more beads to the necklace, but they weigh 12 grams each. How much heavier will the necklace be after she adds the beads?
def solve() -> int: original_weight = 12 * 8 new_weight = original_weight + 3 * 12 difference = new_weight - original_weight result = difference return result
At the maize farm, there were 400kg of maize on sale. Two-thirds of the maize was sold and 100kg of new maize was added. Then, the remaining maize was given to the workers. How much maize was on sale initially? Megan wants to buy a new laptop. She has to put in a 15% deposit and then pay the rest when she gets it. The ...
def solve() -> int: initial_maize = 400 sold_maize = (2/3) * initial_maize new_maize = 100 remaining_maize = initial_maize - sold_maize + new_maize laptop_cost = 800 laptop_price = laptop_cost * 1.5 deposit = laptop_price * 0.15 final_payment = laptop_price - deposit result...
At the beach, Kevin and Emma found 4 pieces of pink and 7 pieces of white sea glass. Jenna found 3 pieces of pink and 6 pieces of white sea glass. If Ned found twice as many pieces of white sea glass as Kevin and Jenna combined, how many pieces of white sea glass did Ned find?
def solve() -> int: total_white_sea_glass = 0 total_white_sea_glass += 7 total_white_sea_glass += 6 total_white_sea_glass *= 2 result = total_white_sea_glass return result
Joe has 14 pencils and he wants to give 3 pencils to each of his 4 friends. How many pencils does he have left after he gives them away?
def solve() -> int: number_of_pencils = 14 number_of_friends = 4 number_of_pencils_per_friend = 3 total_number_given_away = number_of_friends * number_of_pencils_per_friend remaining_pencils = number_of_pencils - total_number_given_away result = remaining_pencils return result
A shopkeeper purchased 10 packets of chips for $120. He sold each pack for $15. How much profit did he make?
def solve() -> int: packets = 10 purchase_price = 120 sale_price = 15 total_sale_price = sale_price * packets profit = total_sale_price - purchase_price result = profit return result
A car has a full tank of gas that can go 400 miles. If the car travels at an average speed of 50mph, how long until the car needs to fill up again?
def solve() -> int: hours_until_refuel = 400/50 result = hours_until_refuel return result
Lily collected 450 watermelons. She discovers that only 80% of them are juicy, and she needs to throw away 30 because they don't taste good. How many watermelons does Lily have left that are both juicy and tasty?
def solve() -> int: watermelons_collected = 450 juicy_percentage = 0.8 watermelons_juicy = watermelons_collected * juicy_percentage watermelons_tasty = watermelons_juicy - 30 result = watermelons_tasty return result
Sarah has a horse and a zebra. The horse weighs 1200 pounds. The zebra weighs 80% less. What is their combined weight in pounds?
def solve() -> int: horse_weight = 1200 zebra_weight = horse_weight * (1 - 0.8) combined_weight = horse_weight + zebra_weight result = combined_weight return result
Student: Cole is twice as tall as his 20" tall dog. Jaime is 10" taller than the dog. How tall is Cole in feet?
def solve() -> int: dog_height_in = 20 jaime_height_in = dog_height_in + 10 cole_height_in = jaime_height_in + dog_height_in cole_height_ft = cole_height_in / 12 result = cole_height_ft return result
Tom has 3 paperclips. Samantha has twice as many paperclips as Tom. How many paperclips do they have in total?
def solve() -> int: tom_paperclips = 3 sam_paperclips = 2 * tom_paperclips total_paperclips = tom_paperclips + sam_paperclips result = total_paperclips return result
Tom purchased a CPU for $420 and sold it for a profit of 20%, how much money did he make?
def solve() -> int: cost = 420 profit = 0.2 * cost selling_price = cost + profit made = selling_price - cost result = made return result
Louisa wants to buy a necklace for $500, but it is on sale for 20% off. How much money will she save?
def solve() -> int: original_price = 500 discount_percentage = 20 amount_saved = original_price * (discount_percentage / 100) result = amount_saved return result
Sam was one-fourth his uncle's age when his uncle immigrated. If his uncle were alive now, twenty years later, he would have been 75. How old is Sam currently?
def solve() -> int: uncle_age = 75 - 20 sam_age = uncle_age / 4 result = sam_age return result
Alice cut a rectangular piece of paper into four smaller rectangles of equal size. The original piece of paper had a length of 24 cm and a width of 18 cm. What is the area of each smaller rectangle?
def solve() -> int: length_of_smaller_rectangle = 24 / 2 width_of_smaller_rectangle = 18 / 2 area_of_smaller_rectangle = length_of_smaller_rectangle * width_of_smaller_rectangle result = area_of_smaller_rectangle return result
Jack is a car salesman. He earns a base salary of $500 per week plus a commission of 10% of the total sales. He also has to pay a tax of 15% of his income. If he sells 8 cars in a week with an average price of $15000, how much does he take home after tax?
def solve() -> int: base_salary = 500 commission_rate = 0.1 tax_rate = 0.15 cars = 8 car_price = 15000 total_sales = cars * car_price commission = total_sales * commission_rate gross_income = base_salary + commission tax = gross_income * tax_rate net_income = gross_income - ...
Student: Two months ago, Peter earned three times more money than Tom. If his salary has increased by 15 percent now, and Tom's salary then was $3000, calculate Peter's salary now.
def solve() -> int: tom_salary = 3000 peter_salary = 3 * tom_salary peter_salary_now = peter_salary * 1.15 result = peter_salary_now return result
John has $450. He saved $30 each week for 10 weeks. On the eleventh week, he spent a third of his savings on groceries and used another third of his savings to go out with his friends. How much money does he have left?
def solve() -> int: initial_money = 450 weekly_saving = 30 saving_weeks = 10 groceries_cost = weekly_saving * (saving_weeks + 1) / 3 friends_cost = weekly_saving * (saving_weeks + 1) / 3 remaining_money = initial_money - groceries_cost - friends_cost result = remaining_money return resu...
Student: Kevin and Leo played a video game. Kevin scored 50 more points than Leo. If Leo scored 100 points, what was the total score of the game?
def solve() -> int: kevin = 0 leo = 100 kevin = leo + 50 total = kevin + leo result = total return result
A store is having a 20% off sale, and a shirt originally costing $25 is now discounted. How much will the shirt cost now?
def solve() -> int: discounted_price = 25 * 0.8 result = discounted_price return result
A company orders a shipment of 5000 items for $6000. They receive an additional 1000 items for free. What is the price per item?
def solve() -> int: total_items = 5000 + 1000 unit_price = 6000 / total_items result = unit_price return result
A company earned a profit of $4000 from a sale of $20,000. Calculate the profit percentage.
def solve() -> int: sale = 20000 profit = 4000 profit_percentage = (profit / sale) * 100 result = profit_percentage return result
Jason took 15 steps forward, then took ten steps back and took one step forward. After that, he took five steps forward, turned left, walked seven steps forward and turned right and took four steps back. Finally, Jason took double the amount of steps he took backward in forward direction. How far is Jason from his star...
def solve() -> int: steps_forward = 15 steps_backward = 10 steps_forward += 1 steps_forward += 5 steps_forward += 7 steps_backward -= 4 steps_forward += steps_backward*2 result = steps_forward - steps_backward return result