question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
amuel and Aarav each drove a different distance on a round trip. Samuel drove 56 miles and Aarav drove 36 miles. How many miles in total did they both drive together?
def solve() -> int: sam = 56 aar = 36 result = sam + aar return result
Student: A container has 500 ml of water in it. Every day 60 ml of water is added. How many days will it take for the container to have 1 liter of water?
def solve() -> int: container_volume = 500 daily_addition = 60 target_volume = 1000 days = (target_volume - container_volume) / daily_addition result = days return result
Student: - Alice had 10 candy bars. She gave 3 to her friend Bob and then ate 2 herself. She decided to share the remaining candy bars equally with her two other friends, Carol and Dan. How many candy bars did each of them get?
def solve() -> int: total_candy = 10 gave_bob = 3 ate_alice = 2 friends = 2 left_alice = total_candy - gave_bob - ate_alice each_friend = left_alice / friends result = each_friend return result
A clothing store has a rack of 80 dresses. One-fourth of the dresses are red and one-sixth of the red dresses have lace. How many red lace dresses are on the rack?
def solve() -> int: total_dresses = 80 red_dresses = total_dresses / 4 red_lace_dresses = red_dresses / 6 result = red_lace_dresses return result
Pete has 50 marbles. He gives Sarah 20 marbles. What percentage of marbles does Pete have left?
def solve() -> int: total_marbles = 50 given_marbles = 20 remaining_marbles = total_marbles - given_marbles percentage_left = remaining_marbles / total_marbles * 100 result = percentage_left return result
There are 40 pencils in a box. Ethan can use 15 pencils and his two siblings can each use 10 pencils. How many boxes of pencils should Ethan order for all of them?
def solve() -> int: pencils_per_box = 40 ethan_pencils = 15 sibling_pencils = 10 total_pencils_needed = ethan_pencils + (2 * sibling_pencils) boxes_needed = total_pencils_needed / pencils_per_box result = boxes_needed return result
Peter bought a box of 56 chocolates. He ate 10 chocolates and gave away 4. The number of truffles was three times the number of peanut clusters plus 5. If Peter picks a chocolate at random, what is the percentage chance it will be a truffle?
def solve() -> int: N_total = 56 N_eaten = 10 N_given = 4 N_PC = (N_total - N_eaten - N_given - 5) / 2 N_T = 3*N_PC + 5 p_T = N_T/(N_total - N_eaten - N_given) result = p_T return result
imon buys 3 books for $12 each and 2 magazines for $5 each. He gets a 10% discount on the books and pays a 5% sales tax on the total amount. How much does Simon pay for his purchases?
def solve() -> int: book_price = 3 * 12 book_discount = book_price * 0.1 book_discounted = book_price - book_discount magazine_price = 2 * 5 total_before_tax = book_discounted + magazine_price tax = total_before_tax * 0.05 total_after_tax = total_before_tax + tax result = total_after_tax...
Student: Laura's mother gave her $50 to buy art supplies. She bought 2 paintbrush sets that cost $8 each and a set of watercolors that cost $22. How much money does Laura have left to buy more art supplies?
def solve() -> int: amount_given = 50 paintbrush_cost = 8 paintbrush_sets = 2 watercolor_cost = 22 total_cost = paintbrush_cost * paintbrush_sets + watercolor_cost result = amount_given - total_cost return result
John has three times as many marbles as Peter. If Peter has 10 marbles, how many marbles does John have?
def solve() -> int: marbles_per_peter = 10 marbles_per_john = marbles_per_peter * 3 result = marbles_per_john return result
Jane walks 2 miles every day for a week. How many miles did she walk in total?
def solve() -> int: walk = 2 days = 7 total_walk = walk * days result = total_walk return result
Robert's horse drinks 5 gallons of water every day. How many gallons of water will it drink in a week?
def solve() -> int: water_per_day = 5 days_per_week = 7 water_per_week = water_per_day * days_per_week result = water_per_week return result
Leah has a collection of 120 stickers. She wants to put them in an album that has 12 pages. Each page can fit 10 stickers. How many stickers will she have left over after filling up the album?
def solve() -> int: stickers_in_album = 12 * 10 stickers_left_over = 120 - stickers_in_album result = stickers_left_over return result
Jake is trimming a circular hedge, the radius of which is 8m. How much length will he need for the trimming to be complete?
def solve() -> int: radius = 8 circumference = 2 * 3.14 * radius result = circumference return result
Eric has 15 books and Tony has 9 books. They decided to exchange one book from each other, how many books do they have altogether?
def solve() -> int: number_of_books_exchanged = 1 eric_books = 15 tony_books = 9 eric_books = eric_books - number_of_books_exchanged tony_books = tony_books + number_of_books_exchanged eric_books = eric_books + number_of_books_exchanged tony_books = tony_books - number_of_book...
**** Ben purchased 5 windows, each window having an area of 10 square metres and each window costing $100. How much money did he pay for the windows?
def solve() -> int: cost_per_window = 100 area_per_window = 10 num_windows = 5 total_cost = cost_per_window * area_per_window * num_windows result = total_cost return result
Mary reads a book every day. It takes her an hour to read 20 pages, but it takes her 25% longer than that to take notes on what she read. If she reads for 3 hours a day, how long does it take her to read books for a month?
def solve() -> int: hours_per_day = 3 pages_per_hour = 20 notes_percentage = 25 notes_per_hour = pages_per_hour * (notes_percentage / 100) total_hours_per_day = hours_per_day + (hours_per_day * notes_percentage / 100) days_per_month = 30 total_hours_per_month = total_hours_per_day ...
Zoe has 11 flowers. She has 3 less than four times as many roses and 2 more than half as many tulips than roses. How many flowers does Zoe have in all?
def solve() -> int: flowers = 11 roses = flowers * 4 - 3 tulips = roses // 2 + 2 total = flowers + roses + tulips result = total return result
A grocery store bought 20 boxes of eggs; each box contains 12 eggs. How many eggs did the store buy in total?
def solve() -> int: num_boxes = 20 num_eggs_per_box = 12 total_num_eggs = num_boxes * num_eggs_per_box result = total_num_eggs return result
Michael is a gardener. Every 6 plants, he gives one away to his friend. Every 7 plants, he loses one to a disease. Every 4 plants, he buys a new set of 2 plants. If Michael starts with 50 plants and gives one away, how many plants does he have after 35 rounds of this game?
def solve() -> int: plants = 50 plants -= 1 for i in range(35): if (i+1) % 6 == 0: plants -= 1 if (i+1) % 7 == 0: plants -= 1 if (i+1) % 4 == 0: plants += 2 result = plants return result
She baked 12 chocolate cupcakes and 8 vanilla cupcakes. She gave 4 chocolate cupcakes and 2 vanilla cupcakes to her friends. Then she ate 2 chocolate cupcakes and 1 vanilla cupcake herself. How many cupcakes did she have left?
def solve() -> int: chocolate_baked = 12 vanilla_baked = 8 chocolate_given = 4 vanilla_given = 2 chocolate_eaten = 2 vanilla_eaten = 1 chocolate_left = chocolate_baked - chocolate_given - chocolate_eaten vanilla_left = vanilla_baked - vanilla_given - vanilla_eaten total_left = chocol...
A cycling triathlon consists of three legs - the first is flat, the second is hilly, and the third is uphill. Three cyclists, Lila, Max, and Ned, are competing in a relay race. Lila finished the first leg in 20 minutes flat, Max finished the second leg in 34 minutes, and Ned finished the third leg in 19 minutes, which ...
def solve() -> int: lila_time = 20 max_time = 34 ned_time = lila_time - 7 total_time = lila_time + max_time + ned_time result = total_time return result
Nadine needs to save $1200 in 6 months. How much should she save each month to reach her goal?
def solve() -> int: goal = 1200 months = 6 savings_each_month = goal / months result = savings_each_month return result
A car rental company has 5 types of rental cars and 4 different insurance options for each car. If a customer wants to rent a car with insurance, how many different options are there?
def solve() -> int: car_types = 5 insurance_options = 4 total_options = car_types * insurance_options result = total_options return result
Student: Lily wants to buy three items that cost $10 each. If she has $35 in her wallet, how much change will she get back after buying these three items?
def solve() -> int: item_cost = 10 num_items = 3 wallet_amount = 35 total_cost = item_cost * num_items change = wallet_amount - total_cost result = change return result
At a grocery store, a gallon of milk costs $3.50 and a dozen eggs cost $2.25. If a customer buys 2 gallons of milk and 4 dozen eggs, how much will they have to pay in total?
def solve() -> int: gallon_milk_cost = 3.50 dozen_eggs_cost = 2.25 num_gallons = 2 num_dozens = 4 total_cost_milk = gallon_milk_cost * num_gallons total_cost_eggs = dozen_eggs_cost * num_dozens total_cost = total_cost_milk + total_cost_eggs result = total_cost return result
Student: Donald needs 17 sheets of paper to complete a project. He has 6 complete packages of paper and each package contains 4 sheets of paper. How many sheets of paper will he need to buy to complete the project?
def solve() -> int: package_num = 6 sheet_num = 4 needed_num = 17 total_num = package_num * sheet_num result = needed_num - total_num return result
Possible additional questions and programs: Maya walks 5 km from her home to the bus stop, takes the bus for 30 minutes, and then runs 2 km to her school. How many kilometers does she cover in total and how long does it take her?
def solve() -> int: walk_distance = 5 walk_speed = 4 bus_time = 30 run_distance = 2 run_speed = 12 walk_time = walk_distance / walk_speed bus_speed = 40 bus_distance = bus_speed * (bus_time / 60) run_time = run_distance / run_speed total_distance = walk_di...
Tony's train ride from Austin to Dallas will take 3 hours and 15 minutes. During the ride, he spent 45 minutes reading a book, 1 hour and 20 minutes listening to music, 30 minutes writing his journal, 40 minutes eating some snacks and 25 minutes talking to a fellow passenger. How many hours does he have left to reach D...
def solve() -> int: total_time = 3*60 + 15 reading_time = 45 music_time = 1*60 + 20 journal_time = 30 snacks_time = 40 talking_time = 25 total_spent_time = reading_time + music_time + journal_time + snacks_time + talking_time remaining_time = total_time - total_spent_time remain...
Find the slope and y-intercept for the line that goes through the points (3,5) and (7,11).
def solve() -> int: x1, y1 = 3, 5 x2, y2 = 7, 11 slope = (y2 - y1) / (x2 - x1) y_intercept = y1 - slope * x1 result = round(slope, 2), round(y_intercept, 2) return result
Student: Dana has 5 1-hour sessions with different clients today. She spends the rest of her 6-hour workday writing reports. If she can write 10 pages an hour, how many pages total does she write today?
def solve() -> int: client_sessions = 5 report_hours = 6 pages_per_hour = 10 total_pages = client_sessions + (report_hours * pages_per_hour) result = total_pages return result
Lance received a check of $300 for his birthday. He spent 2/3 of the money on a game console and 1/5 of the remaining money on tickets to a theme park. How much money did Lance have left?
def solve() -> int: check = 300 two_third = check * 2/3 tickets = two_third * 1/5 remaining = two_third - tickets result = remaining return result
In a park, 40 people were playing frisbee. 10 people decided to have a picnic. Later, 3 more people joined them but then half of them got full and left. 5 more people then went to join the picnic. 7 people finished their meal and left, and then half of the remaining picnickers left the park. How many people were left h...
def solve() -> int: frisbee_players = 40 picnicers = 10 picnicers += 3 picnicers /= 2 picnicers += 5 picnicers -= 7 picnicers /= 2 result = picnicers return result
A rectangular prism has a height of 7 cm, a width of 12 cm and a length of 5 cm. What is the total surface area of the prism?
def solve() -> int: height = 7 width = 12 length = 5 result1 = 2 * (height*width + length*height + width*length) result = result1 return result
A car averages 40 miles per gallon. If the car has a 12-gallon gas tank and starts with a full tank of gas, how far can the car travel before needing to refuel?
def solve() -> int: mpg = 40 gas_tank = 12 distance = mpg * gas_tank result = distance return result
Last weekend, painter Jack mixed 25 gallons of paint and stored it in a can. He then spent the next 4 hours painting at a rate of 5 gallons/hour from the can. For the next 10 hours, Jack added more paint into the can, at a rate of 2 gallons per hour. How many gallons of paint were left in the can?
def solve() -> int: paint_in_can = 25 paint_used = 5 * 4 paint_added = 2 * 10 paint_left = paint_in_can - paint_used + paint_added result = paint_left return result
Linda has 20 fewer than two-thirds as many siblings as Samuel. Ashley has one-fourth as many siblings as Linda and Samuel combined. If Samuel has 30 siblings, how many more siblings does Ashley have than Linda?
def solve() -> int: samuel_siblings = 30 linda_siblings = 2/3 * samuel_siblings - 20 ashley_siblings = 1/4 * (linda_siblings + samuel_siblings) - linda_siblings result = ashley_siblings - linda_siblings return result
A pizza restaurant sells a large pizza for $12.50 and a small pizza for $8.75. If a customer buys 2 large pizzas and 1 small pizza, how much will they pay in dollars?
def solve() -> int: number_of_large_pizzas = 2 number_of_small_pizzas = 1 cost_of_large_pizza = 12.50 cost_of_small_pizza = 8.75 total_cost = (number_of_large_pizzas * cost_of_large_pizza) + (number_of_small_pizzas * cost_of_small_pizza) result = total_cost return result
If it takes Sue 30 minutes to solve 6 math problems and it takes Jane 45 minutes to solve 10 math problems, how many more math problems did Jane solve per minute than Sue?
def solve() -> int: sue_time = 30 sue_problems = 6 jane_time = 45 jane_problems = 10 sue_problems_per_minute = sue_problems / sue_time jane_problems_per_minute = jane_problems / jane_time more_problems_per_minute = jane_problems_per_minute - sue_problems_per_minute re...
A coffee shop has 30 cups of decaf coffee and 70 cups of regular coffee. What is the ratio of decaf coffee to regular coffee?
def solve() -> int: decaf_coffee = 30 regular_coffee = 70 total_coffee = decaf_coffee + regular_coffee decaf_ratio = decaf_coffee / total_coffee regular_ratio = regular_coffee / total_coffee result = decaf_ratio / regular_ratio return result
Student: Mohan wrote 3 essays for a project. He got 15 points for the first essay, 11 points for the second essay, and 9 points for the third essay. How many total points did he get?
def solve() -> int: first_essay_points = 15 second_essay_points = 11 third_essay_points = 9 total_points = first_essay_points + second_essay_points + third_essay_points result = total_points return result
At a bakery, 5/8 of the cupcakes were sold in the morning and the remaining were sold in the evening. If there were a total of 256 cupcakes, how many cupcakes were sold in the morning?
def solve() -> int: total_cupcakes = 256 morning = total_cupcakes * (5/8) result = morning return result
Chika loves painting pictures. She needs 3 different colors of paint to complete her latest masterpiece. She needs 360ml of each color. How much paint is she using in total?
def solve() -> int: colors = 3 amount_per_color = 360 total_paint = colors * amount_per_color result = total_paint return result
Tyler was going to the store, and he wanted to buy 6 apples, 4 oranges and 8 bananas. If he wanted to group the items in boxes and each box can only hold 5 items, how many boxes does Tyler need to buy all the fruit?
def solve() -> int: apples = 6 oranges = 4 bananas = 8 total_items = apples + oranges + bananas num_of_boxes = total_items / 5 result = num_of_boxes return result
A store has a total of 200 hats. If 60% of those hats are baseball caps, how many baseball caps are there?
def solve() -> int: total_hats = 200 baseball_ratio = 0.6 baseball_hats = total_hats * baseball_ratio result = baseball_hats return result
If it takes Tyler 45 minutes to walk 3 miles each day for a week, how many miles did he walk in total?
def solve() -> int: days_in_week = 7 time_taken = 45 distance_per_day = 3 total_distance = distance_per_day * days_in_week total_time = time_taken * days_in_week total_time_hours = total_time / 60 average_speed = total_distance / total_time_hours tota...
An amusement park has 25 glasses. Each glass can hold 6 ounces of water but they are only filled up to 45% of their capacity. How many more ounces of water are required to fill all the glasses to the brim?
def solve() -> int: num_glasses = 25 glass_capacity = 6 fill_percentage = 0.45 total_capacity = num_glasses * glass_capacity filled_capacity = total_capacity * fill_percentage required_capacity = total_capacity - filled_capacity result = required_capacity ...
Jazmin wants to purchase a new camera which costs $800. She earns $11 per hour working at a restaurant for a 40-hour workweek. How many more hours does she need to work to buy the camera?
def solve() -> int: camera_cost = 800 hourly_wage = 11 hours_worked = 40 total_earned = hourly_wage * hours_worked remaining_cost = camera_cost - total_earned hours_needed = remaining_cost / hourly_wage result = hours_needed return result
There are 15 cookies in a jar with an average weight of 15 grams each. If you add 10 more cookies weighing an average of 10 grams each, what is the new average weight of all cookies?
def solve() -> int: total_weight = 15 * 15 + 10 * 10 num_cookies = 15 + 10 avg_weight = total_weight / num_cookies result = avg_weight return result
Student: Joel is 4 times as tall as Steve while Natalie is twice as tall as Joel. If Steve is 72cm tall, what is Natalie's height?
def solve() -> int: steve_height = 72 joel_height = steve_height * 4 natalie_height = joel_height * 2 result = natalie_height return result
A recipe for brownies calls for 2 cups of sugar for 24 brownies. If you want to make 40 brownies, how much sugar do you need?
def solve() -> int: sugar_per_brownie = 2 / 24 num_brownies = 40 sugar_needed = sugar_per_brownie * num_brownies result = sugar_needed return result
John is trying to decide what to eat for breakfast. He has 2 cereal options, 3 fruit options, and 4 milk options. If he chooses to have strawberries, he cannot have blueberries. How many breakfast combinations are there for John to choose from?
def solve() -> int: cereal_options = 2 fruit_options = 3 milk_options = 4 combinations_with_strawberries = cereal_options * (fruit_options - 1) * milk_options combinations_without_strawberries = cereal_options * fruit_options * milk_options total_combinations = combinations_with_s...
Student: In a basket, there are a total of 65 apples and oranges. The ratio of apples to oranges is 3:4. How many oranges are in the basket?
def solve() -> int: total = 65 ratio = 3/4 oranges = 0 fraction = ratio / (1 + ratio) oranges = fraction * total oranges = round(oranges) result = oranges return result
Sam bakes 15 cookies and distributes them equally among 5 children. Each child eats 2 cookies and gives the rest to their parents. How many cookies do the parents get in total?
def solve() -> int: cookies = 15 children = 5 cookies_per_child = 2 cookies_for_child = cookies // children cookies_for_parent = cookies_for_child - cookies_per_child cookies_for_parents = cookies_for_parent * children result = cookies_for_parents return result
ophie purchased 25 apples from the grocery store. She ate 8 apples each day for 4 days. How many apples did Sophie have left after 4 days?
def solve() -> int: number_of_apples_eaten_per_day = 8 total_number_of_days = 4 total_number_of_apples_eaten = number_of_apples_eaten_per_day * total_number_of_days total_number_of_apples_purchased = 25 remaining_apples_after_4th_day = total_number_of_apples_purchased - total_number_of_apples_eaten...
Two students are competing in a quiz. The first student can answer 5 questions in 10 minutes, while the second student can answer 6 questions in 10 minutes. After 30 minutes, the second student takes a bathroom break. For how many minutes could the second student remain absent before the first student catches up with h...
def solve() -> int: first_student_rate = 5/10 second_student_rate = 6/10 second_student_questions_before_break = 6 * 30/10 time_to_catch_up = second_student_questions_before_break / first_student_rate time_remaining = time_to_catch_up - 30 result = time_remaining ...
The perimeter of a rectangle is 28 meters. If one side is twice as long as the other, what are the lengths of each side?
def solve() -> int: perimeter = 28 side1 = perimeter / 6 side2 = side1 * 2 result = (side1, side2) return result
arah has to buy 15 packs of pens with her allowance money. Every pack costs $3. How much money will Sarah have left after she buys the pens?
def solve() -> int: total = 0 for i in range (15): total = total + 3 result = 150 - total return result
A farmer wants to donate 7 apples per tree to two schools. Each school has 20 trees. How many apples will the farmer donate in total?
def solve() -> int: apples_per_tree = 7 trees_per_school = 20 total_schools = 2 total_apples_donated = apples_per_tree * trees_per_school * total_schools result = total_apples_donated return result
Four-sevenths of Emma's pencils are blue. All of the rest are either red or yellow, and there are three times as many red pencils as yellow pencils. If she has 28 pencils, how many of them are yellow?
def solve() -> int: blue = 16 rest = 28 - blue x = 12 / 4 yellow = x result = yellow return result
1. In a city, there are 8 buses each carrying 50 passengers. There are 6 cars each carrying 4 passengers. How many more passengers are carried by the buses than the cars?
def solve() -> int: num_bus_passengers = 8 * 50 num_car_passengers = 6 * 4 result = num_bus_passengers - num_car_passengers return result
Martin is going on a trip and needs to exchange his currency for foreign currency. Martin has $500 and the exchange rate is $1.20 for every 1 unit of foreign currency. How many units of foreign currency can Martin purchase?
def solve() -> int: dollars = 500 exchange_rate = 1.20 foreign_currency = dollars/exchange_rate result = foreign_currency return result
If the 500 employees who were working for the company before the additional 200 people were hired worked 8 hours a day, 5 days a week in August, how much money would they have made in total?
def solve() -> int: number_employees = 500 wage_per_hour = 12 hours_per_day = 8 salary_longer_employees = number_employees * wage_per_hour * hours_per_day * 5 * 4 result = salary_longer_employees return result
Jack is a courier who delivers packages to two different neighborhoods. The first neighborhood is 2 miles away, and the second neighborhood is 8 miles away. If Jack delivers to each neighborhood on a separate day, how many miles will he travel in total?
def solve() -> int: neighborhood1 = 2 neighborhood2 = 8 total_distance = neighborhood1 + neighborhood2 result = total_distance return result
Lisa has 6 stickers. If she receives 4 more stickers per day for 12 days, how many stickers will she have in total?
def solve() -> int: starting_stickers = 6 stickers_per_day = 4 days = 12 total_stickers = starting_stickers + (stickers_per_day * days) result = total_stickers return result
Juan went to the grocery store and bought 3 packs of apples. Each pack of apples cost $6. If he gave the cashier $30, how much change did he receive?
def solve() -> int: number_of_packs = 3 cost_per_pack = 6 total_cost = number_of_packs * cost_per_pack amount_paid = 30 change = amount_paid - total_cost result = change return result
Rachel buys whiteboards for her online class. She gives each student 1 whiteboard. She teaches 5 classes a week and each class has 10 students. If a 12-pack of whiteboards cost $6, how much did she spend on them all?
def solve() -> int: num_classes = 5 num_students = 10 num_whiteboards = num_classes * num_students num_packs = num_whiteboards / 12 cost_per_pack = 6 total_cost = num_packs * cost_per_pack result = total_cost return result
Max has 20 dollars, 35 euros, and 2500 yen. If there are 0.85 dollars per euro and 100 yen per dollar, how much does Max have in yen?
def solve() -> int: dollars = 20 euros = 35 yen = 2500 dollars_to_euros = dollars/0.85 total_euros = euros+dollars_to_euros euros_to_yen = total_euros*2*100 yen_total = euros_to_yen+yen result = yen_total return result
If Tom sold 75 books for $10 each and made $550 from selling notebooks, how much more did he make from books than notebooks?
def solve() -> int: books_sold = 75 book_price = 10 notebook_earning = 550 books_earning = books_sold * book_price difference = books_earning - notebook_earning result = difference return result
andra has 1/3 of an apple pie, and her sister has 1/2 of an apple pie. How much of the apple pie do they have together?
def solve() -> int: pie = 1 sandraPortion = 1/3 sisterPortion = 1/2 totalPortion = sandraPortion + sisterPortion result = totalPortion * pie return result
A bag of candy has 15 pieces in it. John ate 8 pieces of candy and Bob ate 6 pieces of candy. How many pieces of candy are still left in the bag?
def solve() -> int: num_candy = 15 john = 8 bob = 6 num_candy -= john num_candy -= bob result = num_candy return result
Mia is making bracelets. She has 240 beads in different colors. She uses 12 beads to make one bracelet. She has already made 15 bracelets. How many more bracelets can she make with the remaining beads?
def solve() -> int: used_beads = 15 * 12 left_beads = 240 - used_beads possible_bracelets = left_beads // 12 result = possible_bracelets return result
If a company has a total budget of $750,000 to pay its employees, and there are 50 employees in total, what is the average salary of each employee for the year? Emily wants to buy a new dress that costs $120. She has been saving up her money each week for the past two months. She gets a $10 allowance a week. She also b...
def solve() -> int: total_budget = 750000 total_employees = 50 average_salary = total_budget / total_employees dress_cost = 120 allowance_per_week = 10 babysitting_rate = 20 change = 40 babysitting_hours = 5 total_savings = (dress_cost + change) + (babysitting_rate * babysi...
A carpenter can build a bookshelf in 3 hours or build a table in 5 hours. If they want to build 2 bookshelves and 3 tables, how long would it take them?
def solve() -> int: bookshelf_time = 3 table_time = 5 num_bookshelves = 2 num_tables = 3 total_time = (bookshelf_time*num_bookshelves) + (table_time*num_tables) result = total_time return result
- Bob had 300 candy bars in his store. He then sold 40% of them and bought 50 more candy bars. If he gave away 1/6 of the remaining candy bars to his friends, calculate the total number of candy bars left in his store.
def solve() -> int: initial_candy = 300 candy_after_sell = initial_candy * 0.6 candy_after_buy = candy_after_sell + 50 candy_after_give = candy_after_buy * 0.8333 result = round(candy_after_give) return result
Student: A college charges $200 per credit hour. If a student takes 15 credits in the fall and 12 credits in the spring, what is their total cost for the year including a $100 technology fee each semester?
def solve() -> int: credit_hour_cost = 200 fall_credits = 15 spring_credits = 12 tech_fee = 100 fall_cost = credit_hour_cost * fall_credits + tech_fee spring_cost = credit_hour_cost * spring_credits + tech_fee total_cost = fall_cost + spring_cost result = total_cost return resul...
On his first turn, Allyn hit the ball 140 yards straight towards the hole. On his second turn, he hit the ball additionally 110 yards but landed 30 yards before the hole. On his third swing, he hit the ball straight towards the hole and it traveled as far as his first hit. What is the distance, in yards, from the start...
def solve() -> int: distance1 = 140 distance2 = distance1 + 110 distance3 = distance1 total_distance = distance1 + distance2 + distance3 result = total_distance return result
Maria needs to buy a new bike and needs to save up $240 before she has enough. She starts doing yard work for her neighbors. She normally makes $20 for 4 hours of work. Her neighbors agree to pay her $5 for every extra hour of work. If she works 6 hours a day for 2 weeks, how much does she earn?
def solve() -> int: hours_per_day = 6 total_days = 14 total_hours = hours_per_day * total_days base_pay_rate = 20/4 extra_pay_rate = 5 num_extra_hours = total_hours - (4 * total_days) total_earned = (base_pay_rate * total_days * 4) + (extra_pay_rate * num_extra_hours) result = total_earn...
A pizza shop sells a large pizza for $15 and a medium pizza for $10. When Bob ordered 3 large pizzas and 2 medium pizzas, he got a 20% discount on the cheapest pizza. How much did Bob pay in all?
def solve() -> int: large = 15 medium = 10 large_pizzas = 3 medium_pizzas = 2 discount = 0.2 total = large * large_pizzas + medium * medium_pizzas savings = medium * discount final = total - savings result = final return result
A number is increased by 60% of itself. What is the resultant number?
def solve() -> int: number = 5 increased_number = number * (1 + 0.6) result = increased_number return result
A party store sells 12 packs of soda for $5.99 and 24 packs for $10.99. If John buys 1 twelve-pack and 2 twenty-four packs, how much will he spend?
def solve() -> int: pack1 = 5.99 pack2 = 10.99 total_pack1 = pack1 * 1 total_pack2 = pack2 * 2 total_spent = total_pack1 + total_pack2 result = total_spent return result
Mr. Kim has 6 buckets of paint that each contain 2 gallons and 7 brushes that each cost $3. He needs to paint 3 walls that each have an area of 120 square feet and use 1 brush per wall. Each gallon of paint can cover 40 square feet. How much money does he spend on brushes and how many gallons of paint does he have left...
def solve() -> int: buckets = 6 paint_per_bucket = 2 brushes = 7 brush_cost = 3 walls = 3 wall_area = 120 brush_per_wall = 1 paint_per_square_foot = 1 / 40 total_paint = buckets * paint_per_bucket brush_cost_total = walls * brush_per_wall * brush_cost paint_needed =...
A train travels a distance of 320 miles in 4 hours. What is the average speed of the train in miles per hour?
def solve() -> int: speed = 320 / 4 result = speed return result
A recipe for pancakes requires 1 egg per 4 pancakes. If you want to make 20 pancakes, how many eggs do you need?
def solve() -> int: pancakes_required = 20 eggs_per_pancake = 0.25 total_eggs = pancakes_required * eggs_per_pancake result = total_eggs return result
In a sports bag, there are 6 tennis balls, 4 baseballs, 2 soccer balls, 3 frisbees, and a pump. One tennis ball is $1. A baseball is $2. A soccer ball is $10. A frisbee is $3, and the pump is $5. What is the total cost of the sports bag?
def solve() -> int: tennis_balls = 6 baseballs = 4 soccer_balls = 2 frisbees = 3 pump = 1 tennis_ball_cost = 1 baseball_cost = 2 soccer_ball_cost = 10 frisbee_cost = 3 pump_cost = 5 total_cost = (tennis_balls * tennis_ball_cost) + (baseballs * baseball_cost) + (socc...
Ben collected 64 stamps from different countries. He gave 12 stamps to his friend and traded 8 more stamps than he gave to his friend for some rare coins. He put the rest in his album. How many stamps did Ben put in his album?
def solve() -> int: total_stamps = 64 stamps_given = 12 stamps_traded = stamps_given + 8 stamps_left = total_stamps - stamps_given - stamps_traded result = stamps_left return result
Student: Mia goes to the bakery. She has $20. She needs to buy 5 items: a cake, a pie, a muffin, a croissant, and a cookie. She finds a cake for $8, a pie for $7, a muffin for 10% off $3, a croissant for 20% off $4, and a cookie for $1. How many dollars does she have left after buying these items?
def solve() -> int: money = 20 cake = 8 pie = 7 muffin = 3 croissant = 4 cookie = 1 total_cost = cake + pie + muffin * 0.9 + croissant * 0.8 + cookie result = money - total_cost return result
The ticket price to a fair is $15 for adults and $10 for children. If a family of 4 adults and 2 children attends the fair, how much will they pay in total?
def solve() -> int: adult_price = 15 child_price = 10 adults = 4 children = 2 total_price = adult_price * adults + child_price * children result = total_price return result
Student: A business added a 9% sales tax to a product that originally cost $80. If the total cost including tax was $87.20, what was the sales tax?
def solve() -> int: original_cost = 80 total_cost = 87.20 sales_tax = total_cost - original_cost percentage_sales_tax = sales_tax / original_cost * 100 result = percentage_sales_tax return result
Olivia started a business when she turned 25. It took her 3 years to become profitable. Then it took her 10% longer to become a CEO than it did to become profitable. She worked as a CEO for 9 years before retiring. How old was she when she retired?
def solve() -> int: age = 25 years_to_profitable = 3 years_to_ceo = years_to_profitable * 1.1 years_as_ceo = 9 age += years_to_profitable age += years_to_ceo age += years_as_ceo result = age return result
Rachel collects crystal figurines from a local flea market. They each cost $5.00, but the price has gone up to $8.75 each. She had planned to buy 25 figurines, how many figurines can she buy now?
def solve() -> int: original_price = 5.00 new_price = 8.75 planned_quantity = 25 affordable_quantity = int((planned_quantity * original_price) / new_price) result = affordable_quantity return result
Samantha is packing 25 items into a suitcase. She puts 5 shirts, 10 pairs of socks, and the rest are pants. What is the difference in percentage points between the percentage of items that are socks and the percentage that are pants?
def solve() -> int: shirts = 5 socks = 10 total_items = 25 pants = total_items - shirts - socks percentage_socks = (socks / total_items) * 100 percentage_pants = (pants / total_items) * 100 difference = abs(percentage_socks - percentage_pants) result = round(differenc...
The shoe store sells pairs of socks in packs of 3. They charge $15 for 4 packs. Lily buys 6 packs, Dylan buys 3 packs, and Adam buys 36 individual socks. How many socks have they purchased in total, assuming 2 socks are 1 pair?
def solve() -> int: packs_per_socks = 3 price_per_packs = 15 packs_for_price = 4 lily_packs = 6 dylan_packs = 3 adam_socks = 36 lily_socks = lily_packs * packs_per_socks dylan_socks = dylan_packs * packs_per_socks adam_pairs = adam_socks / 2 total_socks = lily_sock...
During a science experiment, Jamie was given a 2-liter container of hydrochloric acid. While he was moving it, he tripped. If 100mL of the acid spilled, and 4 times as much evaporated due to the spill, how much acid was left in the container?
def solve() -> int: acid_container = 2 spilled_acid = 100 evaporated_acid = 4 * spilled_acid remaining_acid = acid_container * 1000 - spilled_acid - evaporated_acid result = remaining_acid / 1000 return result
Student: Natasha needs to buy plaster for her house walls. Each bag of plaster covers an area of 3.6m2 and each wall is 8m in length and 2.5m high. How many bags will Natasha need to buy?
def solve() -> int: length_wall = 8 height_wall = 2.5 area_wall = length_wall * height_wall area_covered_per_bag = 3.6 num_bags_needed = area_wall / area_covered_per_bag result = num_bags_needed return result
Student: - Bob wanted to buy a new laptop. The laptop he liked was priced at $800, but it had a 10% discount for students. Bob also had to pay a 5% sales tax on the discounted price. How much did he end up spending on the laptop?
def solve() -> int: price = 800 discount = 0.1 tax = 0.05 discounted_price = price * (1 - discount) total_price = discounted_price * (1 + tax) result = total_price return result
Zoe's twelve-legged spider has three more eyes than legs, and two times as many webs as eyes. How many fewer legs does the spider have than the total number of webs and eyes?
def solve() -> int: legs = 12 eyes = legs + 3 webs = eyes * 2 difference = legs - (webs + eyes) result = difference return result
Julia and Emma decided to buy a cake for their friend's birthday. They bought a cake for $30. If Julia paid $5 more than Emma, how much did each of them pay?
def solve() -> int: total_cost = 30 julia_share = total_cost / 2 + 2.5 emma_share = total_cost / 2 - 2.5 result = julia_share, emma_share return result
Jefferson has 38 coins and Dave has 3 coins more than Jefferson. If 4 times the sum of Jefferson and Dave's coins is equal to the total number of coins that Darian has, how many coins does Darian have?
def solve() -> int: coins_Jefferson = 38 coins_Dave = coins_Jefferson + 3 coins_Jefferson_Dave = coins_Jefferson + coins_Dave coins_Darian = 4 * coins_Jefferson_Dave result = coins_Darian return result
Sarah is cataloging her book collection. She has 200 fiction books, 100 non-fiction books, and some poetry books. If the poetry books make up 5% of her collection, how many are poetry books?
def solve() -> int: fiction_books = 200 non_fiction_books = 100 total_books = fiction_books + non_fiction_books poetry_books_percentage = 5 poetry_books = (poetry_books_percentage / 100) * total_books result = poetry_books return result