question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A recipe for cupcakes requires 3 eggs for every 2 cups of flour. If you have 12 eggs and 8 cups of flour, how many batches of cupcakes can you make?
def solve() -> int: eggs = 12 flour = 8 eggs_per_batch = 3 flour_per_batch = 2 batches = min(eggs//eggs_per_batch, flour//flour_per_batch) result = batches return result
Matthew purchased 6 Rubik's cubes and 5 boxes of games. Each cube cost $10, each box of games cost $20. How much did he spend in total?
def solve() -> int: amount_cubes = 6 price_cubes = 10 amount_games = 5 price_games = 20 total_cubes = amount_cubes * price_cubes total_games = amount_games * price_games total_price = total_cubes + total_games result = total_price return result
Student: How much will it cost to buy 400 reams of printing paper with 250 sheets each if each ream costs $45?
def solve() -> int: reams = 400 sheets_per_ream = 250 cost_per_ream = 45 total_sheets = reams * sheets_per_ream total_cost = reams * cost_per_ream result = total_cost return result
Aaron sells apples in the local market. He sells 30 apples every weekend for 3 weeks. How many apples will Aaron have sold in 3 weeks?
def solve() -> int: apples_per_weekend = 30 number_of_weekends = 3 total_apples_sold = apples_per_weekend * number_of_weekends result = total_apples_sold return result
arah gets 10 crayons every month and she gives away 2 crayons daily. If she has 22 crayons left after 3 months, how many crayons did she get in total?
def solve() -> int: term = 3 crayons = 22 for i in range(term): crayons = crayons + 10 crayons = crayons - 2 amount = (term * 10) - crayons result = amount return result
Possible questions and programs: George went to the park and saw 8 ducks swimming in the pond. He then walked to the playground and saw 3 times as many kids as ducks playing on the slides. Next, he went to the picnic area and saw 2 fewer adults than kids having lunch. Finally, he saw some dogs and counted 5 dogs. How m...
def solve() -> int: ducks = 8 kids = 3 * ducks adults = kids - 2 dogs = 5 difference = adults - dogs result = difference return result
Emily and James each draw pictures in art class. Emily drew 6 more pictures than James did, but James used three times as many colors as Emily did. If Emily drew 15 pictures and used 5 colors, how many colors did James use in total?
def solve() -> int: emily_pictures = 15 emily_colors = 5 james_pictures = emily_pictures - 6 james_colors = emily_colors / 3 total_colors = james_pictures * james_colors result = total_colors return result
Sarah is going to buy a train ticket. The ticket price is $30 per person, but she has a coupon of $5 off for every third ticket. If Sarah is traveling with a group of 9 people, how much will they have to pay in total?
def solve() -> int: discounted_tickets = 9 // 3 full_price_tickets = 9 - discounted_tickets total_cost = full_price_tickets * 30 + (discounted_tickets * 25) result = total_cost return result
A school has 5 grade levels with 120 students in each grade. If each student needs 4 textbooks, how many textbooks does the school need to purchase?
def solve() -> int: number_of_grades = 5 students_per_grade = 120 total_students = number_of_grades*students_per_grade textbooks_needed = total_students*4 result = textbooks_needed return result
John is packing for a trip and has 30 items to pack, but he only packs the ones that are a multiple of 4. If it takes him 5 minutes to pack one item, how many hours does he spend packing in total?
def solve() -> int: num_items = 30 multiple = 4 packed_items = num_items // multiple packing_time = 5 total_time = packed_items * packing_time / 60 result = total_time return result
A bridge is 50 meters long. It collapses, breaking in half, such that one half of the bridge is now sitting six meters below the other half. How long is each half of the bridge?
def solve() -> int: length_of_bridge = 50 difference_in_height = 6 length_of_half_bridge = length_of_bridge / 2 length_of_each_half = length_of_half_bridge + difference_in_height result = length_of_each_half return result
Jenny loves baking cookies for her friends. She has a recipe that makes 24 cookies with 2 cups of flour, 1 cup of sugar, and 1/2 cup of butter. How much of each ingredient will she need if she wants to bake 72 cookies for her class party?
def solve() -> int: flour = 2 * 3 sugar = 1 * 3 butter = 0.5 * 3 result = (flour, sugar, butter) return result
John works four days a week as a server and earns a variable amount of tips every day. The past three days, he earned $20, $30, and $40. What is the minimum amount he needs to earn on the fourth day if he wants to make an average of $35 in tips per day?
def solve() -> int: tips = [20, 30, 40] num_days = 4 avg_tips = 35 total_tips = num_days * avg_tips earned_tips = sum(tips) required_tips = total_tips - earned_tips result = required_tips + tips[-1] return result
Emily is baking bread for her family. She has 3 bags of flour and wants to make different shaped loaves. If she cuts each loaf into 18 large slices, and then takes a tenth of those slices and cuts them into 6 smaller pieces each, how many pieces of bread will she have in total?
def solve() -> int: flour_bags = 3 loaves_per_bag = 4 slices_per_loaf = 18 small_pieces_per_slice = 6 total_loaves = flour_bags * loaves_per_bag total_slices = total_loaves * slices_per_loaf small_slices = total_slices // 10 total_small_pieces = small_slices * small_pieces_per_slice...
Q2:Jack went to the store to buy 6 gallons of milk. If each gallon costs $3.47, what is the total amount that Jack spent to buy the milk?
def solve() -> int: num_gallon = 6 price_per_gallon = 3.47 total_amount = num_gallon * price_per_gallon result = total_amount return result
Leah wants to give one keychain to each of her 9 friends. She can make one keychain in 15 minutes, but 3 of them broke. How long will it take for her to make keychains for all of her friends?
def solve() -> int: num_friends = 9 time_per_keychain = 15 num_broken = 3 num_working = num_friends - num_broken total_time = num_working * time_per_keychain result = total_time return result
Andrew is buying hamburgers for his family. He plans to buy hamburgers equally for each member. If there are 5 members in his family and each hamburger cost $3.50, how much will Andrew spend to buy all the hamburgers?
def solve() -> int: total_members = 5 cost_per_hamburger = 3.5 total_cost = total_members * cost_per_hamburger result = total_cost return result
- Aaron wants to bake some brownies for his friends. He has a recipe that makes 16 brownies and requires 2 cups of flour, 1.5 cups of sugar, 0.75 cups of cocoa, and 0.5 cups of oil. He only has 1 cup of flour, 1 cup of sugar, and 0.5 cups of cocoa left in his pantry. How much oil does he need to use to make as many bro...
def solve() -> int: flour_brownies = 1 / 2 sugar_brownies = 1 / 1.5 cocoa_brownies = 0.5 / 0.75 max_brownies = min(flour_brownies, sugar_brownies, cocoa_brownies) oil_needed = max_brownies * 0.5 result = oil_needed return result
Student: The sales tax in a certain state is 7.5%. If you buy a laptop for $800, what is the total cost including tax?
def solve() -> int: sales_tax = 0.075 laptop_price = 800 tax_amount = sales_tax * laptop_price total_cost = laptop_price + tax_amount result = total_cost return result
Jane has been traveling a total of 1500 km by car in 5 days. On the first day, she drove 100 km, on the second day she drove 200 km, and so on. How much did Jane travel on the fourth day?
def solve() -> int: total_km = 0 added_km = 100 for i in range(4-1): total_km += added_km added_km += 100 result = total_km return result
has 7 times as many buttons as Tom. Joe has 14 fewer buttons than Sue. Amy has one-seventh the number of buttons Tom has. If Tom has 21 buttons, what is the total number of buttons they all have?
def solve() -> int: tom = 21 sue = 7 * tom joe = sue - 14 amy = tom / 7 total = tom + sue + joe + amy result = total return result
At a flower shop, 55% of the roses cost $3 each, and the rest cost $1 each. Emily bought half the roses sold at $3 each, and all of the roses sold at $1 each. If the total number of roses was 80, how much money did Emily spend on buying the roses?
def solve() -> int: roses_sold_at_3 = 80 * 0.55 roses_sold_at_1 = 80 - roses_sold_at_3 roses_bought_at_3 = roses_sold_at_3 / 2 roses_bought_at_1 = roses_sold_at_1 total_cost = (roses_bought_at_3 * 3) + (roses_bought_at_1 * 1) result = total_cost return result
Two musical instruments were sold at the same time for a total of $680. If one instrument was sold for $60 more than the other, how much did each instrument cost originally?
def solve() -> int: total_cost = 680 cost_difference = 60 cost_of_first_instrument = (total_cost - cost_difference) / 2 cost_of_second_instrument = cost_of_first_instrument + cost_difference result = (cost_of_first_instrument, cost_of_second_instrument) return result
If Paul has twice the amount of money as Jack, and together they have $300, how much money does Paul have?
def solve() -> int: jack_money = 300 / 3 paul_money = 2 * jack_money result = paul_money return result
A company produces two types of products. For every Type A product, it makes a profit of $5 and for every Type B product, it makes a profit of $8. If it sells 100 Type A products and 50 Type B products in a month, how much profit does it make that month? Assuming the company saves half of its earned profits each month,...
def solve() -> int: profit = 100 * 5 + 50 * 8 savings = profit / 2 num_of_months = 2000 / savings result = num_of_months return result
Student: Stanford bought 4 video games which cost $29 each and 3 comic books for $18 each. He was given a 20% coupon and was subjected to a $0.5 fee. How much will he pay in total?
def solve() -> int: video_games = 4 comic_books = 3 cost_video_game = 29 cost_comic_book = 18 coupon_percentage = 0.2 fee = 0.5 total_cost_video_games = video_games * cost_video_game total_cost_comic_books = comic_books * cost_comic_book total_cost_before_coupon = total_cost_video_ga...
Student: A bike uses 3 liters of gasoline to cover a distance of 45 km. How long a distance can be covered by 25 liters of gasoline?
def solve() -> int: gasoline_used = 3 distance_covered = 45 gasoline_given = 25 distance_covered_by_25_liters = (distance_covered * gasoline_given) / gasoline_used result = distance_covered_by_25_liters return result
Student: John has a jar of coins, with 4 quarters, 7 dimes, and 5 nickels. How much money does John have in the jar?
def solve() -> int: quarters = 4 dimes = 7 nickels = 5 quarter_value = 0.25 dime_value = 0.1 nickel_value = 0.05 quarters_total = quarters * quarter_value dimes_total = dimes * dime_value nickels_total = nickels * nickel_value jar_total = quarters_total + dimes_total + nickels...
If a runner completes 5 laps of a running track in 24 minutes, what is his average speed in km/h?
def solve() -> int: total_hours = 24 / 60 total_distance = 5 * 400 average_speed = total_distance / total_hours result = average_speed return result
Emily and her brother Joseph each have $50 to spend on dinner. The bill is half of their total money. They decided to go for dessert after. Each dessert costs $3 and they get the same amount as each other. If they leave with $7 in change each, how many desserts did they each buy?
def solve() -> int: emily_money = 50 joseph_money = 50 total_money = emily_money + joseph_money bill = total_money / 2 change = 7 dessert_cost = 3 total_desserts = (total_money - bill - (2 * change)) / dessert_cost desserts_each = total_desserts / 2 result = desse...
Max and Leo go to a pizza place. Max orders a large pepperoni pizza for $12 and a soda for $2. Leo orders a medium cheese pizza for $10 and a water for $1. They tip 18% and Max pays for both of them. How much did Max pay?
def solve() -> int: total = 12 + 2 + 10 + 1 tip = total * 0.18 total_with_tip = total + tip max = total_with_tip result = max return result
Maria has 24 cupcakes. On Wednesdays and Fridays, she eats 2 cupcakes for each day and on the other days of the week she eats 1 cupcake for each day. How many weeks does it take for Maria to eat all of the cupcakes?
def solve() -> int: cupcakes = 24 days_per_week = 7 cupcakes_per_day_wed_fri = 2 cupcakes_per_day_other = 1 total_cupcakes_eaten = 0 weeks = 0 while total_cupcakes_eaten < cupcakes: weeks += 1 for day in range(days_per_week): if day == 2 or day == 4: ...
A company produces 2500 units of a product in a day. If the production rate remains constant, how many products will the company produce in 5 days?
def solve() -> int: total_production = 2500 * 5 result = total_production return result
A candy bar costs $1.50 and a bag of chips costs $2.75. If Sarah buys 2 candy bars and 3 bags of chips, what is the total cost?
def solve() -> int: candy_bar_cost = 1.50 chips_cost = 2.75 num_candy_bars = 2 num_chips = 3 total_cost = num_candy_bars * candy_bar_cost + num_chips * chips_cost result = total_cost return result
Tom buys a dozen apples for $5. How much does each apple cost in cents?
def solve() -> int: cost_of_dozen_apples = 5 apples_in_dozen = 12 cost_of_single_apple = cost_of_dozen_apples / apples_in_dozen cost_of_single_apple_in_cents = cost_of_single_apple * 100 result = cost_of_single_apple_in_cents return result
A rectangle has a length 4 times its width. If the perimeter of the rectangle is 50 cm, what is the length of the rectangle?
def solve() -> int: width = 0 length = 0 perimeter = 50 width = perimeter // 10 length = width * 4 result = length return result
A box of doughnuts contains 12 doughnuts. If John ate 2 of them and gave 3 to Jane, what percentage of the original box does John have left?
def solve() -> int: john = 2 jane = 3 original = 12 remaining = original - john - jane percentage = (remaining / original) * 100 result = f'John has {percentage}% of the original box left.' result = percentage return result
Six friends shared 2 tubs of ice cream. Rachel ate one-third of the first tub, Mark ate one-fourth of the first tub, Emily ate half of the second tub, Ben ate one-sixth of the second tub and Sarah ate two-thirds of the second tub. If each tub is 1.5L, how many liters of ice cream did each friend get?
def solve() -> int: l_per_tub = 1.5 tubs = 2 total_l = l_per_tub * tubs people = 6 tub1_rachel_l = total_l / 3 tub1_mark_l = total_l / 4 tub2_emily_l = total_l / 2 tub2_ben_l = total_l / 6 tub2_sarah_l = 2 * total_l / 3 total_l_eaten = tub1_rachel_l + tub1_mark_l + tub2_emily_l +...
Student: A box contains 24 red, 12 blue, and 6 yellow balls. What is the percentage of red balls?
def solve() -> int: red_balls = 24 blue_balls = 12 yellow_balls = 6 total_balls = red_balls + blue_balls + yellow_balls percentage_red_balls = (red_balls / total_balls) * 100 result = percentage_red_balls return result
A tank contains 2000 gallons of water. If it loses 10% per day, how much water remains after 5 days?
def solve() -> int: water = 2000 percent_lost_per_day = 0.1 days = 5 remaining = water*(1-percent_lost_per_day)**days result = remaining return result
A store is selling shirts at a 20% discount. If the regular price is $25, what is the discounted price?
def solve() -> int: regular_price = 25 discount_rate = 0.2 discount_amount = regular_price * discount_rate discounted_price = regular_price - discount_amount result = discounted_price return result
Student: If Janette brought 30 pieces of beef jerky for a 5 day camping trip but ate 3 pieces of beef jerky on the first day, what is the minimum number of pieces of beef jerky she needs to eat on each of the 4 remaining days so that she ends up with 3 pieces of jerky when the trip is over?
def solve() -> int: total_jerky = 30 days = 5 eaten_jerky = 3 leftover_jerky = 3 remaining_jerky = total_jerky - eaten_jerky needed_jerky = remaining_jerky - leftover_jerky min_jerky = needed_jerky // (days - 1) result = min_jerky return result
Amy has 20 quarters and 15 dimes in her piggy bank. She wants to buy a toy that costs $8. How many coins does she need to take out of her piggy bank to buy the toy?
def solve() -> int: quarters_value = 20 * 0.25 dimes_value = 15 * 0.1 total_value = quarters_value + dimes_value money_needed = total_value - 8 coins_needed = money_needed / 0.25 result = coins_needed return result
If the length of one side of a square is 9 cm, what is the perimeter of the square?
def solve() -> int: side_length = 9 perimeter = 4 * side_length result = perimeter return result
Student: There is a basket of eggs that has white, brown, and speckled eggs. There are 4 less white eggs than brown eggs, and there are twice as many speckled eggs as white eggs. How many eggs are in the basket in total if there are 12 brown eggs in the basket?
def solve() -> int: brown = 12 white = brown - 4 speckled = 2 * white total = brown + white + speckled result = total return result
am has 120 stickers. He keeps 1/4 of them and then trades the rest. He trades 1/2 of what he traded for new stickers and 1/2 for old stickers. How many new stickers did Sam get?
def solve() -> int: stickers_kept = 120 / 4 stickers_traded = 120 - stickers_kept stickers_new = stickers_traded / 2 stickers_old = stickers_traded / 2 result = stickers_new return result
Martin has twice as many comic books as Tom. If Tom has 24 comic books, how many comic books does Martin have?
def solve() -> int: martin = 2*24 result = int(martin) return result
For every three cats, there are four rabbits. If there are 24 cats, how many rabbits are there?
def solve() -> int: cats = 24 rabbits = cats * 4 / 3 result = rabbits return result
Max had 30 coins, but then he spent 8 and gave 6 to his sister. Lily has 1/5 more than what Max has now, plus 3. How many coins does Lily have?
def solve() -> int: max = 30 - 8 - 6 one_fifth_max = max / 5 lily = max + one_fifth_max + 3 result = lily return result
Student: Ben wants to donate $100 to a charity in four weeks. He has already donated $10 and he plans to donate 25% more than his donation in the previous week. How much will he donate in the third week to reach his goal?
def solve() -> int: total = 100 donated = 10 rate = 0.25 remaining = total - donated week_1 = donated week_2 = week_1 * (1 + rate) week_3 = week_2 * (1 + rate) week_4 = remaining - (week_1 + week_2 + week_3) result = week_3 return result
Paula has 60 cans of soda that cost $0.75 per can. Melissa has 45 cans of soda that cost $0.80 per can. How much is the cost of their soda combined?
def solve() -> int: soda_paula = 60 cost_paula = 0.75 soda_melissa = 45 cost_melissa = 0.80 total_cost = (soda_paula * cost_paula) + (soda_melissa * cost_melissa) result = total_cost return result
Olivia drinks 3 cups of water a day. In each of her first 21 days, she drank 4 cups. If she has 9 days left, how many cups of water does she have to drink each day to bring her average for the season up to 5 cups a day?
def solve() -> int: cups_per_day = 3 cups_first_21_days = 4 * 21 cups_remaining = (5 * (21 + 9)) - cups_first_21_days cups_per_day_remaining = cups_remaining / 9 result = cups_per_day_remaining return result
Maria and Diego were picking oranges from their orchard. After picking 150 oranges each, they realized they still needed more, so each picked 3/4 times as many as they had picked earlier. When they checked their crate, they found out they still needed to pick 400 oranges each to reach the target number. How many orange...
def solve() -> int: initial_oranges = 150 additional_oranges = 3/4 * initial_oranges target_oranges = 400 total_oranges = initial_oranges + additional_oranges + target_oranges total_oranges *= 2 result = total_oranges return result
Ben is making lemonade for a party. He has 24 lemons and each lemon yields 4 ounces of juice. He wants to mix the lemon juice with water and sugar in a ratio of 1:4:1 (meaning 1 ounce of lemon juice, 4 ounces of water, and 1 ounce of sugar). How many ounces of lemonade can he make?
def solve() -> int: lemon_juice = 24 * 4 water = lemon_juice * 4 sugar = lemon_juice lemonade = lemon_juice + water + sugar result = lemonade return result
Michael is filling his pool for a pool party. The pool can hold 1000 gallons of water. Michael's hose can normally pump 15 gallons/minute, but due to water regulations, it can only pump 70% as fast right now. How long will it take Michael to fill his pool?
def solve() -> int: pool_capacity = 1000 normal_pump_rate = 15 current_pump_rate = normal_pump_rate * 0.7 time_to_fill_pool = pool_capacity / current_pump_rate result = time_to_fill_pool return result
Possible new questions and programs are: There are 6 rows of apples on a shelf. Each row has 8 apples except the last one, which has 5 apples. How many apples are there in total on the shelf?
def solve() -> int: rows = 6 apples_per_row = 8 total_apples = rows * apples_per_row excess_apples = apples_per_row - 5 total_apples = total_apples - excess_apples result = total_apples return result
Student: A store had expenses of $900. If it gained 1/5 of the total expenses, calculate the total income of the store.
def solve() -> int: expenses = 900 gain = expenses * 1/5 income = expenses + gain result = income return result
Every month, a library lends out 25 books and receives 20 books back. The library has 500 books in total. After 6 months, the library donates 10% of its books to a school and receives 50 new books from a publisher. How many books does the library have after this?
def solve() -> int: books = 500 for month in range(6): books -= 25 books += 20 books_donated = books * 0.1 books -= books_donated books += 50 result = books return result
If there are 1210 pencils in a school, and each student consumes 8 pencils per day, how many days can the same pack of pencils be used up?
def solve() -> int: numPencils = 1210 pencilConsumeRate = 8 result = numPencils / pencilConsumeRate return result
Student: If it took 4 hours to drive 120 miles on Monday, how long did it take to drive 60 miles on Tuesday?
def solve() -> int: distance = 60 time_on_monday = 4 speed_on_monday = distance / time_on_monday time_on_tuesday = distance / speed_on_monday result = time_on_tuesday return result
Student: Jack and Jill are cousins. Jack is younger than Jill by 4 years. This year Jack will be 18 years old. How old will Jill be 2 years from now?
def solve() -> int: jack_age = 18 jill_age = jack_age - 4 jill_age_2_years_from_now = jill_age + 2 result = jill_age_2_years_from_now return result
A store has a 20% sale on all items. If the original price of a watch was $120, what is the price after the discount? Also, if the store has a 7% tax, what is the final price of the watch?
def solve() -> int: original_price = 120 discount = original_price * 0.2 price_after_discount = original_price - discount tax = price_after_discount * 0.07 final_price = price_after_discount + tax result = final_price return result
Student: A farmer has a rectangular field that is 50 meters long and 30 meters wide. What is the perimeter of the field?
def solve() -> int: length = 50 width = 30 perimeter = 2 * (length + width) result = perimeter return result
Student: Q9: 6 friends went out for dinner. They spent a total of $68. How much did each person contribute?
def solve() -> int: total_cost = 68 number_of_friends = 6 contribution_per_person = total_cost / number_of_friends result = contribution_per_person return result
In a group of 100 people, 25% of the people are left-handed. How many people are left-handed?
def solve() -> int: total_people = 100 left_handed_percent = 0.25 left_handed_people = total_people * left_handed_percent result = left_handed_people return result
``` A factory produces 12000 units of a product each day. On a particular day, there was a production error and only 80% of the units were good. How many good units were produced?
def solve() -> int: total_units = 12000 good_units_percentage = 80 good_units = (good_units_percentage/100)*total_units result = good_units return result
The ratio of books to CDs that Kai bought is 2:5. If Kai spent $120 on CDs, how much did he spend on books?
def solve() -> int: x = 48 result = x return result
Lucy spent 25% less money than her friend Mia on groceries, and Mia spent 10 more dollars than their neighbor Kim. If Lucy spent 150 dollars, how much money did all of them spend?
def solve() -> int: mia_money = 150 / 0.75 kim_money = mia_money - 10 total_money = 150 + mia_money + kim_money result = round(total_money) return result
Student: Hannah just received her paycheck and she put $500 in the bank. Before that, she bought a spice rack and some containers for $50. Later, she went shopping and got her mom an expensive dress for $150. She also got her sister a necklace for $110. After that, she decided to treat herself with a cruise for $350. H...
def solve() -> int: bank_balance = 500 spice_rack_cost = 50 dress_cost = 150 necklace_cost = 110 cruise_cost = 350 total_cost = spice_rack_cost + dress_cost + necklace_cost + cruise_cost remaining_balance = bank_balance - total_cost result = remaining_balance return result
A train travels at a speed of 50 miles per hour. If it travels for 3 hours, how far will it have gone in total?
def solve() -> int: speed = 50 time = 3 distance = speed * time result = distance return result
2. Mariah sold 34 more tickets than Henry and 10 fewer tickets than Emma. If Emma sold 40 tickets, how many tickets did Mariah sell?
def solve() -> int: emma_tickets = 40 henry_tickets = emma_tickets - 10 mariah_tickets = henry_tickets + 34 result = mariah_tickets return result
A family bought a package of 15 hot dogs and a package of 12 hot dog buns. If they don't want to waste any hot dogs or buns, what is the least number of hot dogs and buns that could be used?
def solve() -> int: hot_dogs = 15 hot_dog_buns = 12 least = min(hot_dogs, hot_dog_buns) result = least return result
Jack is paid $15 per hour for the first 9 hours that he works in a day, and is paid double that rate ($30 per hour) for any additional hours worked after that. If Jack works 12 hours in a day, how much money would he earn?
def solve() -> int: hourly_rate1 = 15 hourly_rate2 = 30 regular_hours = 9 extra_hours = 12 - regular_hours total_pay = regular_hours*hourly_rate1 + extra_hours*hourly_rate2 result = total_pay return result
On a level 3 of the same parking lot, 36 cars are parked. How many cars will be parked on the other levels together?
def solve() -> int: number_level = 425/5 spots_filled_level3 = 36 result = (number_level - spots_filled_level3)*4 + spots_filled_level3 return result
Student: Ashley has 21 cups and prints 7 different designs on them. What is the ratio of cups with designs to cups without designs?
def solve() -> int: cups_with_designs = 7 cups_without_designs = 21 - cups_with_designs ratio = cups_with_designs / cups_without_designs result = ratio return result
In a zoo, the ratio of lions to tigers is 3:2. If there are 36 tigers, how many lions are there?
def solve() -> int: tigers = 36 lion_to_tiger_ratio = 3 / 2 lions = tigers * lion_to_tiger_ratio result = lions return result
Emma had 3 plates of cookies to share with her 8 friends and her neighbor, Mrs. Johnson. If each plate had 30 cookies and Emma, her friends, and Mrs. Johnson each had 2 cookies, how many cookies were left?
def solve() -> int: plates = 3 friends = 8 cookies_per_plate = 30 cookies_per_person = 2 total_people = friends + 1 total_cookies = plates * cookies_per_plate total_cookies_taken = total_people * cookies_per_person cookies_left = total_cookies - total_...
There are 60 students in a school. If the ratio of the number of boys to the number of girls is 2:3, how many girls are in the school?
def solve() -> int: total_ratio_parts = 2+3 girls_parts = 3 girls = int((girls_parts/total_ratio_parts)*60) result = girls return result
Mia scored 78, 81, 75 and 83 on her first four quizzes in math. She wants to have an average of at least 80 on her five quizzes. What is the minimum score she needs to get on her fifth quiz?
def solve() -> int: y = 400 - (78 + 81 + 75 + 83) result = y return result
Asher is hosting a game night and needs to buy snacks. He needs 2 bags of chips that are $3.50 each, 1 package of cookies that costs $4.00, and 1 bottle of soda that costs $2.50. How much will Asher spend on snacks?
def solve() -> int: bags_of_chips = 2 price_per_bag_of_chips = 3.50 package_of_cookies = 1 price_per_package_of_cookies = 4.00 bottle_of_soda = 1 price_per_bottle_of_soda = 2.50 total_cost = (bags_of_chips * price_per_bag_of_chips) + (package_of_cookies * price_per_package_of_cookies) +...
If 9 cookies cost $3, how many cookies could be bought for $36?
def solve() -> int: cost_for_9_cookies = 3 total_cost = 36 num_of_cookies = total_cost // cost_for_9_cookies result = num_of_cookies return result
If 10 oranges cost $2, how many oranges can you buy for $5?
def solve() -> int: oranges_can_buy = 5/2*10 result = oranges_can_buy return result
Zoe and Zachary partnered up to start a clothing store. Zoe contributed $5000, and Zachary contributed 1/5 more money than Zoe. If they made a profit of 18 percent of the total amount and decided to share the profits equally, calculate the amount of money each got.
def solve() -> int: zoe = 5000 zachary = zoe * 1.2 total = zoe + zachary profit = total * 0.18 total_after_profit = total + profit each_partner = total_after_profit / 2 result = each_partner return result
Mr. Ali has a rectangular garden that is 12 m long and 8 m wide. He wants to build a fence around the garden with a gate that is 2 m wide. The fence costs $5 per meter and the gate costs $20. How much does Mr. Ali need to pay for the fence and the gate?
def solve() -> int: perimeter = 2 * (12 + 8) fence_length = perimeter - 2 fence_cost = fence_length * 5 gate_cost = 20 total_cost = fence_cost + gate_cost result = total_cost return result
Student: 4. At the start of the race, Chris was 250 meters away from the first finish line, and he ran at a steady pace for 6 minutes before reaching the end. About how fast was he running per minute?
def solve() -> int: distance = 250 time = 6 speed = distance / time speed_per_minute = speed / time result = speed_per_minute return result
Samantha spent 10% of her monthly salary on utilities, half of it on other monthly expenses, and put the rest in her savings. If she spent $145 on utilities, how much did she save in a month?
def solve() -> int: monthly_salary = 0 utilities_expenses = 145 total_expenses = utilities_expenses / 0.1 other_expenses = total_expenses / 2 savings = total_expenses - utilities_expenses - other_expenses result = savings return result
James has 60 coins. He gives a quarter of them to his brother. He also finds 15 more coins on the street. How many coins does James have now?
def solve() -> int: coins = 60 giving_away = coins / 4 finding = 15 result = coins - giving_away + finding return result
In a class, there are 25 students. Each student is given 5 pencils. If each pencil box contains 12 pencils, how many boxes of pencils are needed?
def solve() -> int: total_pencils = 25*5 pencil_boxes = total_pencils/12 result = round(pencil_boxes, 2) return result
Ryan is saving money for a new bike that costs $250.00. He has $50.00 in his piggy bank and he earns $10.00 per week from doing chores. He also spends $5.00 per week on snacks. How many weeks will it take him to save enough money for the bike?
def solve() -> int: save = 10 - 5 goal = 250 - 50 weeks = (goal + save - 1) // save result = weeks return result
A train schedule lists 25 minutes of stop time at Station A, 30 minutes of stop time at Station B, and 10 minutes of stop time at Station C. If the total journey is 2 hours and 45 minutes, how many minutes is the train actually moving?
def solve() -> int: station_A_stop = 25 station_B_stop = 30 station_C_stop = 10 total_journey = 2*60 + 45 total_stop_time = station_A_stop + station_B_stop + station_C_stop actual_travel_time = total_journey - total_stop_time result = actual_travel_time return result
Alex loves shopping for clothes. He buys four shirts every month at the local boutique. One shirt costs him $20. In a different boutique, there is a clearance sale, during which each shirt costs only $15. How much would Alex save in three months, if he would buy his shirts in this boutique instead of his local one?
def solve() -> int: local_shirt_cost = 20 clearance_shirt_cost = 15 shirts_per_month = 4 local_cost_per_month = local_shirt_cost * shirts_per_month clearance_cost_per_month = clearance_shirt_cost * shirts_per_month local_cost_for_three_months = local_cost_per_month * 3 clearance_co...
Jackson received 25 basketballs on his birthday and 10 more on Christmas from his family members. Before his birthday, he had only 40% of them. How many basketballs does Jackson have now?
def solve() -> int: birthday_basketballs = 25 christmas_basketballs = 10 total_basketballs = birthday_basketballs + christmas_basketballs percentage_before_birthday = 40 basketballs_before_birthday = (percentage_before_birthday / 100) * total_basketballs basketballs_now = basketballs_b...
Tom, Jerry, Lisa and Anna are playing a card game. Tom has 8 cards, Jerry has 6 cards and Lisa has 7 cards. If there are 32 cards in total, how many cards does Anna have?
def solve() -> int: tom = 8 jerry = 6 lisa = 7 cards_distributed = tom + jerry + lisa cards_remaining = 32 - cards_distributed anna = cards_remaining result = anna return result
Ava has 8 crayons. Her classmate, Mia, has 3 crayons. Mia's mom has 7 more crayons than Ava and Mia combined. How many crayons do the three of them have altogether?
def solve() -> int: ava_crayons = 8 mia_crayons = 3 mia_mom_crayons = (ava_crayons + mia_crayons) + 7 total_crayons = ava_crayons + mia_crayons + mia_mom_crayons result = total_crayons return result
Paul needs to buy paint for his new car. Each gallon of paint covers 250 square feet. How many gallons of paint does he need if the car dimensions are a 6-foot long by 4-foot wide and widths 2 feet in height?
def solve() -> int: length = 6 width = 4 height = 2 coverage = 250 result = 2*length*width*height/coverage return result
If a rectangle has a length of 30cm and a width of 20cm, what is its perimeter?
def solve() -> int: length = 30 width = 20 perimeter = 2 * (length + width) result = perimeter return result
Student: In a shipment of candy, there are 12 boxes and each box has 15 bags. Each bag contains 10 candies. How many candies are in the shipment?
def solve() -> int: boxes = 12 bags = 15 candies = 10 total_candies = boxes * bags * candies result = total_candies return result
A classroom has 40 students. The first 15 students score 80% each while the next 10 score 90% each. The remaining students each score half the percentage scored by the first 2 groups combined. If the teacher's score is 6 times the total score of the first group, what is the total score of the class?
def solve() -> int: students = 40 first_group = 15 second_group = 10 third_group = students - first_group - second_group first_group_score = 80 second_group_score = 90 third_group_score = (first_group_score + second_group_score) / 2 teacher_score = 6 * (first_group_score / 100)...
Peter went to a turtle sanctuary and saw 120 turtles. He asked if he could take some to care for, and he was allowed to take 1/4 of them home. Peter managed to catch half of the total number of turtles he was allowed to take home. How many turtles does Peter remain with to catch to get the total number he was allowed t...
def solve() -> int: total_turtles = 120 allowed_turtles = total_turtles // 4 caught_turtles = allowed_turtles // 2 remaining_turtles = allowed_turtles - caught_turtles result = remaining_turtles result return result
A rectangular pool measures 8 feet by 12 feet. If the depth of the pool is 5 feet, what is the volume of the pool in cubic feet?
def solve() -> int: length = 8 width = 12 depth = 5 volume = length * width * depth result = volume return result