question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A box of pencils weighs 4kgs. If 5 pencils weigh 50 grams, how many pencils are in the box?
def solve() -> int: total_weight_of_pencils = 4000 - 100 weight_of_1_pencil = 50 / 5 number_of_pencils = total_weight_of_pencils / weight_of_1_pencil result = number_of_pencils return result
A car can travel 25 miles per gallon of gas. If gas costs $3 per gallon, how much does it cost to travel 200 miles?
def solve() -> int: miles_per_gallon = 25 cost_per_gallon = 3 distance = 200 gallons_needed = distance / miles_per_gallon total_cost = gallons_needed * cost_per_gallon result = total_cost return result
David wants to save money to buy a bike which costs $450. He can save $15 each week. How many weeks will it take David to save enough money to buy the bike?
def solve() -> int: cost_of_bike = 450 savings_per_week = 15 weeks_needed = cost_of_bike / savings_per_week result = weeks_needed return result
A train travels 60 miles per hour. How many miles does it travel in 4 hours?
def solve() -> int: speed_mph = 60 hours = 4 distance_traveled = speed_mph * hours result = distance_traveled return result
A car rental company has 36 cars and wants to have equal numbers of each type: sedans, SUVs, and trucks. How many cars will be in each category?
def solve() -> int: num_cars = 36 num_categories = 3 cars_per_category = num_cars / num_categories result = cars_per_category return result
Student: Charlotte's car gets 25 miles per gallon of gas. She is planning a road trip of 500 miles. How many gallons of gas does she need for the trip?
def solve() -> int: miles_per_gallon = 25 trip_distance = 500 gallons = trip_distance / miles_per_gallon result = gallons return result
Student: A triangle has a base of 8 cm and a height of 10 cm. What is the area of the triangle?
def solve() -> int: base = 8 height = 10 area = 0.5 * base * height result = area return result
A restaurant serves 200 meals in the morning, then some more in the evening. If the restaurant had 500 meals to start with and only 100 meals left at the end of the day, how many meals were served in the evening? Tom wants to make enough cupcakes for his daughter's birthday party. He estimates that 2 out of every 5 cup...
def solve() -> int: morning_meals = 200 total_meals = 500 end_meals = 100 evening_meals = end_meals + morning_meals - total_meals result = evening_meals children = 20 ruined_cupcakes = 2/5 return result
Johnny has a bag of 50 large marbles and a bag of 70 small marbles. If he randomly picks one marble, what is the probability of it being a large marble?
def solve() -> int: total_marbles = 50 + 70 probability = 50/total_marbles result = probability return result
Student: Julie went to the store and bought 5 bottles of water. Each bottle had 1 liter of water. How many liters of water did Julie buy?
def solve() -> int: bottles = 5 liter_per_bottle = 1 total_liters = bottles * liter_per_bottle result = total_liters return result
Rachel received $3000 as a scholarship. She spent $800 on textbooks and saved half of the rest. How much money did Rachel save?
def solve() -> int: scholarship = 3000 textbooks = 800 remaining = scholarship - textbooks saved = remaining / 2 result = saved return result
Mia is baking cookies for a party. She has a recipe that makes 24 cookies using 2 cups of flour, 1 cup of sugar, and 0.5 cups of butter. She wants to make 60 cookies, but she only has 3 cups of flour, 2 cups of sugar, and 1 cup of butter. How many cookies can she make with the ingredients she has?
def solve() -> int: recipe = 24 flour = 2 sugar = 1 butter = 0.5 target = 60 flour_available = 3 sugar_available = 2 butter_available = 1 flour_ratio = flour_available / flour sugar_ratio = sugar_available / sugar butter_ratio = butter_available / butter min_ra...
Grace and Max are counting stones on the beach. Initially, Grace picks up 66 stones, while Max picks up 1/11 as many as Grace. They each decide to pick up 11 more stones each. How many stones did they pick up on average?
def solve() -> int: initial_stones_grace = 66 initial_stones_max = initial_stones_grace / 11 additional_stones = 11 total_stones_grace = initial_stones_grace + additional_stones total_stones_max = initial_stones_max + additional_stones total_stones = total_stones_grace + total_stones_max ave...
Maria runs for 30 minutes every day for a week. How many hours does she run in a week?
def solve() -> int: time = 30 days = 7 total_time = time * days result = total_time / 60 return result
A piece of rope is 8 meters long. If it is cut into 4 equal pieces, how long is each piece?
def solve() -> int: rope_length = 8 pieces = 4 piece_length = rope_length / pieces result = piece_length return result
If Mike can walk 5,000 steps in 25 minutes, how many steps will it take him to reach 12,000 steps?
def solve() -> int: total_steps = 12_000 time_taken = 25 rate = total_steps / time_taken result = rate * 60 return result
A train travels at a speed of 50 miles per hour. How long will it take to travel a distance of 150 miles?
def solve() -> int: distance = 150 speed = 50 time = distance / speed result = time return result
Tom's salary is $1500. He saves 20% of his salary every month. How much money does Tom save in a year?
def solve() -> int: tom_salary = 1500 monthly_savings = 0.2 * tom_salary yearly_savings = 12 * monthly_savings result = f'<<<{yearly_savings}>>>' result = yearly_savings return result
David bought seven pairs of shoes from the mall. For every pair he wore, he gifted one new pair from the remaining ones to his sister. How many new pairs of shoes did David give to his sister?
def solve() -> int: pairs_of_shoes_bought = 7 pairs_worn = pairs_of_shoes_bought pairs_given_to_sister = pairs_worn - 1 result = pairs_given_to_sister return result
Todd is buying flowers to plant in his garden. The flowers are $3 per plant and he wants 35 plants. If the sales tax is 6%, how much will Todd pay in total?
def solve() -> int: price_per_plant = 3 num_plants = 35 subtotal = price_per_plant * num_plants tax_rate = 0.06 total_price = subtotal * (1+tax_rate) result = total_price return result
Amy has a recipe that makes 24 muffins. She needs 3 eggs, 2 cups of flour, and 1 cup of milk for the recipe. How many eggs, cups of flour, and cups of milk does she need to make 72 muffins?
def solve() -> int: muffins_per_recipe = 24 eggs_per_recipe = 3 flour_per_recipe = 2 milk_per_recipe = 1 muffins = 72 recipes = muffins / muffins_per_recipe eggs = eggs_per_recipe * recipes flour = flour_per_recipe * recipes milk = milk_per_recipe * recipes result ...
At age 11, Emily can solve 10 math problems in 20 minutes. When she turns 16, she can solve 150% more problems than before. How many problems did she add per year?
def solve() -> int: age_11 = 11 age_16 = 16 problems_11 = 10 problems_16 = problems_11 * (1 + 150/100) years = age_16 - age_11 problems_added_per_year = (problems_16 - problems_11) / years result = problems_added_per_year return result
A bakery sells two types of bagels: regular bagels for $1.50 each and specialty bagels for $3.50 each. On Tuesday, the bakery sold 68 regular bagels and 28 specialty bagels. What was the total amount of money the bakery made?
def solve() -> int: no_of_regular = 68 no_of_specialty = 28 total_bakery_revenue = (no_of_regular * 1.5) + (no_of_specialty * 3.5) result = total_bakery_revenue return result
Lucy is 3 years younger than twice the age of her sister. If her sister is currently 14 years old, how old is Lucy?
def solve() -> int: sister_age = 14 lucy_age = 2 * sister_age - 3 result = lucy_age return result
Each box has 24 cookies and costs $8. She sold each cookie for $0.5 and donated 25% of the profit to a charity. How many dollars did she keep for herself?
def solve() -> int: total_cost = 12 * 8 total_revenue = 12 * 24 * 0.5 profit = total_revenue - total_cost donation = profit * 0.25 result = profit - donation return result
If a pizza costs $20 and is sliced into 8 equal pieces, what is the price per slice?
def solve() -> int: pizza_price = 20 num_slices = 8 price_per_slice = pizza_price / num_slices result = price_per_slice return result
Eric is making a bouquet of flowers. He needs 3 times as many roses as carnations and 8 times as many daffodils as carnations. If he buys a total of 24 flowers, how many of each are in the bouquet?
def solve() -> int: total_flowers = 24 carnations = None carnations = total_flowers / (3 + 8) roses = carnations * 3 daffodils = carnations * 8 result = [carnations, roses, daffodils] return result
Student: A baker makes 25 donuts each day costing $1 each. He sells each donut for $2. How much money does the baker make in a month if he works 20 days?
def solve() -> int: cost_per_donut = 1 price_per_donut = 2 donuts_per_day = 25 days_worked = 20 total_cost = cost_per_donut * donuts_per_day * days_worked total_revenue = price_per_donut * donuts_per_day * days_worked profit = total_revenue - total_cost result = profit return result...
Amber invested $1000 in two investments. One yielded 4.5% and the other yielded 2.6%. How much did she earn from each investment?
def solve() -> int: amount_invested = 1000 interest_1 = 0.045 interest_2 = 0.026 earned_1 = amount_invested * interest_1 earned_2 = amount_invested * interest_2 result = (earned_1, earned_2) return result
An airplane travels against a 50 km/h wind for 6 hours and then returns with the same wind for 4 hours. If the speed of the plane in still air is 360 km/h, what is the total distance the airplane traveled?
def solve() -> int: wind_speed = 50 still_speed = 360 time_in_air = 6+4 distance_with_wind = still_speed*time_in_air + wind_speed*6 distance_against_wind = still_speed*4 - wind_speed*4 total_distance = distance_with_wind + distance_against_wind result = total_distance return result
Emma has 20 quarters and 10 dimes. She buys 4 shirts for 5 quarters each and 1 scarf for 4 dimes. How much money, in cents, does she have left?
def solve() -> int: quarters = 20 dimes = 10 shirt_price = 5 scarf_price = 4 total_shirt_cost = 4 * shirt_price total_scarf_cost = 1 * scarf_price total_cost = total_shirt_cost + total_scarf_cost total_money = (quarters * 25) + (dimes * 10) money_left = total...
Mary bought 2 books. The first book has 150 pages and the second book has 25% more pages than the first book. How many total pages are in both books?
def solve() -> int: pages_in_first_book = 150 pages_in_second_book = pages_in_first_book*1.25 total_pages = pages_in_first_book + pages_in_second_book result = total_pages return result
Maya made 45 bracelets for her craft fair. She sold 12 to her teacher, 15 to her friend, and 6 to her sister. Then, she divided the remaining bracelets equally among her 3 customers. How many bracelets did each customer receive if she had no bracelets left after selling and giving them away?
def solve() -> int: bracelets_left = 45 - 12 - 15 - 6 bracelets_per_customer = bracelets_left // 3 result = bracelets_per_customer return result
An ice cream stand has six flavors: Vanilla, Chocolate, Strawberry, Oreo, Mint, and Rocky Road. Out of every 100 ice creams sold, 30 are Vanilla, 20 are Chocolate, 15 are Strawberry, 10 are Oreo, and the rest are Mint and Rocky Road combined. If the stand sells 300 ice creams in total, how many of them are Mint or Rock...
def solve() -> int: total_ice_creams = 300 vanilla = 0.3 * total_ice_creams chocolate = 0.2 * total_ice_creams strawberry = 0.15 * total_ice_creams oreo = 0.1 * total_ice_creams mint_and_rocky = total_ice_creams - vanilla - chocolate - strawberry - oreo result = mint_and_rocky return res...
Every day, Sophia collects seashells at the beach. On Monday, she collected 25 seashells. On Tuesday and Wednesday, she collected 35 seashells each. On Thursday, she collected 50 seashells but gave 10 of them to her best friend. How many seashells did Sophia have on Thursday after giving away 10?
def solve() -> int: monday_seashells = 25 tuesday_seashells = 35 wednesday_seashells = 35 thursday_seashells = 50 total_seashells = monday_seashells + tuesday_seashells + wednesday_seashells + thursday_seashells - 10 result = total_seashells return result
A rectangular garden has a width of 12 meters and a perimeter of 56 meters. What is the length of the garden?
def solve() -> int: perimeter = 56 width = 12 length = (perimeter - 2 * width) / 2 result = length return result
A train has four cars, each with 20 seats. The first car is reserved for VIP passengers, the second and third cars are for regular passengers, and the fourth car is for cargo. If the VIP car is 75% full, the second car is 40% full, the third car is 60% full, and the cargo car is empty, how many regular passengers are o...
def solve() -> int: vip_passengers = 0.75 * 20 second_car_passengers = 0.4 * 20 third_car_passengers = 0.6 * 20 regular_passengers = second_car_passengers + third_car_passengers result = regular_passengers return result
Emily has a 96 average on her eight quizzes. She wants to keep her average at 96 or higher by doing well on the ninth quiz. What is the lowest score she can get on the ninth quiz to maintain her average?
def solve() -> int: sum_of_eight = 96 * 8 lowest_score = 864 - sum_of_eight result = lowest_score return result
Student: A farmer has three fields, Field A, Field B, and Field C. The area of Field A is twice the area of Field B. The area of Field C is 50% of the area of Field A. If the area of Field B is 100 acres, find the total area of all three fields.
def solve() -> int: area_b = 100 area_a = 2 * area_b area_c = 0.5 * area_a total_area = area_a + area_b + area_c result = total_area return result
Kyle buys 7 notebooks that cost $7 each. He pays with a $50 bill. How much does Kyle get in change?
def solve() -> int: notebooks = 7 price_per_notebook = 7 amount_paid = 50 change = amount_paid - (notebooks*price_per_notebook) result = change return result
Ivette bought 12 apples for a total of $36. How much did she pay for each apple?
def solve() -> int: apples_bought = 12 total_price = 36 price_per_apple = total_price/apples_bought result = price_per_apple return result
The baking club sold 40 pies for $4 each and 50 muffins for $1 each. Then they bought 10 kg of flour for $2 per kg and 5 kg of sugar for $1.5 per kg. The rest of the money was used to buy 20 jars of jam. How much does a jar of jam cost?
def solve() -> int: income = 40 * 4 + 50 * 1 expenses = 10 * 2 + 5 * 1.5 remaining = income - expenses cost = remaining / 20 result = cost return result
A painting is worth $1500. If it decreases in value by 20%, what is its new value?
def solve() -> int: original_value = 1500 percent_decrease = 0.2 new_value = original_value * (1 - percent_decrease) result = new_value return result
The number of blue pens in a box is 2/3 of the total number of pens. If there are 40 black pens, and the box has 180 pens, calculate the total number of red pens.
def solve() -> int: blue = (2/3) * 180 red = 180 - 40 - blue result = red return result
A recipe calls for 2 cups of flour to make 12 cookies. How many cups of flour are needed to make 48 cookies?
def solve() -> int: cookies_required = 48 flour_required_per_cookie = 2/12 flour_required = cookies_required * flour_required_per_cookie result = flour_required return result
There are 12 chocolate bars in a box, and 8 boxes in a carton. If a carton of chocolate costs $38.40, what is the cost of one chocolate bar?
def solve() -> int: chocolates_in_a_box = 12 boxes_in_a_carton = 8 chocolates_in_a_carton = chocolates_in_a_box * boxes_in_a_carton cost_of_a_carton = 38.40 cost_of_one_chocolate_bar = cost_of_a_carton / chocolates_in_a_carton result = cost_of_one_chocolate_bar return result
Student: Joe bought 8 books and twice as many CDs. The books cost $13 each and the CDs cost $9 each. How much money did Joe spend?
def solve() -> int: num_books = 8 num_cds = 2 * num_books price_books = 13 price_cds = 9 total_cost = num_books * price_books + num_cds * price_cds result = total_cost return result
David exercises for 2 hours every day. He spends a quarter of the time doing yoga and the rest of the time doing Pilates. If he does Pilates for half the time he spends doing yoga, how much time in minutes does he spend doing yoga?
def solve() -> int: hours_per_day = 2 total_time = hours_per_day * 60 yoga_time = total_time / 4 pilates_time = total_time - yoga_time yoga_time /= 60 pilates_time /= 60 pilates_time /= 1.5 yoga_time *= 60 result = yoga_time return result
A veterinary clinic wants to order syringes for its clinic. If the clinic uses 9 syringes a day and they want to stock for a month, how many syringes should the clinic order if each box of syringes contains 12 syringes?
def solve() -> int: syringes_per_day = 9 days_in_month = 30 total_syringes_needed = syringes_per_day * days_in_month syringes_per_box = 12 boxes_needed = total_syringes_needed // syringes_per_box + (total_syringes_needed % syringes_per_box > 0) result = boxes_needed ...
At a bake sale, 8 volunteers each bring in $15 worth of treats to sell. First place for the highest sales gets 75% of the money, while the second and third place volunteers equally split the rest. How much money does each of the second and third place volunteers receive?
def solve() -> int: num_volunteers = 8 value_per_volunteer = 15 total_value = num_volunteers * value_per_volunteer first_place_money = 0.75 * total_value remaining_money = total_value - first_place_money second_third_money = remaining_money / 2 result = second_t...
Student: Joe has 64 crayons, which he distributes unevenly between 4 people. How many crayons did each person get?
def solve() -> int: num_crayons = 64 num_people = 4 crayons_per_person = num_crayons / num_people crayons_per_person = round(crayons_per_person) result = crayons_per_person return result
Sam went to a bakery to buy some cakes. He bought 3 chocolate cakes for $7 each and 2 strawberry cakes for $5 each. How much did Sam spend?
def solve() -> int: num_choc_cakes = 3 choc_cake_price = 7 num_straw_cakes = 2 straw_cake_price = 5 total_choc_cost = num_choc_cakes * choc_cake_price total_straw_cost = num_straw_cakes * straw_cake_price total_cost = total_choc_cost + total_straw_cost result = total_cost return resu...
At a grocery store, there are 5 cash registers, and each cashier can scan an average of 20 items per minute. The store has 200 customers per hour. How many cashiers does the store need to prevent long checkout lines?
def solve() -> int: minutes_in_an_hour = 60 items_per_register_per_hour = minutes_in_an_hour * 20 items_per_hour = items_per_register_per_hour * 5 customers_per_hour = 200 registers_needed = customers_per_hour * 1.1 / (items_per_hour * 1.1) result = round(registers_needed) return result
John is paid $20 per hour for his work. He works for 7 hours a day, 5 days a week. How much will he earn in a month of 25 working days?
def solve() -> int: hourly_wage = 20 hours_per_day = 7 days_per_week = 5 working_days = 25 hours_per_month = hours_per_day * days_per_week * working_days monthly_pay = hourly_wage * hours_per_month result = monthly_pay return result
If Emily's apartment is 800 square feet larger than Samuel's apartment and Samuel's apartment is 4000 square feet, what is the size of Emily's apartment?
def solve() -> int: samuels_apartment = 4000 emilys_apartment = samuels_apartment + 800 result = emilys_apartment return result
Sophia's triathlon is 100 kilometers long. If Sophia biked the first 10 kilometers in 25 minutes, swam the next 1 kilometer in 12 minutes and ran the last 89 kilometers in 6 minutes per kilometer, what was her average speed in (m/s) for the entire triathlon?
def solve() -> int: distance_biked = 10 time_biked = 25 distance_swam = 1 time_swam = 12 distance_ran = 89 time_ran = distance_ran * 6 total_distance = distance_biked + distance_swam + distance_ran total_time = time_biked + time_swam + time_ran average_speed = tot...
Sarah wants to go on a trip to Europe. The cost of the plane ticket is $800 and the hotel costs $200 a night for 7 nights. After the trip, she needs to pay $1000 for souvenirs but only 50% of it is covered by her insurance. What is her out-of-pocket cost?
def solve() -> int: ticket_cost = 800 hotel_cost = 200 * 7 souvenir_cost = 1000 insurance_coverage = 0.5 total_cost = ticket_cost + hotel_cost + souvenir_cost insurance_paid = souvenir_cost * insurance_coverage out_of_pocket_cost = total_cost - insurance_paid result = out_of_po...
Student: Each side of a square measures 15 cm. What is the area of the square?
def solve() -> int: side = 15 area = side * side result = area return result
Jake is standing next to a flagpole. At the same time, Jake and the flagpole are casting shadows - the flagpole of 5 meters and Jake of 0.4 meters. Jake is 1.6 meters tall. How tall is the flagpole?
def solve() -> int: jake_height = 1.6 jake_shadow = 0.4 flagpole_shadow = 5 flagpole_height = (jake_height / jake_shadow) * flagpole_shadow result = flagpole_height return result
A news article has 750 words. If you have to write an essay that is 5 times as long as the news article, how many words will your essay be?
def solve() -> int: news_article_words = 750 essay_words = news_article_words * 5 result = essay_words return result
Sophia walks 7 kilometers every Monday through Wednesday. Then she walks four times as far as she did on Monday every Thursday and Friday. How many kilometers will she walk in a month with 5 weeks? A fragile glass shelf can hold up to 50 pounds of weight. Amy, Ben, and Cindy each have a box to place on the shelf. Ben's...
def solve() -> int: sophia_mon_wed = 7 * 3 sophia_thu_fri = 4 * 7 sophia_month = (sophia_mon_wed + sophia_thu_fri) * 5 amy_box = 20 ben_box = amy_box - 8 cindy_box = ben_box + 3 total_weight = amy_box + ben_box + cindy_box result = sophia_month + total_weight ...
Jack buys 6 jumbo hot dogs for $3.00 each at a ballpark. While there, he decides to pick up some nachos for $7.00, which isSamantha and Emma played 10 rounds of chess. Samantha won 7 rounds. How many rounds did Emma win?
def solve() -> int: hot_dog_price = 3.00 num_hot_dogs = 6 nachos_price = 7.00 total_hot_dog_cost = hot_dog_price * num_hot_dogs total_cost = total_hot_dog_cost + nachos_price samantha_wins = 7 total_rounds = 10 emma_wins = total_rounds - samantha_wins result = emma_win...
Anna has 72 pencils. She keeps half of them and gives away 15. How many pencils does Anna have now?
def solve() -> int: pencils = 72 keep = 0.5 give_away = 15 pencils = pencils * keep pencils = pencils - give_away result = pencils return result
A car travels at 60 miles per hour. How many kilometers per minute does it travel?
def solve() -> int: speed_mph = 60 speed_kph = speed_mph * 1.60934 speed_kpm = speed_kph / 60 result = speed_kpm return result
arah invests some money at 8% per year. After 4 years, the investment is worth $3,500. How much did Sarah invest?
def solve() -> int: time = 4 rate = 0.08 future_value = 3500 present_value = future_value / ((1 + rate) ** time) result = present_value return result
A rectangular swimming pool is 25 meters long and 10 meters wide. It has a uniform depth of 2 meters. How many cubic meters of water does it hold?
def solve() -> int: length = 25 width = 10 depth = 2 volume = length * width * depth result = volume return result
Sarah purchases a carton of milk. Each serving is 8 ounces. She uses 2 servings every day. If the container is 2 ounces less than 1 liter, how many days will it last?
def solve() -> int: carton_size = 1000 - 2 serving_size = 8 servings_per_day = 2 total_servings = carton_size / serving_size days = total_servings / servings_per_day result = days return result
A company has a payroll of $90,000 per month, which is divided equally among 30 employees. How much does each employee receive per year?
def solve() -> int: payroll_per_month = 90000 num_employees = 30 pay_per_employee_month = payroll_per_month / num_employees pay_per_employee_year = pay_per_employee_month * 12 result = pay_per_employee_year return result
Jane and John drove from their house to the beach, a distance of 200 miles. Jane drove 3 times as fast as John. If it took John 6 hours to reach the beach, how fast was Jane driving in miles per hour?
def solve() -> int: john_speed = 200 / 6 jane_speed = john_speed * 3 result = f'Jane drove at a speed of {jane_speed} miles per hour.' result = jane_speed return result
A garden has 8 pear trees and 6 apple trees. If each piece of fruit from each tree weighs the same, how many kilograms of fruit will the garden produce altogether in 6 weeks?
def solve() -> int: pear_trees = 8 apple_trees = 6 weight = 1 weeks = 6 total_fruits = pear_trees * 8 * weeks + apple_trees * 6 * weeks total_weight = total_fruits * weight result = total_weight return result
Seven years ago, Tom was only one-sixth as old as Jess. If Jess is currently five times 10 years old, how old is Tom?
def solve() -> int: jess_age = 5 * 10 tom_age_7_years_ago = jess_age / 6 tom_age = tom_age_7_years_ago + 7 result = tom_age return result
A school has 120 students and 6 teachers. Each teacher teaches 20 students. The school decides to hire 2 more teachers and split the students into 8 equal groups. How many students will each teacher teach after the change?
def solve() -> int: students = 120 teachers = 6 new_teachers = 2 new_total_teachers = teachers + new_teachers new_students_per_teacher = students / new_total_teachers result = new_students_per_teacher return result
Sarah is buying a new bicycle that costs $500. She decides to finance the purchase with a bank loan for $300 at a 6% interest rate. How much money in total will Sarah have to repay to purchase the bicycle?
def solve() -> int: loan_amount = 300 interest_rate = 0.06 bicycle_cost = 500 interest_amount = loan_amount * interest_rate total_amount = loan_amount + interest_amount result = total_amount + bicycle_cost return result
Possible math questions and programs: Lisa bought two books and a pencil case at the bookstore. The books cost $12 and $15 respectively, and the pencil case cost $8. She paid with a $50 bill and received some change. How much change did she receive?
def solve() -> int: total_cost = 12 + 15 + 8 change = 50 - total_cost result = change return result
Alex has 60 candies, which is 10 less than six times as many candies as Maria has. Emily has thrice as many candies as Maria. How many candies does Emily have?
def solve() -> int: candies_maria = (60+10)/6 candies_emily = 3 * candies_maria result = candies_emily return result
If a pizza has a diameter of 16 inches, what is its circumference?
def solve() -> int: diameter = 16 radius = diameter / 2 pi = 3.14 circumference = 2 * pi * radius result = circumference return result
Jackson has 7 aunts and uncles. 2 of them have birthdays in January, 1 has a birthday in April, 1 has a birthday in July, 1 has a birthday in October, and the last 2 have birthdays in December. If Jackson always buys each of his aunts and uncles a birthday present and a Christmas present, how many more presents does he...
def solve() -> int: aunts_and_uncles = 7 january_birthdays = 2 april_birthdays = 1 july_birthdays = 1 october_birthdays = 1 december_birthdays = 2 first_half_birthdays = january_birthdays + april_birthdays + july_birthdays second_half_birthdays = october_birthdays + december_birthda...
Alicia had $30 and she spent half of it when she went to the store, how much money did she spend?
def solve() -> int: amount_initially = 30 amount_spent = amount_initially/2 result = amount_spent return result
John wants to replace his car tires. The cost of 1 tire is $75. He wants to replace all 4 tires. In addition to the cost of the tires, he will have to pay $15 for installation. He plans to use his credit card with an interest rate of 10% per year and make equal monthly payments for 3 months. What is the minimum monthly...
def solve() -> int: tire_cost = 75 installation_cost = 15 number_of_tires = 4 interest_rate = 0.1 months = 3 total_cost = tire_cost * number_of_tires + installation_cost interest = total_cost * interest_rate * months total_cost_with_interest = total_cost + interest minimum_month...
Student: Mary rented a car for 25 euros per day and had it for 5 days. How much money did she spend?
def solve() -> int: daily_rate = 25 days_rented = 5 total_cost = daily_rate * days_rented result = total_cost return result
Paul has 72 crayons. He received 10 crayons from his friends. If he uses 25 crayons, how many crayons does he have left?
def solve() -> int: total_crayons = 72 received_crayons = 10 used_crayons = 25 remaining_crayons = total_crayons + received_crayons - used_crayons result = remaining_crayons return result
Leo saves $10 every week from his allowance and puts it in a piggy bank. He also gets $50 from his grandparents on his birthday and $20 from his aunt on Christmas. He wants to buy a skateboard that costs $120. How many weeks does he need to save to buy the skateboard?
def solve() -> int: total_money = 0 number_of_weeks = 0 while total_money < 120: total_money = total_money + 10 number_of_weeks = number_of_weeks + 1 if number_of_weeks == 7: total_money = total_money + 50 elif number_of_weeks == 52: total_money = t...
Dave has a raw squat of 677 pounds without sleeves or wraps. Sleeves add 10 pounds to his lift. Wraps add 30% to his squat. How much more pounds does he get out of wraps versus sleeves?
def solve() -> int: raw_squat = 677 add_from_sleeves = 10 add_from_wraps = raw_squat * 0.3 result = add_from_wraps - add_from_sleeves return result
Alex has 42 stickers. He gave 14 to his friend. How many stickers does he have left?
def solve() -> int: total_stickers = 42 stickers_given = 14 stickers_left = total_stickers - stickers_given result = stickers_left return result
Dylan has 10 friends. Each friend has 5 pencils. How many pencils does Dylan have in total?
def solve() -> int: number_of_friends = 10 number_of_pencils = 5 total_pencils = number_of_friends * number_of_pencils result = total_pencils return result
A store sells a jacket for $80. If the store owner bought it at 40% off, what was the original price of the jacket?
def solve() -> int: discount = 0.4 discounted_price = 80 original_price = discounted_price / (1 - discount) result = original_price return result
John has $500 in his bank account. Every year, he makes a deposit that is half of the current balance in his account. If John does not withdraw any money, how much money will he have in his account after 3 years?
def solve() -> int: balance = 500 for i in range(3): balance += balance/2 result = balance return result
During a video game tournament, Kevin earned a total of 400 points over the course of 20 games played. In the final game of the tournament, he only earned one-third of the points he had previously scored for each game. However, he still won the championship by 10 points. How many points did his opponent score in the fi...
def solve() -> int: total_points = 400 num_games = 20 avg_points_per_game = total_points / num_games final_game_points = avg_points_per_game / 3 championship_points = total_points + 10 opponent_points = championship_points - final_game_points result = opponent_points return res...
A museum decided to host an art exhibit. There are eleven themes of art they can showcase. They want every third artwork to be a sculpture, and they agreed to exhibit equal numbers of paintings, drawings, and photographs. How many of each type of artwork will they exhibit?
def solve() -> int: num_themes = 11 num_artworks = 3 * num_themes num_sculptures = num_artworks // 3 num_paintings_drawings_photos = num_artworks - num_sculptures num_each_type = num_paintings_drawings_photos // 3 result = f'{num_each_type} paintings, {num_each_type} drawings...
Tom is flying a kite. If Tom increases the length of his kite string by 250 meters and the kite string has a total length of 400 meters now, how long was Tom's kite string before he increased it?
def solve() -> int: new_length = 400 increased = 250 old_length = new_length - increased result = old_length return result
A recipe calls for 2.5 cups of flour. If you have only 1 cup measuring cup, how many times will you need to fill the cup to get the amount of flour you need?
def solve() -> int: flour_needed = 2.5 measuring_cup_size = 1 cups_to_fill = flour_needed / measuring_cup_size result = cups_to_fill return result
Student: Emily has 24 stamps and she gives half to her friend. How many stamps does her friend have now?
def solve() -> int: stamps_emily = 24 stamps_friend = stamps_emily / 2 result = stamps_friend return result
Luther has 200 coins. Some of them are quarters and some of them are dimes. He has 3 times as many dimes than quarters. How many of each coins does Luther have?
def solve() -> int: quarters = 0 dimes= 0 while quarters * 3 + dimes < 200: quarters += 1 dimes += 3 result = "quarters: {}, dimes: {}".format(quarters,dimes) return result
Ava has $200 in her purse and $3000 invested in a real estate project. If the project's value increases by 20% and she sells all of it, how much money will she have in her purse?
def solve() -> int: purse_money = 200 investment_money = 3000 increase_percentage = 20 increase_amount = investment_money * increase_percentage / 100 total_money = purse_money + investment_money + increase_amount result = total_money return result
Student: A train can carry 200 passengers. If there are 4 trips per day and the train runs for 6 days a week, how many passengers can ride the train in a month of 30 days?
def solve() -> int: passengers_per_trip = 200 trips_per_day = 4 days_per_week = 6 days_per_month = 30 passengers_per_day = passengers_per_trip * trips_per_day passengers_per_week = passengers_per_day * days_per_week passengers_per_month = passengers_per_week * (days_per_month / 7) ...
Student: A toy manufacturer produces 10 dolls every 8 minutes. How many dolls can be produced in one hour?
def solve() -> int: dolls_per_8_minutes = 10 minutes_per_hour = 60 dolls_per_minute = dolls_per_8_minutes / 8 dolls_per_hour = dolls_per_minute * minutes_per_hour result = dolls_per_hour return result
A train travels 200 miles at a speed of 50 miles per hour. How long did it take to complete the journey?
def solve() -> int: distance = 200 speed = 50 time = distance / speed result = time return result
Yesterday, Emily solved 10 math problems. Each day, she plans to solve 3 more than the previous day. If Emily solves math problems for six consecutive days, how many problems will she solve on the sixth day?
def solve() -> int: problems_solved = 10 days = 6 problems_sixth_day = problems_solved + (days - 1) * 3 result = problems_sixth_day return result
Kim read 120 pages of a book in 4 hours. Lee read the same book at a rate of 25 pages per hour and finished it in 6 hours. Mei started reading the same book after Lee finished and read 40 pages in 2 hours. How many pages are in the book?
def solve() -> int: lee_pages = 25 * 6 kim_mei_pages = 120 + 40 lee_extra_pages = lee_pages - kim_mei_pages kim_less_hours = lee_extra_pages / (25 - 30) lee_kim_hours = kim_less_hours + 4 lee_kim_pages = lee_kim_hours * 30 book_pages = lee_kim_pages + 40 result = book_pages return r...
Student: John has 3 times as much money as Jane. If Jane has $20, how much money does John have?
def solve() -> int: jane_money = 20 john_money = jane_money * 3 result = john_money return result