question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Oliver can swim 1 mile in 20 minutes by himself, but with his coach, it takes him 25 minutes to swim the same distance. How much longer would it take Oliver and his coach to swim 2 miles compared to Oliver swimming alone?
def solve() -> int: oliver_swim_time = 20 oliver_and_coach_swim_time = 25 oliver_swim_distance = 1 oliver_and_coach_swim_distance = 2 oliver_swim_speed = oliver_swim_distance / oliver_swim_time oliver_and_coach_swim_speed = oliver_and_coach_swim_distance / oliver_and_coach_swim_time ...
Leo swimmed for 30 minutes and then rested for 15 minutes. He then swimmed for another 45 minutes and then went to the locker room. He swimmed at a constant speed of 2 meters per second. How many meters has Leo swimmed in total?
def solve() -> int: swimming_time_1 = 30 resting_time = 15 swimming_time_2 = 45 speed = 2 total_swimming_distance = 0 swimming_time_1 = swimming_time_1 * 60 swimming_time_2 = swimming_time_2 * 60 total_swimming_distance = swimming_time_1 * speed + swimming_time_2 * speed ...
QUESTION 1: Tom and Alice went to the movies. They bought two tickets for $12.50 each, a large popcorn for $8.00, and two drinks for $4.00 each. If they paid with a $50 bill, how much change did they get back?
def solve() -> int: total_cost = 2 * 12.50 + 8.00 + 2 * 4.00 change = 50.00 - total_cost result = change return result
Marian is making a cake. It takes her 15 seconds to mix the cake batter and 10 seconds to ice it. How long will it take her to mix and ice a total of 6 cakes?
def solve() -> int: mix_time = 15 * 6 ice_time = 10 * 6 result = mix_time + ice_time return result
Emily is a dressmaker. She can make 3 dresses with 10 yards of fabric. Emily sells each dress for $200. If Emily spent $80 on the fabric, how much profit did she make?
def solve() -> int: dresses_per_yard = 0.3 dress_price = 200 cost = 80 dresses = int(dresses_per_yard * 10) revenue = dresses * dress_price profit = revenue - cost result = profit return result
Andrew and his family harvested 50 apples from their farm. They made 2 apple pies, each requiring 8 apples. How many apples were left?
def solve() -> int: apples_harvested = 50 apples_per_pie = 8 pies_made = 2 total_apples_used = apples_per_pie * pies_made apples_left = apples_harvested - total_apples_used result = apples_left return result
Student: In a classroom, 5/8 of the students are girls. If there are 24 boys, how many students are in the classroom?
def solve() -> int: girls = 5/8 boys = 1 - girls num_boys = 24 num_students = None num_students = num_boys / boys result = num_students return result
A charity organization sells tickets of six different types for a fund-raising event. The first type of ticket costs $5, the second type costs $15, the third type costs $25, the fourth type costs $50, the fifth type costs $100 and the sixth type costs $500. If they sell 200 tickets, with each type being sold equally, h...
def solve() -> int: ticket1_cost = 5 ticket2_cost = 15 ticket3_cost = 25 ticket4_cost = 50 ticket5_cost = 100 ticket6_cost = 500 total_tickets = 200 tickets_per_type = total_tickets/6 total_raised = (ticket1_cost*tickets_per_type) + (ticket2_cost*tickets_per_type) + (ticket3_cost*tic...
A seller bought 4 pieces of jewelry at the cost of $35 each and sold 3 of them at a profit of $5 each. How much money did the seller make in total?
def solve() -> int: total_jewelery = 4 cost_jewelery = total_jewelery * 35 jewelery_sold = 3 profit_jewelery = jewelery_sold * 5 totalprofit = profit_jewelery - cost_jewelery result = totalprofit return result
Student: Rob is saving up to buy a video game console that costs $380. Each time he gets $10, he adds it to his savings. If Rob already has $275 saved up, how many times will he have to get another $10 to reach his goal?
def solve() -> int: console_cost = 380 rob_savings = 275 rob_add = 10 difference = console_cost - rob_savings times = difference // rob_add result = times return result
A small coffee shop sells coffee for $2.00 per cup and muffins for $1.50 each. If 10 people bought coffee and muffins, and the coffee shop earned $27.50 in total, how many muffins were sold?
def solve() -> int: total_people = 10 total_sales = 27.50 coffee_sales = total_people*2.00 muffin_sales = total_sales - coffee_sales muffin_sold = muffin_sales/1.50 result = muffin_sold return result
A grocery store has 250 apples in stock. If they sell 20% of the apples, how many apples are left in the store? Blake takes a 15 minutes break in between walking from his house to the park. If it takes him 1 hour to walk from his house to the park, how long does it take him to walk the entire distance including the bre...
def solve() -> int: apples_in_stock = 250 apples_sold = apples_in_stock * 0.2 apples_left = apples_in_stock - apples_sold time_to_walk = 1 break_time = 15 / 60 total_time = time_to_walk + break_time result = apples_left, total_time return result
During a snowstorm, Mr. Lee ordered pizza from Pizza Hut. He bought four large pizzas at $13.99 each and two garlic breadsticks at $4.99 per order. The tax rate is 7%, and Mr. Lee left a tip of 18%. What is the total amount he needs to pay to the delivery man?
def solve() -> int: pizza_price = 13.99 num_of_pizzas = 4 pizzas_cost = pizza_price * num_of_pizzas garlic_bread_cost = 4.99 * 2 subtotal = pizzas_cost + garlic_bread_cost tax_rate = 0.07 tax = subtotal * tax_rate tip_rate = 0.18 tip = (subtotal + tax) * tip_rate total_cost...
Student: A family has a monthly budget of $1500. They spend $400 on rent, $250 on groceries, and $120 on utilities. What percentage of their budget is left?
def solve() -> int: budget = 1500 rent = 400 groceries = 250 utilities = 120 expenses = rent + groceries + utilities left = budget - expenses percentage = (left / budget) * 100 result = percentage return result
A family of four goes out to eat. Each person in the family orders a meal for $7. The total bill comes to $59, plus tax of 8%. How much did the family pay in total?
def solve() -> int: num_people = 4 cost_per_person = 7 total_bill = 59 tax = 0.08 total_with_tax = (1+tax)*total_bill total_to_pay = total_with_tax + (4 * cost_per_person) result = "The total the family paid was ${}".format(total_to_pay) return result
Cindy buys a dozen eggs every week. If each dozen costs $2.50, how much does she spend on eggs in a year?
def solve() -> int: dozen_eggs_cost = 2.50 eggs_per_dozen = 12 weeks_per_year = 52 eggs_per_year = eggs_per_dozen * weeks_per_year total_cost = dozen_eggs_cost * (eggs_per_year / eggs_per_dozen) result = total_cost return result
Ethan has been playing basketball for the past 10 years. He plays 2 games every week. How many games has Ethan played since he started playing basketball?
def solve() -> int: years_playing = 10 games_per_week = 2 total_games_played = years_playing * 52 * games_per_week result = total_games_played return result
If John works 7 hours a day every day from the 4th to the 9th, including the 4th, but not including the 9th, how many hours will he work?
def solve() -> int: start_day = 4 end_day = 9 days_worked = end_day - start_day hours_per_day = 7 total_hours_worked = days_worked * hours_per_day result = total_hours_worked return result
2. Cindy's brother ate all but 7 of the chocolate cookies their mother had made for the family. If each cookie was cut into 4 pieces, how many pieces were left?
def solve() -> int: num_cookies = 7 num_pieces = num_cookies * 4 num_left = num_pieces - (num_cookies * 4) result = num_left return result
Mike recently bought a land worth $7,000 and spent an additional $1,500 to obtain extra land. He initially had 600 square meters of land, and the cost of each square meter was $10. How much more land has he secured now?
def solve() -> int: initial_land = 600 cost_per_square_meter = 10 total_cost = 7000 + 1500 total_area = total_cost / cost_per_square_meter initial_area = initial_land extra_land = total_area - initial_area result = extra_land return result
Student: Iris sells handmade candles for $12.00 each. She makes 50 candles per month and pays $5.00 for each candle jar and $3.00 for each candle wick. She also pays a monthly fee of $50.00 for her online store. How much money does Iris make per month?
def solve() -> int: candles_sold = 50 candle_price = 12.00 jar_cost = 5.00 wick_cost = 3.00 monthly_fee = 50.00 total_material_cost = (jar_cost + wick_cost) * candles_sold total_revenue = candle_price * candles_sold total_profit = total_revenue - total_material_cost - monthly_fee res...
Sophia is organizing her stickers. She has 75 stickers to start with. She then trades 27 of them with her friend, and then receives 12 more from a different friend. If she has 60 stickers left, how many did she give away?
def solve() -> int: stickers_start = 75 stickers_traded = 27 stickers_received = 12 stickers_left = 60 stickers_given_away = stickers_start - stickers_left + stickers_traded - stickers_received result = stickers_given_away return result
Possible new questions and programs are: Leo collects stamps and keeps them in albums. Each album has 16 pages and each page can fit 8 stamps. Leo has 5 albums full of stamps and wants to buy more stamps from a website that sells them for $0.25 each. He has a budget of $40 and wants to fill up as many albums as possibl...
def solve() -> int: stamps = 5 * 16 * 8 budget = 40 cost = 0.25 stamps_to_buy = int(budget / cost) total_stamps = stamps + stamps_to_buy stamps_per_album = 16 * 8 albums = int(total_stamps / stamps_per_album) result = (stamps_to_buy, albums) return result
Student: Brian has a job that pays $12 per hour for the first 40 hours and $18 per hour for any hours over 40. If Brian works 45 hours, how much money will he make?
def solve() -> int: hourly_rate = 12 overtime_rate = 18 regular_hours = 40 overtime_hours = 45 - 40 total_hours = 45 regular_pay = hourly_rate * regular_hours overtime_pay = overtime_rate * overtime_hours total_pay = regular_pay + overtime_pay result = total_pay return r...
Peter was filling his fish tank with rocks. He bought 15 bags of rocks at the pet store. His brother, Jack, came over and gave him 25 bags of rocks he found outside. His neighbor brought over half the number of bags that Jack brought. Later, his mom brought him 10 more than triple the number of bags he originally bough...
def solve() -> int: bags_bought = 15 bags_found = 25 bags_neighbor = bags_found / 2 bags_mom = 10 + (3 * bags_bought) total_bags = bags_bought + bags_found + bags_neighbor + bags_mom result = total_bags return result
Q3: Alex is planning to drive a total of 1024 miles. If he drives for 6 hours a day at a constant speed of 68 miles per hour, how many days will it take him to finish the trip?
def solve() -> int: distance = 1024 speed = 68 hours_per_day = 6 miles_per_day = speed * hours_per_day days = distance / miles_per_day result = days return result
Jack has a rectangular aquarium that measures 6ft by 4ft by 2ft. He wants to fill the aquarium completely with water. How many gallons of water does he need?
def solve() -> int: length = 6 width = 4 height = 2 volume = length * width * height cubic_feet_to_gallons = 7.48052 water_volume = volume * cubic_feet_to_gallons result = water_volume return result
In a restaurant, 25% of the customers ordered pizza and there were 80 orders in total. How many customers ordered pizza?
def solve() -> int: percent_pizza = 25 total_orders = 80 customers_pizza = (percent_pizza / 100) * total_orders result = customers_pizza return result
A storage container has dimensions 10 feet by 12 feet by 8 feet. What is the surface area of the container in square feet?
def solve() -> int: containerLength = 10 containerWidth = 12 containerHeight = 8 containerSA = 2 * (containerLength * containerWidth + containerWidth * containerHeight + containerLength * containerHeight) result = containerSA return result
A soccer team plays 32 games in a season. If they win 60% of their games, how many games do they win?
def solve() -> int: total_games = 32 win_percentage = 0.6 total_wins = total_games * win_percentage result = total_wins return result
A book has 368 pages. On the first day, you read 13 pages and on the second day, you read 28 pages. How many pages are left to be read?
def solve() -> int: total_pages = 368 pages_read_day1 = 13 pages_read_day2 = 28 pages_left = total_pages - pages_read_day1 - pages_read_day2 result = pages_left return result
There are 45 students in Jones' class. If two fifths of them are boys, how many boys are there?
def solve() -> int: total_students = 45 boys_fraction = 2 / 5 boys = total_students * boys_fraction result = boys return result
Tina and her coworkers play a game where they draw cards from a deck of 52 cards. In each round, all 6 players, including Tina, draw one card. They play for 10 rounds before Tina's boss goes first in the 11th round. She draws a card, causing the game almost to end. Next, Tina draws another card, ending the game. How ma...
def solve() -> int: deck = 52 players = 6 rounds_played = 10 cards_drawn = players * rounds_played cards_remaining = deck - cards_drawn - 1 cards_remaining -= 1 result = cards_remaining return result
A recipe calls for 1 1/2 cups of flour. If you only have a 1/4 measuring cup, how many times do you need to fill it to get the correct amount of flour?
def solve() -> int: recipe_call_flour = 1.5 measuring_cup = 1/4 fill_count = recipe_call_flour / measuring_cup result = f'You need to fill the 1/4 measuring cup {fill_count} times.' result = fill_count return result
If there are 15 flowers in a garden and Tom picks 4 flowers, how many flowers are left?
def solve() -> int: num_flowers = 15 picks = 4 flowers_left = num_flowers - picks result = flowers_left return result
A parallelogram has opposite angles that are equal. If one of the angles is 50 degrees, what is the measure of the other three angles combined?
def solve() -> int: angle1 = 50 angle2 = angle1 angle3 = angle1 angle4 = angle1 sum_of_angles = angle1 + angle2 + angle3 + angle4 result = sum_of_angles return result
Michael has $180. He needs to buy some toys that cost $7 each and some board games that cost $15 each. After buying the toys and games, he has $75 left. How many toys did he buy?
def solve() -> int: toys_cost = 7 games_cost = 15 total_money = 180 remaining_money = 75 total_toys = (total_money - remaining_money) // toys_cost result = total_toys return result
Emily needs to take 1 pill a day. One pill costs $3.75. The insurance covers 15% of the cost. How much does she pay in a 90-day period?
def solve() -> int: pill_cost = 3.75 insurance_coverage = 0.15 days = 90 total_cost = pill_cost * days insurance_payment = total_cost * insurance_coverage out_of_pocket_payment = total_cost - insurance_payment result = out_of_pocket_payment return result
A bookshelf has 4 rows with 10 books in each row. How many books are on the shelf?
def solve() -> int: books_per_row = 10 number_of_rows = 4 total_books = books_per_row * number_of_rows result = total_books return result
Student: In a clothing store, there were 80 customers in total. The first 20 customers bought 3 shirts each. The next 30 customers bought 2 shirts each. The remaining customers bought only 1 shirt each. If each shirt costs $20, how much did the store earn?
def solve() -> int: num_customers_1 = 20 num_customers_2 = 30 num_customers_3 = 80 - num_customers_1 - num_customers_2 num_shirts_1 = 3 num_shirts_2 = 2 num_shirts_3 = 1 price_per_shirt = 20 total_shirts_sold = num_customers_1 * num_shirts_1 + num_customers_2 * num_shirts_2 + num_custome...
A group of local artists organize art exhibitions every week. If there are 12 artists who take turns displaying their artwork, how many times a year does each artist get to display their artwork?
def solve() -> int: artists_per_week = 12 weeks_per_year = 52 times_per_year = artists_per_week * weeks_per_year result = times_per_year return result
A juice shop has a barrel of 200 liters filled with orange juice that they use to fill bottles of 2 liters each. How many bottles can they fill?
def solve() -> int: total_juice = 200 juice_per_bottle = 2 num_bottles = total_juice / juice_per_bottle result = num_bottles return result
Student: Becky had 120 stickers of different shapes. Half of the stickers were stars and the rest were circles. She gave away one-fourth of the stars to her friends and kept the rest. She then cut the circles into halves and gave one half to her brother. How many stickers did Becky have left?
def solve() -> int: stickers = 120 stars = stickers // 2 circles = stickers - stars stars_given_away = stars // 4 stars_left = stars - stars_given_away circles_given_away = circles // 2 result = stars_left + circles_given_away return result
A bike rental company charges $5 for the first hour and $2 for each additional hour. If John rented a bike for 3 hours, how much did he pay?
def solve() -> int: first_hour_cost = 5 additional_hour_cost = 2 rental_hours = 3 total_cost = first_hour_cost + (additional_hour_cost * (rental_hours - 1)) result = total_cost return result
The sum of three consecutive natural numbers is 72. What are the numbers?
def solve() -> int: sum_3_consecutive = 72 second = (sum_3_consecutive + 3) / 3 first = second - 1 third = second + 1 result = (int(first), int(second), int(third)) return result
A pool is being drained. It takes 8 hours to drain the pool using one drain, and 12 hours to drain the pool using a second drain. If both drains are used, how long will it take to drain the pool?
def solve() -> int: time1 = 8 time2 = 12 one_hour_fraction = 1/time1 + 1/time2 time_to_drain = 1/one_hour_fraction result = time_to_drain return result
Isabella has 30 stickers. She gives away 3 stickers each to her classmates until she only has 9 stickers left. How many classmates does Isabella have?
def solve() -> int: stickers = 30 given_away = 3 left = 9 classmates = (stickers - left) / given_away result = classmates return result
A rectangle has a length of 12 cm and a width of 6 cm. What's the perimeter of the rectangle?
def solve() -> int: length = 12 width = 6 perimeter = 2 * (length + width) result = perimeter return result
On a football team, there are 20 players, and the ratio of forwards to defenders is 2:3. How many forwards are on the team?
def solve() -> int: total_players = 20 forward_ratio = 2/5 num_forwards = total_players * forward_ratio result = num_forwards return result
Ricky can paint a fence in 3 hours and Jay can paint the same fence in 4 hours. How many hours would it take for both of them to finish painting the fence if they work together?
def solve() -> int: total_time = 0 Ricky_time = 3 Jay_time = 4 while Ricky_time > 0 and Jay_time > 0: Ricky_time = Ricky_time - 1 Jay_time = Jay_time - 1 total_time = total_time + 1 result = total_time return result
A company sold 500 units of a product at $15 each. If the cost to produce one unit is $10, what is the profit?
def solve() -> int: units_sold = 500 selling_price = 15 cost_per_unit = 10 revenue = units_sold * selling_price cost = units_sold * cost_per_unit profit = revenue - cost result = profit return result
Jimmy has five apples and his brother Tom gave him nine more. How many apples does he now have?
def solve() -> int: jimmy_apples = 5 tom_apples = 9 result = jimmy_apples + tom_apples return result
Jane deposits $2500 in a savings account that earns 1.5% annual interest, compounded monthly. If she does not withdraw or deposit any further funds, what will the balance be in 10 years?
def solve() -> int: P = 2500 r = 0.015 n = 12 t = 10 balance = P * (1 + r/n)**(n*t) result = balance return result
Student: Edwin was 32 years old when Monica was 7 years old. How old will Edwin be when Monica turns 20?
def solve() -> int: edwin_age_7 = 32 monica_age_now = 20 edwin_age_20 = edwin_age_7 + (monica_age_now - 7) result = edwin_age_20 return result
Billy has 55 stickers. He gave 15 stickers to his friend Tom. Billy then bought 20 more stickers. Tom gave half of his stickers to Billy. How many stickers does Billy have now?
def solve() -> int: billy = 55 tom = 0 billy_gave = 15 billy_bought = 20 tom_gave = (tom + billy_gave) / 2 billy = billy - billy_gave + billy_bought + tom_gave result = billy return result
There are 32 students in a classroom, and the teacher wants to evenly distribute 8 pieces of candy among all the students. How many pieces of candy does each student get?
def solve() -> int: num_students = 32 candy_total = 8 candy_per_student = candy_total/num_students result = 0.25 return result
A car rental company charges $50 per day to rent a car, plus an additional mileage fee of 30 cents per mile, and a one-time insurance fee of $15. If John rents a car for 4 days and drives a total of 200 miles, how much will he have to pay?
def solve() -> int: rental_rate_per_day = 50 miles_driven = 200 mileage_fee = 0.3 insurance_fee = 15 rental_days = 4 total_rental_cost = (rental_rate_per_day * rental_days) + (miles_driven * mileage_fee) + insurance_fee result = total_rental_cost return result
**** Lucy ordered 15 items from an online store. If the total cost of the items before taxes and shipping is $420, what is the cost of each item without taxes and shipping?
def solve() -> int: total_amount = 420 num_items = 15 result = total_amount / num_items return result
The price of a shirt was $20 but it was discounted by 25%. What is the new price of the shirt in dollars?
def solve() -> int: original_price = 20 discount = 0.25 discounted_price = original_price - (original_price * discount) result = discounted_price return result
During a safari, Sarah saw 90 zebras, 20 giraffes, and 40 lions. She also observed six times more impalas than lions, a third of the number of elephants compared to zebras, and half the number of cheetahs as the total number of giraffes and lions. What is the total number of animals Sarah saw during the safari?
def solve() -> int: zebras = 90 giraffes = 20 lions = 40 impalas = 6 * lions elephants = zebras / 3 cheetahs = (giraffes + lions) / 2 total_animals = zebras + giraffes + lions + impalas + elephants + cheetahs result = total_animals return result
Noah has a bag of candy that weighs 800 grams. He eats 20 grams of candy every day and his sister gives him 10 grams of candy every two days. How many days will it take for the bag to be empty?
def solve() -> int: bag = 800 eat = 20 give = 10 days = 0 while bag > 0: days += 1 bag -= eat if days % 2 == 0: bag += give result = days return result
A computer can process 300 bytes of data per second. If a file is 1200 kilobytes, how many seconds will it take the computer to process the file?
def solve() -> int: bytes_per_second = 300 file_size_in_bytes = 1200 * 1024 time_to_process_file = file_size_in_bytes / bytes_per_second result = time_to_process_file return result
Sophia and Isabelle played a tennis match where points were awarded for winning a set. If Sophia won 7 sets and Isabelle won 3/4 as many sets as Sophia, how many sets was Isabelle required to win to have a chance of tying the match?
def solve() -> int: sophia_sets = 7 isabelle_sets = sophia_sets * 3/4 total_sets = sophia_sets + isabelle_sets sets_to_tie = total_sets/2 - sophia_sets result = sets_to_tie return result
Penelope has 250 stickers. She split them between her two friends, Emily and Ava. Emily received 1/3 of Penelope's stickers, and Ava took 2/5 of what was left. How many stickers did Ava get?
def solve() -> int: stickers = 250 emily_stickers = stickers * (1/3) left_stickers = stickers - emily_stickers ava_stickers = left_stickers * (2/5) result = ava_stickers return result
Q1: Max has 3 books with different dimensions. The first book is 9 inches tall and 11 inches wide; the second book is 8 inches wide and 4 inches tall; the third book is 5 inches tall and 3 inches wide. What is the total area of the books combined?
def solve() -> int: height1 = 9 width1 = 11 height2 = 4 width2 = 8 height3 = 5 width3 = 3 area1 = height1 * width1 area2 = height2 * width2 area3 = height3 * width3 result = area1 + area2 + area3 return result
ome possible questions and programs are: Kayla wants to buy 4 pairs of earrings and 3 bracelets from a jewelry store. Each pair of earrings costs $12 and each bracelet costs $8. She paid with a $100 bill and received $10 bills for her change. How many bills did she receive?
def solve() -> int: total_cost = 4 * 12 + 3 * 8 change = 100 - total_cost number_of_bills = change // 10 result = number_of_bills return result
Lily is planting flowers in her garden. She has 5 packets of seeds, each containing 24 seeds. She wants to plant 3 rows of flowers, with 12 flowers in each row. She also wants to save 10% of the seeds for next year. How many seeds will she have left after planting?
def solve() -> int: total_seeds = 5 * 24 seeds_to_save = total_seeds * 0.1 seeds_to_plant = total_seeds - seeds_to_save flowers_to_plant = 3 * 12 seeds_per_flower = seeds_to_plant / flowers_to_plant seeds_left = seeds_to_plant % seeds_per_flower result = seeds_left return result
Mary drove at a speed of 80 km/hr for 1.5 hours and then slowed down to 60 km/hr for the next 2 hours. What is her average speed during the trip?
def solve() -> int: distance_covered = 80 * 1.5 + 60 * 2 total_time = 1.5 + 2 average_speed = distance_covered / total_time result = average_speed return result
Karen's mom sends her $50 a week for allowance. Karen spends $10 a week on books, $5 on lunch and saves the rest for her vacation. If her vacation is in 6 weeks, how much money will she have saved up?
def solve() -> int: allowance = 50 books = 10 lunch = 5 weekly_spending = books + lunch savings_per_week = allowance - weekly_spending num_weeks = 6 total_savings = num_weeks * savings_per_week result = total_savings return result
Carlos can bake 24 cookies in 20 minutes. If it takes Diana five times as long to bake her cookies, how many cookies can they bake together in 40 minutes?
def solve() -> int: carlos_rate = 24 / 20 diana_rate = 24 / (20 * 5) total_rate = carlos_rate + diana_rate result = total_rate * 40 return result
Jorge jogs for a distance of 500 meters around the stadium 10 times in the morning and 5 times in the evening. Determine the total distance Jorge runs in a week.
def solve() -> int: morning_distance = 500 * 10 evening_distance = 500 * 5 total_distance = morning_distance + evening_distance result = total_distance return result
Student: David drives a car at a speed of 80 km/h. If he has to cover a distance of 360 km, how long will it take him?
def solve() -> int: speed = 80 distance = 360 time = distance / speed result = time return result
A pizza restaurant offers three types of toppings: vegetables, meats, and cheeses. There are 4 times as many cheese toppings as meat toppings, and twice as many vegetable toppings as cheese toppings. If there are 10 meat toppings, how many cheese toppings are there?
def solve() -> int: meat_toppings = 10 cheese_toppings = 4 * meat_toppings vegetable_toppings = 2 * cheese_toppings result = cheese_toppings return result
A convenience store sells candy for $1 each and gum for $. 50 each. If a customer buys 10 candies and 6 gums, how much money, in dollars, will the customer need to pay including tax at 4%?
def solve() -> int: candy_price = 1 gum_price = 0.5 sales_tax = 0.04 total_candies = 10 total_gums = 6 subtotal = (total_candies * candy_price) + (total_gums * gum_price) total_cost = subtotal + (subtotal * sales_tax) result = total_cost return result
Hannah earns $22.50 an hour. If she works over 9 hours per shift, she is eligible for overtime, which is paid by her hourly wage + 1/2 her hourly wage. If she works 6 hours every day for 4 days, how much money does she make?
def solve() -> int: hourly_wage = 22.50 overtime_wage = hourly_wage + (0.5 * hourly_wage) hours_per_shift = 9 hours_per_day = 6 days_worked = 4 regular_pay = hourly_wage * hours_per_day * days_worked overtime_pay = overtime_wage * (hours_per_day - hours_per_shift) * days_worked ...
Angela purchased 12 apples for $6 and taxed 10%. How much money did she spend on the apples altogether?
def solve() -> int: num_apples = 12 price_apples = 6 tax = 10 raw_total = num_apples * price_apples tax_amount = raw_total * (tax/100) total_cost = raw_total + tax_amount result = total_cost return result
If Sarah normally earns $10 per hour and worked 42 hours last week, how much did she make before taxes if she earns time-and-a-half for every hour worked beyond her normal 40-hour workweek?
def solve() -> int: normal_rate = 10 hours_worked = 42 normal_hours = 40 overtime_hours = hours_worked - normal_hours overtime_rate = normal_rate * 1.5 overtime_pay = overtime_hours * overtime_rate normal_pay = normal_hours * normal_rate total_pay = normal_pay + overtime_p...
A toy store earns a fifth of its profit on Monday, a third of its profit on Thursday and the rest of its profit on Sunday. If the store makes a total profit of $700, how much profit, in dollars, was made on Sunday?
def solve() -> int: monday_profit = 700 / 5 thursday_profit = 700 / 3 sunday_profit = 700 - monday_profit - thursday_profit result = sunday_profit return result
Lisa has $100 in her savings account. If she earns a 5% annual interest rate, how much money will she have in her savings account after 2 years (compounded annually)?
def solve() -> int: initial_amount = 100 interest_rate = 0.05 num_years = 2 final_amount = initial_amount * (1 + interest_rate)**num_years result = round(final_amount, 2) return result
Student: A pizza delivery shop delivers pizzas to 5 neighborhoods. If each neighborhood gets 4 pizzas delivered, how many pizzas are delivered each day?
def solve() -> int: neighborhoods = 5 pizzas_per_neighborhood = 4 pizzas_delivered = neighborhoods * pizzas_per_neighborhood result = pizzas_delivered return result
The robotics team is entering a competition with a registration fee of $1000. They currently have $350 in their funds and there are 8 members on the team. How much money does each member need to contribute for the registration fee?
def solve() -> int: num_members = 8 class_funds = 350 registration_fee = 1000 amount_needed = registration_fee - class_funds contribution_per_member = amount_needed / num_members result = contribution_per_member return result
Maria has a group of water tanks. She has 5 tanks. 2 of them are 5000 liters. 1 of them is 20% less than that. The remaining tanks are 60% larger than the 2 tanks. How many liters of water can she store?
def solve() -> int: tank1 = 5000 tank2 = 5000 tank3 = tank1 - (0.2 * tank1) tank4 = tank1 * 1.6 tank5 = tank2 * 1.6 total_water = tank1 + tank2 + tank3 + tank4 + tank5 result = total_water return result
Emma is seven years younger than her older brother John. Seven years ago, when their ages added up to 47, how old was John?
def solve() -> int: John_age = 0 Emma_age = 0 John_age = 47 - Emma_age Emma_age = John_age - 7 John_age = John_age + 7 result = John_age return result
A pizza is cut into 8 equal slices. If you eat 3 slices, what fraction of the pizza did you eat?
def solve() -> int: total_slices = 8 slices_eaten = 3 fraction_eaten = slices_eaten / total_slices result = fraction_eaten return result
A recipe for a cake calls for 2 and a half cups of flour. If you want to make a half batch of the cake, how many cups of flour do you need?
def solve() -> int: full_recipe = 2.5 half_batch = 0.5 flour_needed = full_recipe*half_batch result = flour_needed return result
Sophie and Emma are practicing yoga together and earn 3 points for every pose completed correctly. After practicing 50 poses, Sophie scored 4 points less than half of the total points scored. How many total points did Emma score?
def solve() -> int: poses = 50 points_per_pose = 3 total_points = poses * points_per_pose sophie_points = (total_points / 2) - 4 emma_points = total_points - sophie_points result = emma_points return result
John is planning a trip and wants to save $500. He has already saved $200. How much more money does John need to save for the trip?
def solve() -> int: savings_goal = 500 current_savings = 200 money_needed = savings_goal - current_savings result = money_needed return result
If a car travels at 60 km/h for 5 hours, how many kilometers has it traveled?
def solve() -> int: speed = 60 time = 5 distance = speed * time result = distance return result
The average price of a movie ticket is $10.50. If a group of 4 people go to the movie theater, how much will they spend altogether on tickets?
def solve() -> int: num_people = 4 ticket_price = 10.50 total_cost = num_people * ticket_price result = total_cost return result
Jeremy has 5 pencils. He sharps 3 of them and keeps the rest as spares. How many pencils does Jeremy have left?
def solve() -> int: num_pencils = 5 num_sharpened = 3 num_left = num_pencils - num_sharpened result = num_left return result
30 gallons of gasoline can be divided into 5 equal portions. How many gallons are in each portion?
def solve() -> int: portion = 30 / 5 result = portion return result
The revenue from John's business must be divided in a ratio of 5:4 for paying rent and buying supplies, respectively. If he made a revenue of $5000, how much does he spend on paying the rent?
def solve() -> int: revenue = 5000 rent_ratio = 5 supply_ratio = 4 total_ratio = rent_ratio + supply_ratio rent_share = (rent_ratio / total_ratio) * revenue result = rent_share return result
The town council wants to make a public park. They would like to make a pond which is 50 meters by 25 meters by 2 meters. Water has a density of 1 gram per cubic centimeter. How much water should be bought for the pond in liters?
def solve() -> int: length = 50 width = 25 depth = 2 density = 1 volume = length * width * depth volume_cm = volume * 1000000 mass = volume_cm * density liters = mass / 1000 result = liters return result
John has a farm with cows and chickens. He has 25 cows and 40 chickens. After selling 9 cows and 15 chickens, he bought 7 cows and 12 chickens. How many animals does he have now?
def solve() -> int: cows_initial = 25 chickens_initial = 40 cows_sold = 9 chickens_sold = 15 cows_bought = 7 chickens_bought = 12 cows_final = cows_initial - cows_sold + cows_bought chickens_final = chickens_initial - chickens_sold + chickens_bought total_animals ...
Anna and Nick are both running up a hill. Anna runs 200 meters per minute, while Nick runs 100 meters more than Anna each minute. If Anna has reached the 1.5 kilometer mark, how far has Nick run?
def solve() -> int: anna_speed = 200 nick_speed = anna_speed + 100 anna_distance = 1500 nick_time = anna_distance / (anna_speed + nick_speed) nick_distance = nick_time * nick_speed result = nick_distance return result
Student: A pack of gum has 12 pieces. Each piece has 5 grams of sugar. How many grams of sugar are in 4 packs of gum?
def solve() -> int: pieces_per_pack = 12 grams_of_sugar_per_piece = 5 number_of_packs = 4 total_pieces = pieces_per_pack * number_of_packs total_grams_of_sugar = total_pieces * grams_of_sugar_per_piece result = total_grams_of_sugar return result
A water tank can hold 500 liters of water. It is currently filled to 80% of its capacity. How many liters of water are needed to fill the tank completely?
def solve() -> int: current_water = 500 * 0.8 remaining_capacity = 500 - current_water result = remaining_capacity return result
A rectangle has a length of 7 meters and a width of 4 meters. What is the area of the rectangle?
def solve() -> int: length = 7 width = 4 area = length * width result = area return result
Student: A city has 2244 homes with 3 bedrooms each. What is the total number of bedrooms in the city?
def solve() -> int: homes = 2244 bedrooms_per_home = 3 total_bedrooms = homes * bedrooms_per_home result = total_bedrooms return result
If you add 7 to a number and then multiply the result by 3, you get 60. What is the number?
def solve() -> int: target_result = 60 multiplier = 1/3 constant = 7 result = (target_result - constant) * multiplier return result