question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Anna is cycling. Her average speed is 23 km/h. She goes 46 km. How much time does it take to travel this distance? Round your answer to the nearest minute.
def solve() -> int: average_speed = 23 distance = 46 time_in_hours = distance/average_speed time_in_minutes = round(time_in_hours * 60) result = time_in_minutes return result
Student: Nora is baking a cake for a birthday party. She needs 2 cups of sugar for every 5 cups of flour. She has 70 cups of sugar, how many cakes can she make?
def solve() -> int: sugar = 70 flour = 0 flour = sugar / 2 * 5 cakes = flour / 5 result = cakes return result
Kevin collected 36 marbles and he wanted to divide them into 4 equal groups. He gave one group to his brother, one group to his sister, and kept one group for himself. How many marbles did he donate to charity?
def solve() -> int: marbles_per_group = 36 / 4 marbles_given_away = marbles_per_group * 3 marbles_donated = 36 - marbles_given_away result = marbles_donated return result
In a video game tournament, 32 contestants competed. Of these contestants, 10 placed in the top 4, 15 placed in the top 8, and 23 placed in the top 12. What is the percentage of contestants who placed in the top 4?
def solve() -> int: total = 32 result = (10/total)*100 return result
Student: If a recipe calls for 2 cups of sugar to make 24 cookies, and you want to make 48 cookies, how much sugar do you need?
def solve() -> int: cookies_needed = 48 cookies_per_cup = 24 sugar_per_cup = 2 sugar_needed = (cookies_needed / cookies_per_cup) * sugar_per_cup result = sugar_needed return result
Mary wants to buy a dress that costs $120. If she saves $10 per week, how long does it take for her to save enough to buy the dress?
def solve() -> int: weeks = 120 / 10 result = weeks return result
Q5: On three consecutive weekends, Celia read 96 pages of a novel. How many pages did Celia read each weekend?
def solve() -> int: total_pages = 96 num_of_weekends = 3 weekend_pages = total_pages / num_of_weekends result = weekend_pages return result
Student: A store sells t-shirts for $15 each and hats for $10 each. If a customer buys 3 t-shirts and 2 hats, what is their total cost?
def solve() -> int: cost_tshirt = 15 cost_hat = 10 num_tshirt = 3 num_hat = 2 total_cost = cost_tshirt * num_tshirt + cost_hat * num_hat result = total_cost return result
Before training, Mark can swim 20 laps in a pool in 30 minutes. After his training, he increases his speed by 50%. How many laps can he swim in 45 minutes?
def solve() -> int: laps_before_training = 20 time_before_training = 30 time_after_training = 45 speed_increase = 0.5 laps_after_training = laps_before_training * (1 + speed_increase) laps_per_minute_before_training = laps_before_training / time_before_training laps_per_minute_afte...
Sofia sold her bike for $150 and deposited the money in her bank account. If the bike sale makes up three-fifths of her new balance, what was her account balance before the deposit?
def solve() -> int: bike_sale = 150 new_balance = bike_sale / (3/5) account_balance_before_deposit = new_balance * (5/2) result = account_balance_before_deposit return result
Katie kayaked for 10 miles and ran half that distance. Afterward, she had to paddle home, which was three times fewer miles than the distance she ran. How many miles in total did Katie travel that day?
def solve() -> int: kayak_distance = 10 run_distance = kayak_distance / 2 paddle_distance = run_distance / 3 total_distance = kayak_distance + run_distance + paddle_distance result = total_distance return result
Student: A coat originally costs $200. There is a 25% discount and then an additional $50.00 off of the sale price. If the sales tax is 6%, how much will the coat cost in total?
def solve() -> int: original_price = 200 discount_rate = 0.25 additional_discount = 50 tax_rate = 0.06 sale_price = original_price * (1 - discount_rate) - additional_discount tax_amount = sale_price * tax_rate total_price = sale_price + tax_amount result = total_price return ...
Amelia saves $10 in the first week of January, $20 in the second week and doubles the amount she saves every week until the end of December. How much money will she have saved by the end of December?
def solve() -> int: week = 1 savings = 10 while week <= 52: savings *= 2 week += 1 result = savings return result
Student: A hardware store sold 150 hammers for $15 each and 100 nails for $0.5 each. Then they used $250 to restock the hammers and used half of the remaining money to restock the nails. If each hammer costs $12 to restock and each nail costs $0.1 to restock, how much money did they have left after everything?
def solve() -> int: hammers_sold = 150 nails_sold = 100 hammer_price = 15 nail_price = 0.5 restock_hammer_price = 12 restock_nail_price = 0.1 total_money_earned = hammers_sold * hammer_price + nails_sold * nail_price money_used_to_restock = 250 + (total_money_earned - 250) / 2 money_...
If a group of 8 people spends $48 on pizza and drinks, and each person pays an equal amount, how much does each person owe?
def solve() -> int: total_payment = 48 num_people = 8 equal_payment = total_payment / num_people result = equal_payment return result
A pizza shop sells 20 pies per hour and each pie has 8 slices. If the shop is open for 8 hours and sells all of the pizza they made for the day, how many slices of pizza did they sell?
def solve() -> int: pies_per_hour = 20 slices_per_pie = 8 hours_open = 8 total_pies = pies_per_hour * hours_open total_slices = total_pies * slices_per_pie result = total_slices return result
Jacob has 120 white t-shirts and 75 blue t-shirts. If he sells 20 white t-shirts and 10 blue t-shirts and then gives 5% discount on the price of the remaining t-shirts, what is the total amount that Jacob earns after the discount?
def solve() -> int: white = 120 blue = 75 sold_white = 20 sold_blue = 10 remaining_white = white - sold_white remaining_blue = blue - sold_blue price_per_tshirt = 20 total_price = (remaining_white+remaining_blue)*price_per_tshirt discount_rate = 0.05 discount = total_price*discou...
A box of chocolates costs $8.75 and has 20 pieces. If Sarah wants to buy 7 pieces, how much would it cost her?
def solve() -> int: chocolate_price = 8.75 total_pieces = 20 pieces_needed = 7 cost = chocolate_price * (pieces_needed / total_pieces) result = round(cost, 2) return result
Emily has 35 friends on her social media contact list. She has a sixth as many coworkers on her contact list. She has both of her grandparents and an uncle on her contact list. How many people are on Emily's contact list?
def solve() -> int: num_friends = 35 num_coworkers = num_friends / 6 num_family = 3 total_contacts = num_friends + num_coworkers + num_family result = total_contacts return result
Mark wants to display 24 photographs on his wall. He chooses to mount 25% of them vertically, 40% of them horizontally, and the remaining in no particular order. How many photographs did Mark mount vertically?
def solve() -> int: total_photos = 24 vertical_photos = total_photos * 0.25 horizontal_photos = total_photos * 0.4 remaining_photos = total_photos - vertical_photos - horizontal_photos result = vertical_photos return result
Brian fills up his pool at a rate of 11 gallons of water per hour. After the first three hours, the pool has 33 gallons of water. For the fourth hour, the pool develops a leak and loses 5 gallons of water. At the end of the fourth hour, how many gallons of water are still left in the pool?
def solve() -> int: rate = 11 time1 = 3 water1 = 33 time2 = 1 leak = -5 water2 = (rate * time1) + water1 result = water2 + (rate * time2) + leak return result
Student: Marcia wants to make a rectangular quilt that is 5ft long and 3ft wide. Each square patch on the quilt measures 12in by 12in. How many square patches does Marcia need to cover the entire quilt?
def solve() -> int: length = 5 width = 3 patch_length = 12 length_in = length * 12 width_in = width * 12 area_in = length_in * width_in num_patches = area_in / (patch_length ** 2) result = num_patches return result
A toy store is having a sale. A toy that normally costs $10 is now 20% off. What is the sale price of the toy?
def solve() -> int: original_price = 10 discount = original_price*0.2 sale_price = original_price - discount result = sale_price return result
An airline company has 150 seats on the plane. They took 20 seats away and replaced them with 12 first class seats. Additionally, they added 25 more seats to the economy class. How many seats are there in total now?
def solve() -> int: total_seats = 150 seats_removed = 20 first_class_seats_added = 12 economy_seats_added = 25 remaining_seats = total_seats - seats_removed remaining_seats_with_first_class = remaining_seats + first_class_seats_added total_seats_now = remaining_seats_with_first_class + ...
Ava bakes cupcakes for her class. She starts with 72 cupcakes and bakes 16 more. However, her dog eats some of the cupcakes when she's not looking, and when it's time to share, she only has 52 cupcakes left. How many cupcakes did Ava's dog eat?
def solve() -> int: initial_cupcakes = 72 additional_cupcakes = 16 total_cupcakes = initial_cupcakes + additional_cupcakes dog_eaten_cupcakes = total_cupcakes - 52 result = dog_eaten_cupcakes return result
Apart from selling the bacon from the pig, the farmer also sells apples from his farm. If he sold the average pig's 20 lbs of bacon, and 7 baskets of apples each containing 10 apples, how much total money will the farmer get this month?
def solve() -> int: pounds_bacon = 20 price_bacon = 6 baskets_apple = 7 apples_basket = 10 total_bacon_money = pounds_bacon * price_bacon total_apple_money = baskets_apple * apples_basket * 6 total_money = total_bacon_money + total_apple_money result = total_money return r...
A car consumes 7 liters of gas for every 100 kilometers it travels. The gas price is 1.5 dollars per liter. How much money will the driver spend on gas if he travels 350 kilometers?
def solve() -> int: gas_amount = 7 * 350 / 100 gas_cost = gas_amount * 1.5 result = "The driver will spend " + str(gas_cost) + " dollars on gas for the trip." return result
A gym has 250 members. If they gained 25 new members in the last month, what was the percentage increase in members?
def solve() -> int: members = 250 new_members = 25 increase = new_members / members * 100 result = increase return result
A bag contains 20 red balls, 15 blue balls, and 10 green balls. A ball is drawn at random from the bag and not replaced. Then another ball is drawn at random from the bag. What is the probability that both balls are red?
def solve() -> int: p = (20/45) * (19/44) result = p return result
Karen owns 20 cats. A quarter of them are Siamese. Of those, half are male and the rest are female. How many male Siamese cats does she have?
def solve() -> int: cats = 20 siamese_cats = cats / 4 male_siamese_cats = siamese_cats / 2 result = male_siamese_cats return result
arah has a savings account that pays 2% interest per year. She saves $1000 at the end of every year. How much money will she have after 10 years?
def solve() -> int: principal = 0 interest_rate = 0.02 years = 10 amount = 0 for i in range(years): principal += 1000 amount += principal amount *= (1 + interest_rate) result = amount return result
Samantha had a milkshake that contains 620 calories. She runs on the treadmill for 30 minutes and burns 8.8 calories per minute. How long will she need to run to burn off the milkshake?
def solve() -> int: milkshake_calories = 620 calories_burned_per_minute = 8.8 minutes_needed = milkshake_calories / calories_burned_per_minute result = minutes_needed return result
A librarian needs to sort a stack of 120 books into 3 piles for different departments. The first pile should have twice as many books as the second pile and the third pile should have 10 more books than the first pile. How many books will be in each pile?
def solve() -> int: total_books= 120 ratio_second_first = 1/2 third_first_difference = 10 num_books_second_pile = total_books // 5 num_books_first_pile = num_books_second_pile * 2 num_books_third_pile = num_books_first_pile + third_first_difference result = (num_books_first_pile, num_books_...
amantha has 8 pieces of candy to share with her 4 friends. If she divides them evenly, how many pieces of candy does each person get?
def solve() -> int: num_of_candy = 8 num_of_friends = 4 candy_per_person = num_of_candy//num_of_friends result = candy_per_person return result
A company makes a profit of $10 on every item they sell. If they sold 500 items, how much profit did they make?
def solve() -> int: profit_per_item = 10 num_items_sold = 500 total_profit = profit_per_item * num_items_sold result = total_profit return result
A rectangular field measures 20m by 50m. What is the area of the field in square meters?
def solve() -> int: length = 20 width = 50 area = length * width result = area return result
Taylor has to see a physiotherapist 3 times a week, and each session costs her $250. Additionally, she has to buy a $600 pair of shoes to alleviate her medical condition. If she has already seen the physiotherapist 9 times and bought the shoes, how much has she spent on her medical treatment?
def solve() -> int: sessions_per_week = 3 session_cost = 250 shoes_cost = 600 sessions_already_seen = 9 total_session_cost = sessions_per_week * session_cost * sessions_already_seen total_cost = total_session_cost + shoes_cost result = total_cost return result
Jane has 6 times as many shoes as Sarah. Sarah has twice as many shoes as Emily. If Emily has 4 pairs of shoes, how many pairs of shoes does Jane have?
def solve() -> int: Emily_shoes = 4 Sarah_shoes = Emily_shoes * 2 Jane_shoes = Sarah_shoes * 6 result = Jane_shoes return result
A group of friends go to dinner. The total bill amounts to $123. They decide to split it equally between them. If there are 7 friends, how much money does each friend have to pitch in?
def solve() -> int: bill = 123 friends = 7 per_friend = bill/friends result = per_friend return result
Student: Mark has 18 candy bars and five times as many lollipops as candy bars. He decides to give away 2 candy bars and 7 lollipops. How many lollipops does he have left?
def solve() -> int: candy_bars = 18 lollipops = candy_bars * 5 candy_bars -= 2 lollipops -= 7 result = lollipops return result
Anne bought a new bike for $599.99, a bike lock for $19.99 and a helmet for $29.99. She also bought two bike repair kits for $9.99 each and an extra set of pedals for $9.99. How much did Anne pay for her purchases?
def solve() -> int: bike_cost = 599.99 lock_cost = 19.99 helmet_cost = 29.99 totalCost = bike_cost + lock_cost + helmet_cost repair_kit_cost = 9.99 pedals_cost = 9.99 totalCost = totalCost + repair_kit_cost*2 + pedals_cost result = totalCost return result
It took Sarah 3 hours to complete a project that was originally planned to be done in 2 hours. How much longer than planned did the project take?
def solve() -> int: planned_time = 2 actual_time = 3 time_difference = actual_time - planned_time result = time_difference return result
My fish tank weighs 2,600 grams when empty. If I add 300 grams of water every day and always refill it, how much water is in the tank if it weighed 5,900 grams when I refilled it?
def solve() -> int: empty_weight = 2600 daily_water = 300 refilled_weight = 5900 water_weight = refilled_weight - empty_weight days = water_weight / daily_water result = days * daily_water return result
There are 60 students in a class. If 85% of them pass an exam, how many students passed?
def solve() -> int: num_students = 60 pass_percent = 85 num_pass = int(num_students * pass_percent / 100) result = num_pass return result
An electric toothbrush can be used for forty minutes before it needs to be charged. If it takes two minutes to brush teeth, how many times can the toothbrush be used before it runs out of power?
def solve() -> int: minutes_per_charge = 40 minutes_per_use = 2 uses_per_charge = minutes_per_charge // minutes_per_use result = uses_per_charge return result
The approximate mass of the Sun is 2.0 x 10⁴⁰ kg. An adult blue whale has a mass of about 200,000 kg. What is approximately the mass of the Sun compared to that of an adult blue whale?
def solve() -> int: mass_sun = 2.0 * 10**40 mass_whale = 200000 ratio = mass_sun / mass_whale result = ratio return result
Mia and Jake order a pasta dish for $8, a salad for $6, and a bread basket for $3. They split the pasta and the salad, but Jake eats the whole bread basket. They also order two glasses of water for free. The tip is 18% of the bill. They pay with two $10 bills. How much change should they get?
def solve() -> int: bill = 8 + 6 + 3 tip = bill * 0.18 total = bill + tip paid = 2 * 10 change = paid - total result = change return result
Ben provided 340 cups of ice cream for a party, while Carla provided 154 more cups of ice cream than Ben. After the party, 20 cups of ice cream remained. How many cups of ice cream were used at the party?
def solve() -> int: ben_total = 340 carla_total = ben_total + 154 used_total = (ben_total + carla_total) - 20 result = used_total return result
A construction worker drills a hole that's 6 inches deep every 2 minutes. How long does it take to drill a hole that's 3 feet deep?
def solve() -> int: time = (3 * 12) / 6 * 2 result = time return result
Tom can climb 20 meters before he gets tired. His friend Sarah can climb three-fourths of that distance, and his cousin can climb five less than Sarah. They were given a wall to climb that is 60 meters high. If they all kept climbing until they were exhausted, how many meters would each of them have made if they shared...
def solve() -> int: tom_distance = 20 sarah_distance = (3/4) * tom_distance cousin_distance = sarah_distance - 5 total_distance = tom_distance + sarah_distance + cousin_distance remaining_distance = 60 - total_distance each_distance = remaining_distance / 3 tom_meters = tom_di...
If Sally wants to keep her daily calorie intake at 1400 and she had 200 calories for breakfast, 500 calories for lunch, and 550 calories for dinner, how many calories can she consume for a snack?
def solve() -> int: breakfast_calories = 200 lunch_calories = 500 dinner_calories = 550 daily_calorie_intake = 1400 total_calories_consumed = breakfast_calories + lunch_calories + dinner_calories calories_for_snack = daily_calorie_intake - total_calories_consumed result = calories_...
A car travels 360 kilometers in 4 hours. How many kilometers will it travel in 7 hours, assuming the speed is constant throughout the journey?
def solve() -> int: speed = (360/4) distance_in_7_hours = (speed*7) result = round(distance_in_7_hours, 2) return result
haron works from 9am to 5pm and receives $17 per hour. How much does she earn in a day?
def solve() -> int: hours_worked = 8 hourly_rate = 17 total_earned = hours_worked * hourly_rate result = total_earned return result
Jenny picked 8 peaches from a tree. She shared the peaches with 3 people and kept 3 for herself. How many peaches did each person get?
def solve() -> int: Peaches_picked = 8 People_shared = 3 Peaches_kept = 3 result = (Peaches_picked - Peaches_kept)/People_shared result = (8 - 3)/3 return result
A basket contains 8 oranges and 12 bananas. How many fruits are in a group of 6 baskets?
def solve() -> int: number_of_oranges = 8 number_of_bananas = 12 number_of_baskets = 6 total_number_of_oranges = number_of_oranges * number_of_baskets total_number_of_bananas = number_of_bananas * number_of_baskets total_number_of_fruits = total_number_of_oranges + total_number_of_bana...
In a football stadium there are 4 grandstands. In the first, there are 2400 seats, in the second there are 2150, in the third 1950 and finally, in the fourth there are 800 seats. The stadium owner declares a 15% discount on all seats. How many chairs have a discount?
def solve() -> int: seats = [2400, 2150, 1950, 800] discount = 0.15 total_seats = sum(seats) discounted_seats = int(total_seats * discount) result = discounted_seats return result
If 75 pizzas cost $750 in total, how much would 1 pizza cost?
def solve() -> int: total_price_pizzas = 750 num_pizzas = 75 cost_one_pizza = (total_price_pizzas/num_pizzas) result = cost_one_pizza return result
In a school, the ratio of students who study English to those who study French is 4:3. If there are 35 students studying French, how many students study English?
def solve() -> int: english_students = (4/3) * 35 result = english_students return result
A student needs to study at least 2 hours every day. From Monday to Wednesday, John has studied for a total of 4.5 hours. How many hours per day does John need to study in order to meet his weekly requirement?
def solve() -> int: mon_to_wed_hours = 4.5 weekly_requirement = 2 * 7 remaining_hours = weekly_requirement - mon_to_wed_hours days_left = 7 - 3 hours_per_day = remaining_hours / days_left result = hours_per_day return result
Jack has 64 crayons. He wants to divide them equally and give them to his 4 siblings. How many crayons will each sibling receive?
def solve() -> int: crayons = 64 siblings = 4 crayons_per_sibling = crayons / siblings result = crayons_per_sibling return result
Student: A bag contains 5 purple chips, 4 yellow chips, and 6 green chips. How many different 3 chip combinations can be taken out of the bag?
def solve() -> int: purple_chips = 5 yellow_chips = 4 green_chips = 6 total_chips = purple_chips + yellow_chips + green_chips combinations = total_chips * (total_chips - 1) * (total_chips - 2) duplicates = purple_chips * (purple_chips - 1) * yellow_chips + purple_chips * (purple_chips - 1) * gre...
Mary has $24. Jim has 3 times as much money as Mary. If Jim has $72, how much money does Mary have?
def solve() -> int: mary_money = 24 jim_money = 72 mary_money = jim_money / 3 result = mary_money return result
A train is traveling at a speed of 80 km/h. How long will it take to cover a distance of 240 km?
def solve() -> int: speed = 80 distance = 240 time = distance / speed result = time return result
A fruit vendor bought 500 oranges, 300 apples and 400 bananas. Every day, he sells half of the remaining oranges, 1/3 of the remaining apples and 1/4 of the remaining bananas. After 3 days, how many fruits will he have left in total?
def solve() -> int: oranges = 500 apples = 300 bananas = 400 for i in range(3): oranges = oranges/2 apples = apples/3 bananas = bananas/4 result = int(oranges + apples + bananas) return result
Jon's train can travel 4 miles per minute while Sansa's train can travel 6 miles per minute. If their destination is 24 miles away, how many minutes ahead will Sansa be ahead of Jon?
def solve() -> int: time_jon = 24 / 4 time_sansa = 24 / 6 ahead = time_sansa - time_jon result = ahead return result
The perimeter of a rectangle is 24 meters, and its area is 35 square meters. What are the dimensions of the rectangle?
def solve() -> int: perimeter = 24 area = 35 b = perimeter/2 + ((perimeter/2)**2 - 4*area)**0.5/2 a = perimeter - 2*b result = (a, b) return result
Ethan needs $1400 for rent, $500 for groceries, $200 for medical expenses, and $70 for utilities. He wants to save $100 for a new video game. If he makes $21 per hour, how many hours will Ethan need to work this month?
def solve() -> int: rent = 1400 groceries = 500 medical_expenses = 200 utilities = 70 savings = 100 hourly_rate = 21 total_expenses = rent + groceries + medical_expenses + utilities + savings hours_worked = total_expenses / hourly_rate result = hours_worked return resul...
In a department store, the number of dresses is 80% of the number of shirts. If there are 125 shirts, how many dresses are there? Moreover, the number of shoes is four times more than the total number of dresses and shirts. Compute the number of shoes.
def solve() -> int: shirts = 125 dresses = 0.8 * shirts shoes = 4 * (dresses + shirts) result = shoes return result
Lily has five $5 bills and four more $2 bills. How much money does Lily have in all?
def solve() -> int: num_five = 5 num_two = num_five + 4 total_five = num_five * 5 total_two = num_two * 2 result = total_five + total_two return result
If one dozen of apples cost $4, how much will 2 and a half dozen of apples cost?
def solve() -> int: apple_cost = 4 number_of_dozen = 2.5 total_cost = apple_cost * number_of_dozen result = total_cost return result
There are 80 students in a Math class, and 40% of them are girls. How many boys are there?
def solve() -> int: total_students = 80 girl_percentage = 0.4 girl_count = total_students * girl_percentage boy_count = total_students - girl_count result = boy_count return result
A group of five take-out lovers order from the Chinese Take-Out. Each one orders a different meal. Tina orders sweet and sour chicken, Ben orders beef with broccoli, Gina orders chicken lo mein, Jack orders shrimp fried rice, and Sam orders two orders of dumplings. The order of dumplings has 6 units of dumplings, the s...
def solve() -> int: dumplings = 6 sweet_and_sour_chicken = 3 * dumplings chicken_lo_mein = sweet_and_sour_chicken + 2 beef_with_broccoli = chicken_lo_mein - 2 shrimp_fried_rice = 1 sam_order = 2 * dumplings total_units = dumplings + sweet_and_sour_chicken + chicken_lo_mein + beef_with_b...
Gina and Harry are borrowing money to buy a car. Gina borrows $20,000 at 7% annual interest compounded monthly and agrees to pay back the loan in 5 years with equal monthly payments. Harry borrows $15,000 at 8% annual interest compounded monthly and agrees to pay back the loan in 4 years with equal monthly payments. Ho...
def solve() -> int: gina_payment = 20000 * (0.07 / 12) / (1 - 1 / (1 + 0.07 / 12) ** (5 * 12)) gina_total = gina_payment * 5 * 12 harry_payment = 15000 * (0.08 / 12) / (1 - 1 / (1 + 0.08 / 12) ** (4 * 12)) harry_total = harry_payment * 4 * 12 difference = gina_total - harry_total result = differ...
Luke, Charlie and Gordon scored 100, 250 and 400 points respectively in a game. How many more points did Charlie and Gordon score together than Luke?
def solve() -> int: luke_points = 100 charlie_points = 250 gordon_points = 400 total_points = luke_points + charlie_points + gordon_points luke_total = luke_points difference = total_points - luke_total result = difference return result
Result: 12.0 Sophie has a jar filled with 200 gumballs. She eats 30% of them. Then she loses 40% of what she had left. If she has 70 gumballs left in the jar, how many did she lose?
def solve() -> int: gumballs_start = 200 gumballs_eaten = gumballs_start * 0.30 gumballs_left1 = gumballs_start - gumballs_eaten gumballs_lost = gumballs_left1 * 0.40 - 70 result = gumballs_lost return result
A park is 1.2 km away from the city center. It takes 24 steps for Gary to walk 1 km. How many steps will he take if he goes to the park and back 6 times this month?
def solve() -> int: steps_km = 24 distance = 1.2 trips_num = 6 total_steps = steps_km * (distance * 2) * trips_num result = total_steps return result
Emma wants to buy a toolkit that costs $20, a board game that costs $15 and a toy truck that costs $6. She has saved up $27 from tutoring. How much money does Emma still need?
def solve() -> int: cost_toolkit = 20 cost_board = 15 cost_truck = 6 allowance_saved = 27 total_cost = cost_toolkit + cost_board + cost_truck amount_needed = total_cost - allowance_saved result = amount_needed return result
Daniel went to the butcher and bought 2 pounds of pork chops, 1 1/2 pounds of chicken breasts, and a 1-pound package of bacon. He also grabbed a 12-ounce container of hummus and a 16-ounce bag of carrots. How many pounds of food did Daniel buy in total?
def solve() -> int: pork_chops = 2 chicken_breasts = 1.5 bacon = 1 hummus = 12 / 16 carrots = 16 / 16 total_pounds = pork_chops + chicken_breasts + bacon + hummus + carrots result = total_pounds return result
There are 10 apples in a basket. For every apple taken out, another apple is put in. After 30 times, how many apples are in the basket?
def solve() -> int: num_apples = 10 + 30 result = num_apples return result
Emily is baking a cake for her mother's birthday. The recipe requires 3 cups of sugar, if every cup of sugar weighs 300 grams, how many grams of sugar does the recipe require?
def solve() -> int: sugar_cups = 3 weight_per_cup = 300 total_weight = sugar_cups * weight_per_cup result = total_weight return result
Charlotte counts 10 sheep and 10 goats in her farm. Two of the goats get into a fight with one sheep. What percentage of the animals in the farm are goats now?
def solve() -> int: sheep = 10 goats = 10 goats -= 2 sheep -= 1 total_animals = sheep + goats percentage_goats = (goats / total_animals) * 100 result = percentage_goats return result
Student: Nina has 12 fish tanks. She has 4 tanks with 40 fish each, 3 tanks with 30 fish each, and the other 5 tanks have 20 fish each. How many total fish does Nina have?
def solve() -> int: tanks_40 = 4 tanks_30 = 3 tanks_20 = 5 fish_40 = 40 fish_30 = 30 fish_20 = 20 fish_40_total = tanks_40 * fish_40 fish_30_total = tanks_30 * fish_30 fish_20_total = tanks_20 * fish_20 fish_total = fish_40_total + fish_30_total + fish_20_total resu...
-Randomize the values for different questions to make them diverse. Below are some possible questions and programs: We collected 360 kg of oranges from our orchard. 120 kg were sold to a supermarket and 45 kg were donated to a school. The remaining oranges were packed into 3 kg boxes and shipped to customers. The shipp...
def solve() -> int: total_weight = 360 sold_weight = 120 donated_weight = 45 box_weight = 3 shipping_cost = 2 total_income = 978 remaining_weight = total_weight - sold_weight - donated_weight num_boxes = remaining_weight // box_weight income_per_box = total_income /...
Possible new questions and programs are: Sandy sold 3 times as many cupcakes as Andy, and Andy sold 4 times as many cupcakes as Cindy. If Cindy sold 6 cupcakes, how many did Sandy sell?
def solve() -> int: c = 6 a = 4 * c s = 3 * a result = s return result
Ava is filling her humidifier for her room. The humidifier normally holds 1 gallon of water. She knows her faucet runs at 2 gallons per minute. Water costs 6 cents for 10 gallons. How much does it cost to fill the humidifier?
def solve() -> int: humidifier_capacity = 1 faucet_rate = 2 water_cost = 0.06 fill_time = humidifier_capacity / faucet_rate water_amount = fill_time * faucet_rate water_cost_humidifier = (water_amount / 10) * water_cost result = water_cost_humidifier return result
Student: Holly showed up 22 minutes late to swim practice. Two of her teammates were 9 and 12 minutes later than her respectively. What was the total time the three swimmers were not at the pool?
def solve() -> int: holly_late = 22 teammate1_late = 9 teammate2_late = 12 total_late = holly_late + teammate1_late + teammate2_late result = total_late return result
Emily shared a sum of money between her two nephews Alex and Ben in the ratio 4:9 respectively. If Alex got $40, how much did Ben get?
def solve() -> int: ratio = 4/9 alex_money = 40 total_money = alex_money / ratio * (4 + 9) ben_money = total_money - alex_money result = ben_money return result
Sophie had $30. Her aunt gave her five times the amount of her money. If she bought twelve cupcakes at $1 each and six bags of chips at $2 each, how much money did she have left?
def solve() -> int: money = 30 aunt_money = 5 * money cupcakes_cost = 12 * 1 chips_cost = 6 * 2 total_cost = cupcakes_cost + chips_cost remaining_money = aunt_money - total_cost result = remaining_money return result
Mary can cook 4 pizzas in 2 hours. How long will it take her to cook 10 pizzas?
def solve() -> int: pizzas_per_hour = 4 / 2 time_in_hours = 10 / pizzas_per_hour result = time_in_hours return result
Chris works 45 hours a week. If his hourly wage is $15.50 an hour, how much does he make in a week before taxes?
def solve() -> int: hours_worked = 45 hourly_wage = 15.5 total_pay = hours_worked*hourly_wage result = total_pay return result
A vending machine has 100 candy bars, 150 gum packets, and 50 chip bags. The total number of items in the vending machine is the same as twice the number of passengers in a train compartment. If each compartment can hold 50 passengers, how many passengers can the train hold?
def solve() -> int: candy_bars = 100 gum_packets = 150 chip_bags = 50 total_items = candy_bars + gum_packets + chip_bags passengers = total_items / 2 train_capacity = 50 train_passengers = passengers / train_capacity result = train_passengers return result
Emma wants to build a statue that's six layers tall. Each layer of the statue has a hexagonal base where the side length is two inches longer than the layer above it. The top layer is just a single hexagonal piece. How many inches of material does Emma need?
def solve() -> int: top_layer_side_length = 1 total_material = 0 for layer in range(1, 7): layer_side_length = top_layer_side_length + 2 * (layer - 1) layer_material = 6 * layer_side_length total_material += layer_material result = total_material return res...
Jake can solve 8 math questions in 10 minutes. If he needs to solve 100 questions in 2 hours, how many questions does he need to solve in the next 50 minutes to meet his goal?
def solve() -> int: questions_per_minute = 8/10 total_questions = 100 total_time = 2*60 time_left = 50 questions_solved = (total_questions/total_time) * (total_time - time_left) questions_left = total_questions - questions_solved result = questions_per_minute * questions_left ...
Joe has a collection of 45 baseball cards. What percentage of his collection are Red Sox cards if he has 12 Red Sox cards?
def solve() -> int: total_cards = 45 red_sox_cards = 12 percent_red_sox = (red_sox_cards / total_cards) * 100 result = percent_red_sox return result
Tom bought three t-shirts at $15 each. He got a discount of 10% off on the total amount. What is Tom's total bill?
def solve() -> int: tshirt_price = 15 no_of_tshirts = 3 total_price = tshirt_price*no_of_tshirts discount_rate = 10 discount_amount = total_price * discount_rate/100 final_amount = total_price - discount_amount result = final_amount return result
Thomas has 60 minutes to finish his math homework, which is divided into 6 equally difficult problems. How many minutes can he spend on each problem?
def solve() -> int: total_time = 60 num_problems = 6 time_per_problem = total_time // num_problems result = time_per_problem return result
If a store is having a 20% off sale, and an item originally costs $50, how much will it cost after the discount?
def solve() -> int: initial_price = 50 discount_percent = 0.2 discount_amount = initial_price * discount_percent new_price = initial_price - discount_amount result = new_price return result
Jim took his family to a water park on holiday. The entrance fee was $25 for adults and $20 for children. He also rented a locker for $10 and spent $60 on food and drinks. If his family consisted of 2 adults and 3 children, what was the total cost of their visit?
def solve() -> int: adults = 2*25 children = 3*20 locker = 10 food_drinks = 60 total_cost = adults + children + locker + food_drinks result = total_cost return result
Student: 9. Matt's age is 4 less than 3 times the age of Carla. If Matt is 20, how old is Carla?
def solve() -> int: matt = 20 carla = None carla = (matt + 4) / 3 result = carla return result
If it takes 2/3 yard of fabric to make one dress, how many yards of fabric do you need to make 7 dresses and 3 skirts? Each skirt requires 1/4 yard of fabric.
def solve() -> int: fabric_for_one_dress = 2/3 dresses_needed = 7 skirts_needed = 3 fabric_for_one_skirt = 1/4 fabric_needed = (dresses_needed * fabric_for_one_dress) + (skirts_needed * fabric_for_one_skirt) result = fabric_needed return result