question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Ramon and Susana each filled up their tanks for $30. Ramon's car uses 25 mpg while Susana's car uses 10. How far can each one of them drive with the gas they paid for?
def solve() -> int: ramonMiles = 30 * 25 susanaMiles = 30 * 10 result = ramonMiles + susanaMiles return result
There are 24 more apples than three times the number of oranges in a fruit basket. If there are 8 oranges in the basket, how many apples are there?
def solve() -> int: oranges = 8 apples = 24 + 3*oranges result = apples return result
Emma babysits children and earns $12 for every hour of babysitting. If she babysat twice as many hours today as she did in the past five days, during which she babysat for 15 hours, how much money did she earn in total during the past five days and today?
def solve() -> int: past_five_days_hours = 15 today_hours = past_five_days_hours * 2 hourly_rate = 12 total_earned_past_five_days = past_five_days_hours * hourly_rate total_earned_today = today_hours * hourly_rate total_earned = total_earned_past_five_days + total_earned_today ...
The school is organizing a fundraising event. The gym rental cost is $1,500, it costs $25 for each participant, and they are expecting 200 participants. However, the principal predicts there will be 50% more participants than expected. How much would the event cost if the principal is correct?
def solve() -> int: gym_rental_cost = 1500 participant_cost = 25 expected_participants = 200 total_cost = gym_rental_cost + (participant_cost * expected_participants) predicted_participants = expected_participants * 1.5 predicted_total_cost = gym_rental_cost + (participant_cost * ...
If two dandelion plants produce 65 viable seeds each after two months, how many viable seeds will be on the lawn after four months?
def solve() -> int: count = 0 num_seeds = 65 for month in range (1,5): if month == 1 or month == 2: count += num_seeds*2 else: count += (num_seeds*2)*2 result = count return result
Kevin collected 120 cans and 80 bottles for recycling. He earned $0.05 for each can and $0.1 for each bottle. He also spent $3 on a bus ticket to the recycling center. How much money did he make in total?
def solve() -> int: can_income = 0.05 bottle_income = 0.1 can_number = 120 bottle_number = 80 income = can_income * can_number + bottle_income * bottle_number bus_cost = 3 expense = bus_cost money = income - expense result = money return result
Victoria organizes a charity run to collect funds for a music school. She collects $800 from participants. She needs to pay $150 for water, snacks, and other arrangements. She wants to donate one-sixth of the remaining amount to the music school and another one-sixth to a local children's hospital. How much money does ...
def solve() -> int: collected = 800 expenses = 150 remaining = collected - expenses music_school = remaining / 6 children_hospital = remaining / 6 result = music_school result = children_hospital return result
A gym membership costs $30 per month. Sofia joined the gym for 6 months and got a 20% discount after paying 3 months. How much did Sofia spend?
def solve() -> int: monthly_membership_cost = 30 number_of_months_joined = 6 discount_percentage = 0.2 discount_after_number_of_months = 3 total_membership_cost = monthly_membership_cost * number_of_months_joined if discount_after_number_of_months <= number_of_months_joined: total_membersh...
A music festival had 500 attendees. 1/8 of the attendees left early due to heavy rain. Of the remaining attendees, 1/6 lost their wristbands and had to leave the festival. How many attendees stayed until the end of the festival?
def solve() -> int: total_attendees = 500 rain_attendees = total_attendees / 8 remaining_attendees = total_attendees - rain_attendees lost_wristband_attendees = remaining_attendees / 6 end_attendees = remaining_attendees - lost_wristband_attendees result = end_attendees ...
A jar contains 60 marbles, 18 of which are blue. What percent of the marbles are blue?
def solve() -> int: total_marbles = 60 num_blue_marbles = 18 percent_blue = num_blue_marbles / total_marbles * 100 result = percent_blue return result
- Ben plays video games for 360 minutes. He takes a snack break every 30 minutes and a bathroom break every 120 minutes. How many more snack breaks does he take than bathroom breaks?
def solve() -> int: snack_breaks = 360 // 30 bathroom_breaks = 360 // 120 result = snack_breaks - bathroom_breaks return result
A car travels at an average speed of 60 km/hour for the first 2 hours and an average speed of 90 km/hour for the next 3 hours. What is the average speed of the car in km/hour for the entire journey?
def solve() -> int: distance_covered_in_first_2_hours = 60 * 2 distance_covered_in_next_3_hours = 90 * 3 total_time = 2 + 3 average_speed = (distance_covered_in_first_2_hours + distance_covered_in_next_3_hours) / total_time result = average_speed return result
``` In a group of 50 people, there are twice as many men as women. If the average age of all the women is 25, and the average age of all the men is 35, what is the average age of the entire group?
def solve() -> int: men = 2/3*50 women = 1/3*50 average_age = (men*35 + women*25)/50 result = average_age return result
John travels on a plane that takes 6 hours to fly from Los Angeles to New York City. His sister takes 1/3 of this time to fly from Los Angeles to San Francisco. If John drives back home every day, 4 times slower than the plane, and his sister takes the plane back home, calculate the total amount of time, in hours, they...
def solve() -> int: plane_time = 6 sister_time = plane_time / 3 john_drive_time = plane_time * 4 total_time = (2 * plane_time) + sister_time + john_drive_time result = total_time return result
John wants to go camping and needs to travel 250 miles. If he drives at a rate of 55 mph and takes a 30-minute lunch break along with a 10-minute coffee break, how long will it take him to get there?
def solve() -> int: distance = 250 speed = 55 lunch_break = 30 coffee_break = 10 travel_time = distance / speed break_time = lunch_break + coffee_break total_time = travel_time + break_time result = total_time return result
Daniel bought 5 gift cards for $25 each and 10 books for $15 each. He used the money to buy a phone case for $35. How much money does he have left?
def solve() -> int: giftcards_cost = 5*25 books_cost = 10*15 total_cost = giftcards_cost + books_cost remaining_money = total_cost - 35 result = remaining_money return result
Linda bought 10 pencils for $1.20 each, 5 notebooks for $2.50 each, and 3 binders for $7.75 each. What was the total cost of all the items?
def solve() -> int: pencil_cost = 1.20 notebook_cost = 2.50 binder_cost = 7.75 num_pencils = 10 num_notebooks = 5 num_binders = 3 total_cost = (pencil_cost * num_pencils) + (notebook_cost * num_notebooks) + (binder_cost * num_binders) result = total_cost return result
A recipe for 4 servings calls for 2 tablespoons of sugar. How much sugar is needed if you want to make 10 servings?
def solve() -> int: sugar_per_serving = 2/4 num_servings_needed = 10 sugar_needed = num_servings_needed * sugar_per_serving result = sugar_needed return result
There are 72 pens in a pack. Ms. Brown's fourth grade class needs 4 pens per student for a writing project. The class has 20 students, but 4 students already have their own pens and don't need any from the pack. How many pens are left in the pack after the project?
def solve() -> int: students = 20 - 4 pens = students * 4 left = 72 - pens result = left return result
A family has 3 sisters, 2 brothers, and 6 aunts and uncles. How many family members does the family have in total?
def solve() -> int: total = 0 total = total + 3 total = total + 2 total = total + 2 * 6 result = total return result
Mark has 13 books and gives 5 of them away. How many books does he have left?
def solve() -> int: books = 13 give_away = 5 result = books - give_away return result
Student: Ken borrows $30 from a lender and agrees to repay the amount plus an additional $5 interest rate after 8 weeks. How much does Ken owe the lender after 8 weeks?
def solve() -> int: principal = 30 interest_rate = 5 time = 8 total_amount_owed = principal + (principal * interest_rate * time / 100) result = total_amount_owed return result
Student: The cost of a microwave oven is $120. If the price is increased by 20%, what is the new price?
def solve() -> int: price = 120 increase = 0.2 new_price = price + price * increase result = new_price return result
A recipe calls for 2 cups of sugar. If a bag of sugar weighs 1.5 pounds, how many bags of sugar are needed for the recipe?
def solve() -> int: cups_of_sugar = 2 weight_of_bag = 1.5 cups_of_sugar_in_bag = 8 bags_of_sugar = cups_of_sugar/ cups_of_sugar_in_bag / weight_of_bag result = round(bags_of_sugar, 2) return result
Jack has 4 apples. He eats one and gives 2 away to his friends. How many apples does he have left?
def solve() -> int: apple_count = 4 apple_count = apple_count - 1 apple_count = apple_count - 2 result = apple_count return result
An equilateral triangle has a side length of 6 inches. What is the perimeter of the triangle?
def solve() -> int: perimeter = 6 * 3 result = perimeter return result
Ben has 12 marbles in his bag. He lost 4 marbles on his way to school, and traded 2 marbles with his friend for 3 stickers. He also found 1 marble on the playground. How many marbles does Ben have now?
def solve() -> int: marbles = 12 marbles = marbles - 4 marbles = marbles - 2 marbles = marbles + 1 result = marbles return result
A company has 500 employees and plans to recruit 2% of the current number of employees every month. How many employees will the company have after one year?
def solve() -> int: initial_employees = 500 for month in range(1, 13): hired = int(initial_employees * 0.02) initial_employees += hired result = initial_employees return result
Possible questions and programs are: A bag of apples weighs 2 kg and costs $4. A bag of oranges weighs 1.5 kg and costs $3. How much will it cost to buy 3 bags of apples and 2 bags of oranges?
def solve() -> int: total_apples = 3 * 4 total_oranges = 2 * 3 total_cost = total_apples + total_oranges result = total_cost return result
A pizza shop sells small pizzas for $8, medium pizzas for $10, and large pizzas for $12. On Monday, they sold 15 small pizzas, 10 medium pizzas, and 5 large pizzas. On Tuesday, they sold 20% more small pizzas, 10% less medium pizzas, and the same number of large pizzas. How much more revenue did they make on Tuesday th...
def solve() -> int: small_price = 8 medium_price = 10 large_price = 12 monday_small = 15 monday_medium = 10 monday_large = 5 tuesday_small = monday_small * 1.2 tuesday_medium = monday_medium * 0.9 tuesday_large = monday_large monday_revenue = small_price * monday_small + medium_p...
Student: Tina has a jar of marbles with different colors. She has four times as many blue marbles as red marbles. She has six more green marbles than blue marbles. She has half as many yellow marbles as red marbles. If she has 12 yellow marbles, how many marbles does she have to add to the jar to have a total of 150 ma...
def solve() -> int: red_marbles = 0 blue_marbles = 0 green_marbles = 0 yellow_marbles = 12 blue_marbles = red_marbles * 4 green_marbles = blue_marbles + 6 red_marbles = yellow_marbles / 2 total_marbles = red_marbles + blue_marbles + green_marbles + yellow_marbles marbles_to_add = 150...
During a charity bike race, participants raised $6,000. 35% of the amount went to charity, 50% of the remaining amount paid for race expenses. How much money was left from the race expenses?
def solve() -> int: amount_raised = 6000 charity_amount = amount_raised * 0.35 remaining_amount = amount_raised - charity_amount race_expenses = remaining_amount * 0.50 result = race_expenses return result
At a coffee shop, Sarah bought a latte which is $4 and a croissant that is priced at $2.5. Sarah paid with a $10 bill. What is her change?
def solve() -> int: latte_price = 4 croissant_price = 2.5 total_price = latte_price + croissant_price paid_amount = 10 change = paid_amount - total_price result = change return result
A shirt costs $30 but is currently discounted by 15%. A 6% sales tax is applied after the discount. What is the final price of the shirt after tax?
def solve() -> int: shirt_price = 30 discount = 0.15 tax_rate = 0.06 discounted_price = shirt_price - (shirt_price * discount) final_price = discounted_price + (discounted_price * tax_rate) result = final_price return result
Student: Sam buys 12-gallon cans of paint for $48 each. If he paints 6 rooms, and each room requires 3 gallons of paint, how much will he spend, in dollars, on paint?
def solve() -> int: cans = 12 price = 48 rooms = 6 gallons = 3 total_gallons = rooms * gallons cans_needed = total_gallons / cans cost = cans_needed * price result = cost return result
If Bob drinks twice as much water as his friend, Chris, but drinks 2/7 times less coffee than Chris per week. If Bob drinks 1000 ml of coffee every day, how much coffee did they drink altogether if Chris drank 21 times?
def solve() -> int: bob_coffee_per_day = 1000 chris_coffee_per_day = bob_coffee_per_day * 7 / 2 bob_coffee_total = bob_coffee_per_day * 7 chris_coffee_total = chris_coffee_per_day * 7 total_coffee = bob_coffee_total + chris_coffee_total result = total_coffee * 21 return result
A construction company used 5,000 bricks to build a wall that is 20 feet long and 8 feet tall. Each brick is 8 inches long, 4 inches wide, and 2 inches thick. How many bricks were used per square foot of wall?
def solve() -> int: total_bricks = 5000 wall_length = 20 * 12 wall_height = 8 * 12 brick_length = 8 brick_width = 4 brick_height = 2 brick_volume = brick_length * brick_width * brick_height wall_volume = wall_length * wall_height bricks_per_square_foot = total_bricks / (wall_volume /...
A pack of gum has 24 pieces, and a box of chocolates has 18 pieces. If a pack of gum costs $3 and a box of chocolates costs twice as much, how much would it cost to buy 4 packs of gum and 3 boxes of chocolates?
def solve() -> int: gum_cost = 3 chocolate_cost = 2 * gum_cost total_cost = (4*gum_cost) + (3*chocolate_cost) result = total_cost return result
Alex is training for a powerlifting competition. He lifts weights for 100 pounds every day for a month (30 days). If he continues to lift weights for the next 15 days, how many pounds will he have lifted in total? Sarah has a lemon tree in her backyard. She needs to pick lemons for a recipe but can’t reach the top bran...
def solve() -> int: weight_per_day = 100 days_in_a_month = 30 days_after_month = 15 total_weight_lifted = weight_per_day * (days_in_a_month + days_after_month) height_of_top_branch = 16 height_of_crate = 2 number_of_rungs = 10 height_of_ladder = height_of_top_branch - heig...
Julie throws a baseball from a 80-foot high bridge. The ball rebounds to 1/6 the height from which it was thrown. What is the height of the ball on its fourth rebound?
def solve() -> int: height = 80 rebound_height = height / 6 second_rebound_height = rebound_height / 6 third_rebound_height = second_rebound_height / 6 fourth_rebound_height = third_rebound_height / 6 result = fourth_rebound_height return result
Student: A pound of eggplants costs $1.40 and a pound of zucchinis costs 5 times as much as eggplants. If James will buy 8 pounds of eggplants and 3 pounds of zucchinis, how much will it cost?
def solve() -> int: cost_eggplants = 1.40 cost_zucchinis = 5 * cost_eggplants amount_eggplants = 8 amount_zucchinis = 3 total_cost = cost_eggplants * amount_eggplants + cost_zucchinis * amount_zucchinis result = total_cost return result
If 3/5 of a group of students prefer pizza and 20 students prefer pizza, how many students are in the group?
def solve() -> int: num_prefer_pizza = 20 frac_prefer_pizza = 3/5 num_students = num_prefer_pizza / frac_prefer_pizza result = num_students return result
A box contains 36 lightbulbs. If 2/3 of them are working properly, how many bulbs are broken?
def solve() -> int: working_bulbs = 36 * 2/3 broken_bulbs = 36 - working_bulbs result = broken_bulbs return result
Student: Samantha bought a new phone. She paid $350 for the phone, and $50 for the case. If she had $100 left over, how much did she have initially?
def solve() -> int: phone_price = 350 case_price = 50 left_over = 100 initial_amount = phone_price + case_price + left_over result = initial_amount return result
A farmer had 24 sheep in his field. After a week, he counted 50 times more sheep. How many sheep did he have in total?
def solve() -> int: sheep_initial = 24 sheep_after_week = sheep_initial * 50 total_sheep = sheep_initial + sheep_after_week result = total_sheep return result
Jasmine has $53 to go shopping. She bought two books for $14 each and a journal for $7. How much money does Jasmine have left?
def solve() -> int: dollars = 53 books = 14 * 2 journal = 7 left = dollars - books - journal result = left return result
Student: A rectangular box measures 10cm by 8cm by 6cm. What is the volume of the box?
def solve() -> int: length = 10 width = 8 height = 6 volume = length * width * height result = volume return result
Mr. Michael's legs are 4/9 of his total height. If his torso is also 2/5 of his total height, and he is 75 inches tall, calculate the length of his arms. Emily buys 8 packs of gum every week. Each pack costs $1.50 and she can receive a cash refund of $0.25 per pack if she returns the empty wrapper to the store. How muc...
def solve() -> int: height = 75 legs = (4/9) * height torso = (2/5) * height arms = height - legs - torso result = arms return result
A pool is being filled with water at a rate of 10 gallons per minute. The pool can hold a total of 500 gallons of water. If the pool is currently empty, how many minutes will it take to fill the pool?
def solve() -> int: capacity = 500 rate = 10 time = capacity/rate result = time return result
A man buys 15 pens and 24 pencils. If he bought a total of 39 items, how many more pens than pencils did he buy?
def solve() -> int: total_items = 39 num_pens = 15 num_pencils = 24 difference = num_pens - num_pencils items_left = total_items - (num_pens + num_pencils) result = difference + (items_left/2) return result
If a contractor was hired for $6000 to build a fence with $1000 monthly payments, and they received 3 payments so far, how much more money is owed to the contractor?
def solve() -> int: total_contracted_price = 6000 num_of_payments = 3 monthly_payment = 1000 total_paid = num_of_payments * monthly_payment money_owed = total_contracted_price - total_paid result = money_owed return result
Matt is driving his car at a constant speed of 60 mph. If he drives for 7 hours, how far would he have travelled?
def solve() -> int: speed = 60 time = 7 * 60 distance = speed * time result = distance return result
Mason has a collection of 20 lego bricks and 12 wooden blocks. If each lego brick is 3 cm tall and each wooden block is 6 cm tall, what is the total height of the collection?
def solve() -> int: lego_brick_height = 3 wooden_block_height = 6 num_lego_bricks = 20 num_wooden_blocks = 12 total_lego_height = lego_brick_height * num_lego_bricks total_wooden_height = wooden_block_height * num_wooden_blocks total_height = total_lego_height + total_wooden_height ...
At a grocery store, 75% of the customers use a coupon to get a discount on their purchase. If 120 people used the coupon, how many total customers visited the store?
def solve() -> int: coupon_users = 120 percentage_coupon_users = 75 total_customers = coupon_users * 100 / percentage_coupon_users result = int(total_customers) return result
Student: Question7: Alex wants to make 6 bouquets of flowers for a school project. If each bouquet needs 18 flowers, how many flowers does Alex need in total?
def solve() -> int: bouquets = 6 flowers_per_bouquet = 18 total_flowers = bouquets * flowers_per_bouquet result = total_flowers return result
Student: Kara made some bracelets of different colors. She made 9 bracelets of red beads, 3 fewer bracelets of blue beads than red beads, and 5 more bracelets of green beads than blue beads. How many bracelets did Kara make in all?
def solve() -> int: red_beads = 9 blue_beads = red_beads - 3 green_beads = blue_beads + 5 total_bracelets = red_beads + blue_beads + green_beads result = total_bracelets return result
Student: A car travels at an average speed of 50 mph and it takes 4 hours to reach its destination. What is the distance traveled by the car?
def solve() -> int: speed = 50 time = 4 distance = speed * time result = distance return result
A train travels from one station to another at an average speed of 60 miles per hour. If the distance between the stations is 240 miles, how long does it take for the train to travel from one station to the other (in hours)?
def solve() -> int: distance = 240 speed = 60 time = distance / speed result = time return result
If Rachel donates $350 every month to a children's foundation where 2/5 goes to the education program, 1/4 goes to medical assistance, 1/3 of the remaining goes to child advocacy, and the rest is for contingency funds. How much goes to contingency fund?
def solve() -> int: donation_per_month = 350 education_program = donation_per_month * 2/5 medical_assistance = donation_per_month * 1/4 remaining = donation_per_month - education_program - medical_assistance child_advocacy = remaining * 1/3 contingency_fund = remaining - child_advocacy ...
Maria has a pack of 60 pencils. Every week she uses 8 for drawing. After 2 weeks, she buys 25 more pencils. A few days later, she discovers her cousin had been using her pencils. If Maria had 100 pencils to start with, how many pencils does she have when she discovers the theft?
def solve() -> int: pencils_start = 100 pencils_per_week = 8 weeks_passed = 2 pencils_bought = 25 pencils_used = pencils_per_week * weeks_passed pencils_remaining = pencils_start - pencils_used pencils_total = pencils_remaining + pencils_bought result = pencils_total return...
Olivia has 2 rows of 6 rose bushes in her garden. For each of her birthdays starting at 8, she adds a new row of roses. By her 12th birthday, she increases the number of rose bushes she has by 75%. How many rose bushes does she have now?
def solve() -> int: rows = 2 + (12-8) bushes_per_row = 6 total_bushes_before = rows * bushes_per_row increase = total_bushes_before * 0.75 total_bushes_after = total_bushes_before + increase result = total_bushes_after return result
David had 840 pieces of coins. He used one-fourth of them to buy toys. How many pieces of coins does David have left?
def solve() -> int: coins_brought = 840 coins_spent = 1/4 * coins_brought coins_left = coins_brought - coins_spent result = coins_left return result
A box contains 6 blue balls, 8 green balls and 10 red balls. What is the probability of randomly selecting a red ball?
def solve() -> int: s = 6 + 8 + 10 r = 10 probability = r / s result = 0.5556 return result
Bob is planning a road trip with his friends. He estimates that he will drive 1500 kilometers in total, and his car consumes 8 liters of gas per 100 kilometers. The price of gas varies along the way, and he expects to pay an average of $1.25 per liter. He also needs to pay $50 for tolls and $100 for food and accommodat...
def solve() -> int: distance = 1500 consumption = 8 / 100 average_price = 1.25 tolls = 50 food_and_accommodation = 100 gas_cost = distance * consumption * average_price total_cost = gas_cost + tolls + food_and_accommodation result = total_cost return result
A group of 24 friends decided to order pizza for lunch. They ordered 8 pizzas, each with 10 slices. They ate 3/5 of the pizza and shared the rest equally among themselves. How many slices of pizza did each friend get?
def solve() -> int: friends = 24 pizzas = 8 slices = 10 total_slices = pizzas * slices eaten = 3/5 * total_slices left = total_slices - eaten slices_per_friend = left / friends result = slices_per_friend return result
If the circumference of a circle is equal to 56 cm, what is the diameter of the circle?
def solve() -> int: circumference = 56 diameter = circumference / 3.14 result = diameter return result
Jenna decided to go for a run this morning and ran a total of 12 miles. She ran for 4 miles and took a short break, then continued running for another 6 miles until she stopped at a lake for a short break. What was the total distance she had run up to that point?
def solve() -> int: distance_run = 0 distance_run = distance_run + 4 distance_run = distance_run + 6 result = distance_run return result
Jack has to fill his pool that is 8 feet deep. He needs to fill it up with water from a hose that runs for 1 hour and fills up 11 cubic feet of water. How long does Jack need to fill the pool?
def solve() -> int: depth = 8 time = 1 amount_filled = 11 volume_pool = depth * amount_filled time_needed = volume_pool / time result = time_needed return result
Mia is making gift baskets for her family. She needs to make 8 baskets. It costs $12 to make 4 baskets. How much will it cost to buy all the materials needed for the baskets? Tommy wants to purchase a monthly subscription to a streaming service. The subscription costs $8 per month and has a $30 start-up fee. How much w...
def solve() -> int: num_baskets = 8 cost_per_basket = 12 total_cost = (num_baskets / 4) * cost_per_basket subscription_cost_per_month = 8 start_up_fee = 30 num_years = 2 total_subscription_cost = (subscription_cost_per_month * 12 * num_years) + start_up_fee result = t...
A recipe calls for 2 1/2 cups of flour but you only have 1 1/4 cups of flour. How much more flour do you need to complete the recipe?
def solve() -> int: recipe_flour = 2.5 current_flour = 1.25 needed_flour = recipe_flour - current_flour result = needed_flour return result
Jim's restaurant sells 8,000 dishes per week. The ingredients cost him $10 per dish. He charges $25 per dish. His chef takes 25% of his earnings. How much profit is Jim earning each week?
def solve() -> int: dishes_sold = 8000 ingredient_cost = 10 price_per_dish = 25 total_revenue = dishes_sold * price_per_dish total_cost = dishes_sold * ingredient_cost earnings_before_chef = total_revenue - total_cost chef_cut = 0.25 * earnings_before_chef ...
Student: Eve read 15 pages on Thursday, 18 pages on Friday, and on Saturday Eve read 20% more pages than she did on the previous two days combined. How many pages did Eve read in total?
def solve() -> int: thursday = 15 friday = 18 saturday = (thursday + friday) * 1.2 total = thursday + friday + saturday result = total return result
A tutor charges $40 per hour for the first 20 hours in a session and an additional 50% for every hour above 20 in the session. If the session lasts for 4 days and he works 5 hours for the first 3 days and twice as many hours per day for the remaining 1 day, how much money did he make?
def solve() -> int: days = 4 hours_per_day = [5, 5, 5, 10] total_hours = sum(hours_per_day) extra_hours = max(total_hours - 20, 0) extra_cost = extra_hours * 40 * 0.5 total_cost = 20 * 40 + extra_cost result = total_cost return result
Hannah spent $50 on candy, which was 25% of her allowance. What is her total allowance?
def solve() -> int: amount_spent = 50 percentage_spent = 25 total_allowance = amount_spent / (percentage_spent/100) result = total_allowance return result
1/3 of 75 is added to 2/5 of 125 to obtain a number. What is that number?
def solve() -> int: fraction_one = 1/3 value_one = 75 fraction_two = 2/5 value_two = 125 result_one = fraction_one * value_one result_two = fraction_two * value_two desired_number = result_one + result_two result = desired_number return result
Jack is painting his room. He can paint 8 square meters of wall in one hour. His room has 4 walls, each measuring 3 meters high and 4 meters wide. He also has a door that takes up 2 square meters and a window that takes up 1.5 square meters. How many hours will it take him to paint his room, excluding the door and the ...
def solve() -> int: area_wall = 3 * 4 total_area_walls = area_wall * 4 area_to_paint = total_area_walls - (2 + 1.5) time = area_to_paint / 8 result = time return result
John and Lisa together have a total of 75 books. Lisa owns 2/3 of the books. John gave Lisa 8 books, but Lisa also gave John 6 books. After the exchange, how many books does John have?
def solve() -> int: total_books = 75 lisa_books = (2/3) * total_books john_books = total_books - lisa_books john_books = john_books + 6 lisa_books = lisa_books + 8 john_books = john_books - 6 lisa_books = lisa_books - 8 result = john_books return result
A baker uses 3/4 cup of chocolate chips, 1/2 cup of sugar, and 1/3 cup of butter for a batch of cookies. If the baker wants to make 4 batches of cookies, how much of each ingredient does he need?
def solve() -> int: chocolate_chips = 3/4*4 sugar = 1/2*4 butter = 1/3*4 result = chocolate_chips, sugar, butter return result
If a car moves 360km in 3 hours, how long would it take to travel 270km, moving at the same speed?
def solve() -> int: distance = 360 time = 3 speed = distance / time new_distance = 270 new_time = new_distance / speed result = new_time return result
Kyle is having a party and he needs 5 boxes of chips. His mom gave him 7 boxes instead. How many boxes of chips does he have now?
def solve() -> int: boxes_needed = 5 boxes_gift = 7 result = boxes_needed + boxes_gift return result
A rectangular box has a length of 5 cm, a width of 4 cm, and a height of 3 cm. If the density of the material used to make the box is 2.5 g/cm^3, what is the weight of the box in kg?
def solve() -> int: length = 5 width = 4 height = 3 density = 2.5 volume = length * width * height mass = volume * density / 1000 result = round(mass, 3) return result
A triangle has a base of 6cm and an area of 12cm^2. What is the height of the triangle?
def solve() -> int: base = 6 area = 12 height = (2 * area) / base result = height return result
A box contains 24 red balls and 36 blue balls. If you randomly select one ball, what is the probability that it is a red ball?
def solve() -> int: total_balls = 24 + 36 red_balls = 24 probability_of_red_ball = red_balls/total_balls result = round(probability_of_red_ball, 2) return result
Julie and her sister went to the market with $70.00. Julie spent $2.25 for a package of pens and $2.75 for a pair of scissors. How much money did her sister have available for supplies?
def solve() -> int: total_amt = 70.00 julie_amt = 5.00 sister_amt = round((total_amt - julie_amt), 2) result = sister_amt return result
Student: Alex spends $20 a week on groceries. How much will Alex spend in 10 weeks?
def solve() -> int: weekly_spending = 20 weeks = 10 total_spending = weekly_spending * weeks result = total_spending return result
Tiffany is selling handmade jewelry at a craft fair. She must pay $12 for her booth and has 3 hours to sell as many pieces as possible. If she sells 30 pieces, she will earn $1 per piece sold. How many pieces should she sell to avoid losing any money?
def solve() -> int: booth_fee = 12 selling_price = 1 pieces_sold = 30 total_earnings = selling_price * pieces_sold total_expenses = booth_fee profit = total_earnings - total_expenses if profit >= 0: pieces_to_sell = pieces_sold else: pieces_to_sell = total_...
Rachel bought 2 notebooks for $1.50. How much will 9 notebooks cost?
def solve() -> int: notebooks_bought = 2 cost_of_notebooks = 1.50 cost_per_notebook = cost_of_notebooks / notebooks_bought total_cost = cost_per_notebook * 9 result = total_cost return result
In a Spanish language test, Rachel answered 90% of the questions correctly while Malik got 7 questions wrong. The test had 45 questions. How many more questions did Rachel answer correctly than Malik?
def solve() -> int: rachel_correct = 0.9 * 45 malik_correct = 45 - 7 difference = rachel_correct - malik_correct result = difference return result
A box contains 12 oranges and 17 apples. What is the probability of picking an apple randomly from the box?
def solve() -> int: total_fruits = 12 + 17 probability_of_apple = 17 / total_fruits result = probability_of_apple return result
10. Scott bought some books for his niece that cost him $400 and he wants to give her a 25% discount. How much will he charge?
def solve() -> int: original_cost = 400 discount_percent = 25 discount_price = original_cost - (discount_percent / 100)*original_cost result = round(discount_price,2) return result
A recipe calls for 2 and 1/2 cups of flour. If you only have 1 and 1/4 cups of flour, how much more flour do you need?
def solve() -> int: required_flour = 2.5 current_flour = 1.25 remaining_flour = required_flour - current_flour result = remaining_flour return result
Emily's Buffet has 1500 plates of food required to serve 100 people. How many plates would be needed to feed 20% fewer people? Farmer John has 15 cows in his herd. He needs to milk each cow twice a day. If he already milked 25 cows and his assistant milked another 10, how many more cows do they need to milk for the nex...
def solve() -> int: plates_per_person = 1500 / 100 plates_needed = plates_per_person * 80 result = plates_needed cows_to_milk = 15 * 2 cows_already_milked = 25 + 10 cows_remaining = cows_to_milk - cows_already_milked cows_to_milk_next_2_days = cows_remaining * 2 result = cows_to_mil...
Jesse has 250 dimes in his wallet. He wants to buy a new video game that costs $49.99. After buying the game, how many dimes will he have left?
def solve() -> int: dimes = 250 cost = 49.99 money = dimes*0.1 change = money - cost result = int(change/0.1) return result
A triangle has a base of 14 cm and a height of 8 cm. What is the area of the triangle?
def solve() -> int: area = (14 * 8) / 2 result = area return result
Jessica wants to make fruit salad. The recipe calls for 2 cups of chopped strawberries and 3 cups of diced pineapples for 1 bowl of fruit salad. If Jessica wants to make 5 bowls of fruit salad, how many cups of strawberries does she need?
def solve() -> int: strawberries_per_bowl = 2 pineapples_per_bowl = 3 bowls_needed = 5 total_strawberries_needed = strawberries_per_bowl * bowls_needed result = total_strawberries_needed return result
Hank had 55 balls which he divided equally into 5 boxes. If he took 2 boxes of balls, how many balls are left? Emma is a chef in a restaurant. She can cook 50 dishes in one hour. How many dishes can Emma cook in 9 hours?
def solve() -> int: total_balls = 55 num_boxes = 5 balls_per_box = total_balls / num_boxes num_boxes_taken = 2 balls_left = (num_boxes - num_boxes_taken) * balls_per_box dishes_per_hour = 50 num_hours = 9 total_dishes = dishes_per_hour * num_hours result = balls_left, total...
arah wants to buy a new TV. The TV costs $500, but there is a 10% discount. How much does Sarah need to pay?
def solve() -> int: original_price = 500 discount_percentage = 0.1 discount_amount = original_price * discount_percentage sale_price = original_price - discount_amount result = sale_price return result
At the beginning of the week, Mark had 12 markers. During the week, he borrowed 4 markers from a friend and bought 8 more. How many markers does he have at the end of the week?
def solve() -> int: initial = 12 borrowed = 4 bought = 8 result = initial + borrowed + bought return result
am runs 3 miles every day. If he runs for 7 days, how many total miles does he run?
def solve() -> int: distance_per_day = 3 days = 7 total_distance = distance_per_day * days result = total_distance return result
If Eric's hat costs $10 more than Kyle's hat, and Kyle's hat costs $30 more than Mark's hat, and Mark's hat costs $5 less than John's hat, and lastly John's hat costs $40, how much did all the men spend on hats put together? Olivia wants to buy a new car. She plans to save 30% of her monthly salary for 10 months. If sh...
def solve() -> int: john_hat = 40 mark_hat = john_hat - 5 kyle_hat = mark_hat + 30 eric_hat = kyle_hat + 10 total_cost = john_hat + mark_hat + kyle_hat + eric_hat result = total_cost return result