question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A supermarket sells fruits by the pounds. John bought 3.5 pounds of apples for $6.13. If he bought the same amount of oranges with the same price per pound. How much would 4 pounds and 8 ounces of oranges cost?
def solve() -> int: pounds_apples = 3.5 price_apples = 6.13 price_per_pound = price_apples / pounds_apples weight_oranges = 4 + 8/16 price_oranges = weight_oranges * price_per_pound result = price_oranges return result
A student has a final grade of 80% in a course. The final exam is worth 50% of the total grade. What is the student's grade on the final exam?
def solve() -> int: final_grade = 80 final_exam_pct = 50 final_exam_grade = (final_grade/(final_exam_pct/100))-(100-final_exam_pct) result = final_exam_grade return result
Last week, Greg went to the grocery store and found 4 apples for a total cost of 8 dollars. If he wanted to buy 8 apples, how much money would he need to spend?
def solve() -> int: cost = 8 apples = 4 price_of_one = cost / apples cost_of_all = price_of_one * 8 result = cost_of_all return result
Michael has been offered a job that pays him 25 dollars an hour, for 50 hours per week. He estimates that 12 percent of his pay will be withheld for taxes and insurance. Assuming Michael works 44 weeks in a year, what is his yearly take-home pay?
def solve() -> int: hourly_pay = 25 weekly_hours = 50 tax_insurance_rate = 0.12 weeks_per_year = 44 weekly_pay = hourly_pay * weekly_hours tax_insurance_withheld = weekly_pay * tax_insurance_rate weekly_take_home_pay = weekly_pay - tax_insurance_withheld yearly_take_home_pay = weekl...
John had 40 apples and his friend Mark had a fifth as many apples. On Thanksgiving, their aunt gave each of them an equal amount of apples so that they had a total of 90 apples. How many apples did their aunt give each of them?
def solve() -> int: john_apples = 40 mark_apples = john_apples / 5 total_apples = 90 aunt_apples = (total_apples - john_apples - mark_apples) / 2 result = aunt_apples return result
Student: If Lester buys 17 books for $86, how much does each book cost?
def solve() -> int: num_books = 17 total_cost = 86 cost_per_book = total_cost / num_books result = cost_per_book return result
Emma was invited to a neighbor's house for dinner and she decided to walk there. She had covered 311 m the first day and then she ran 267 m the following day. How many meters did Emma travel to reach her destination?
def solve() -> int: distance_day_1 = 311 distance_day_2 = 267 total_distance = distance_day_1 + distance_day_2 result = total_distance return result
At Becky's birthday party, each person was given a goody bag that contained 6 balloons, 5 magnets, and 3 stickers. If there were 25 people at the party, how many goody bags were given out in total?
def solve() -> int: num_people = 25 num_bags = num_people result = num_bags return result
There are 2 packs of pencils, each containing 35 pencils. How many pencils in total?
def solve() -> int: count = 0 for pack in range(1, 3): count += 35 result = count return result
A pizza has 8 slices. If you eat 2 slices, what percentage of the pizza have you eaten?
def solve() -> int: total_slices = 8 slices_eaten = 2 percent_eaten = (slices_eaten / total_slices) * 100 result = percent_eaten return result
A scientist believes that one in every two turtles in a pond has a shell deformity. If 100 new turtles are born in the pond, how many are likely to have shell deformity?
def solve() -> int: total_turtles = 100 deformity_probability = 1/2 turtles_with_deformity = total_turtles * deformity_probability result = turtles_with_deformity return result
A factory produces 5000 shoes per day. If 4% of the shoes turn out to be defective, how many good shoes are produced in a week?
def solve() -> int: shoes_per_day = 5000 defective_percentage = 0.04 good_shoes_per_day = shoes_per_day * (1 - defective_percentage) good_shoes_per_week = good_shoes_per_day * 7 result = good_shoes_per_week return result
Possible math questions and programs are: Lila runs a bakery. She needs 3 cups of flour and 2 cups of sugar for one cake, and 2 cups of flour and 1 cup of sugar for one batch of cookies. She wants to bake 10 cakes and 15 batches of cookies. How many cups of flour and sugar does she need in total?
def solve() -> int: flour_cake = 3 sugar_cake = 2 flour_cookie = 2 sugar_cookie = 1 flour_total = (flour_cake * 10) + (flour_cookie * 15) sugar_total = (sugar_cake * 10) + (sugar_cookie * 15) result = f"Lila needs {flour_total} cups of flour and {sugar_total} cups of sugar in total...
Student: Colin is vacationing in a beach town where the local currency is recycled into new coins. On the first day, 1/4 of the coins were recycled, 2/3 of the coins remaining were recycled on the second day, and the remaining coins were recycled on the third day. If there were 600 coins in total to start, how many coi...
def solve() -> int: coins = 600 coins_recycled_1 = coins // 4 coins_left_1 = coins - coins_recycled_1 coins_recycled_2 = coins_left_1 * 2 // 3 coins_left_2 = coins_left_1 - coins_recycled_2 coins_recycled_3 = coins_left_2 result = coins_recycled_3 return result
Student: At a track-and-field event, 7 schools are participating, with 10 students in each school. Each student gets a pair of running shoes and a pair of spikes. How many pairs of shoes have been distributed?
def solve() -> int: num_schools = 7 num_students = 10 num_shoes_per_student = 2 total_shoes = num_schools * num_students * num_shoes_per_student result = total_shoes return result
A class has 24 students, and each student has 8 pencils and 4 erasers. How many pencils and erasers does the class have in total?
def solve() -> int: pencils = 24 * 8 erasers = 24 * 4 result = pencils + erasers return result
A rectangle has a length that is three times the width. If the area of the rectangle is 48 square meters, what is the length of the rectangle?
def solve() -> int: area = 48 width = ((area/3)**0.5) length = 3 * width result = length return result
Student: Arthur is 3 years older than Susan, while Bob is 6 months younger than Tom. If Tom is 13 years old, how old is Susan?
def solve() -> int: arthur_age = 0 susan_age = 0 bob_age = 0 tom_age = 13 arthur_age = tom_age + 3 susan_age = arthur_age - 3 bob_age = tom_age - 6/12 result = susan_age return result
Melissa invested $5,000 at an annual interest rate of 4.5% for 3 years. What is the total amount of interest earned?
def solve() -> int: principal = 5000 rate = 0.045 time = 3 interest = principal * rate * time result = interest return result
Jacob is twice as old as his sister Emily. If Emily is 10 years old, how old is Jacob?
def solve() -> int: jacob_age = 2 * 10 result = f'<<<Jacob is {jacob_age} years old.>>>' result = jacob_age return result
Tom and his friend go to the movies. Tom buys a ticket for $14 and his friend buys a ticket for $12. His friend pays for half the tickets and Tom pays for the snacks, which cost $10. How much did Tom pay?
def solve() -> int: tom_ticket = 14 friend_ticket = 12 total_cost = tom_ticket + friend_ticket + 10 tom_pays = total_cost / 2 - friend_ticket result = tom_pays return result
Mrs. Lopez had 20 meters of ribbon. She cut 4 meters of ribbon to make a bow and 3 meters of ribbon to wrap a present. She also used 1/4 of the remaining ribbon to decorate a cake. How many meters of ribbon did she have left?
def solve() -> int: used_ribbon = 4 + 3 remaining_ribbon = 20 - used_ribbon cake_ribbon = remaining_ribbon / 4 left_ribbon = remaining_ribbon - cake_ribbon result = left_ribbon return result
A group of friends want to share a bill of $100. If each person pays $15, how many people are in the group?
def solve() -> int: bill = 100 per_person = 15 num_people = bill // per_person result = num_people return result
Dan has 3 boxes of apples. Each box contains 9 apples. He gives 2 apples to his friend. How many apples does he have left?
def solve() -> int: box_apples = 9 num_boxes = 3 num_given = 2 result = box_apples * num_boxes - num_given return result
Johnny needs to take vitamins twice a day. His mom, Susie, and dad, James, sometimes forget if they already gave him his vitamins. One day, starting with a new container of 60 vitamins, Susie gives him 5 vitamins in the morning and 4 at night. James also gave him 3 vitamins in the afternoon and double the number he had...
def solve() -> int: morning_vitamins = 5 night_vitamins = 4 afternoon_vitamins = 3 total_vitamins = 60 total_vitamins -= morning_vitamins total_vitamins -= night_vitamins total_vitamins -= afternoon_vitamins afternoon_vitamins *= 2 total_vitamins -= afternoon_vita...
Supposing Fatima charged her electric bike for 10 hours, and each hour of charge gives 4 miles of use, how far can she go before needing to recharge her bike if she charged it for 3/5 of the time she charged it last night?
def solve() -> int: hours_charged = 10 miles_per_hour = 4 fraction_of_time_charged = 3/5 total_miles = hours_charged * miles_per_hour charged_for_hours = hours_charged * fraction_of_time_charged miles_before_recharge = charged_for_hours * miles_per_hour result = miles_before_rechar...
Marie had 20 pencils and she wanted to give half of them away to her friend. How many pencils would be left with Marie?
def solve() -> int: pencils_Marie = 20 pencils_given = pencils_Marie / 2 result = pencils_Marie - pencils_given return result
Mia has 4 packs of cookies, each with 10 cookies. She shares 2 packs with her sister and 1 pack with her brother. Then she eats 3 cookies from the remaining pack. How many cookies does Mia have left?
def solve() -> int: total_cookies = 4 * 10 shared_cookies = 2 * 10 + 1 * 10 eaten_cookies = 3 left_cookies = total_cookies - shared_cookies - eaten_cookies result = left_cookies return result
A company produces 2000 bottles of juice daily. If 5% of the bottles are defective, how many bottles are good?
def solve() -> int: total_bottles = 2000 defective_percentage = 0.05 defective_bottles = total_bottles * defective_percentage good_bottles = total_bottles - defective_bottles result = good_bottles return result
amantha drives from New York to Los Angeles, which is a distance of 2800 miles. She drives for 10 hours each day for 7 days straight. How fast was she driving, on average, in miles per hour?
def solve() -> int: total_distance = 2800 total_hours = 7 * 10 average_speed = total_distance / total_hours result = average_speed return result
A couple went out for dinner and their total bill came to $110. The couple left a 15% tip as a reward for the server. How much did the couple pay in total?
def solve() -> int: total_bill = 110 tip_amount = total_bill * 0.15 total_amount = total_bill + tip_amount result = total_amount return result
Jack bought 12 items for his workout routine, including weights, resistance bands, and yoga mats. He bought 3 times as many weights as he did resistance bands. He also bought 2 more yoga mats than he did resistance bands. How many resistance bands did he buy?
def solve() -> int: resistance_bands = 2 result = resistance_bands return result
In a store, the price of a shoe is $65. If a customer buys 5 pairs of shoes, what is the total cost?
def solve() -> int: price = 65 shoes = 5 total_cost = price*shoes result = total_cost return result
Grace had 36 golf balls. She used 12 of them for practice and gave 20% of the remaining ones to her coach. Then she found 6 more golf balls in the grass and kept them. How many golf balls did Grace have at the end?
def solve() -> int: total_balls = 36 used_balls = 12 left_balls = total_balls - used_balls percent_given = 0.2 given_balls = percent_given * left_balls left_balls = left_balls - given_balls found_balls = 6 kept_balls = found_balls end_balls = left_balls + kept_...
Tom borrows $1000 from a bank at an interest rate of 8% per annum. If he pays back the loan in 3 years, what is the total amount he needs to pay back?
def solve() -> int: principal = 1000 interestRate = 0.08 time = 3 interestAmount = principal * interestRate * time totalAmount = principal + interestAmount result = totalAmount return result
Jack has $20 and his three siblings have $6 each. How much should Jack give to each of his siblings so that they will have the same amount of money?
def solve() -> int: jack_money = 20 sibling_money = 6 total_siblings = 3 total_money = jack_money + (sibling_money * total_siblings) amount_to_give = (total_money - jack_money) / total_siblings result = amount_to_give return result
Max has a collection of 30 miniature figurines. He finds 12 more while on vacation and buys 6 more every week for the next 4 weeks. He then loses 2 of them when his cat knocks them over. How many miniature figurines does he have now?
def solve() -> int: total_figurines = 30 + 12 + (6 * 4) lost_figurines = 2 total_figurines -= lost_figurines result = total_figurines return result
Alex is playing chess and makes a move every 15 seconds. If a game of chess lasts for 30 minutes, how many moves will he make during the entire game? The Burger Joint offers a signature burger with two beef patties, three slices of bacon, and a tablespoon of secret sauce. If each package of bacon has 12 slices and the ...
def solve() -> int: moves_per_minute = 4 moves_per_game = moves_per_minute * 30 bacon_per_burger = 3/12 burgers_per_hour = 6 burgers_per_day = burgers_per_hour * 12 bacon_per_day = burgers_per_day * bacon_per_burger packages_of_bacon = bacon_per_day / 12 result = packages_of_bacon ...
A museum has 50 different statues on display, with 8 statues made from stone, 18 statues made from metal, and 2 statues made from both stone and metal. Michael only likes metal statues and wants to take a picture with one, but he is willing to stand next to 3 statues that are made from both stone and metal. How many me...
def solve() -> int: stone = 8 metal = 18 both = 2 metal_only = metal - both michael_willing = 3 metal_for_picture = metal_only - michael_willing result = metal_for_picture return result
In a trapezoid with parallel sides of lengths 5 and 8, and height of length 4, calculate the length of the non-parallel side.
def solve() -> int: parallel_side1 = 5 parallel_side2 = 8 height = 4 non_parallel_side = (height**2 + (parallel_side2 - parallel_side1)**2)**0.5 result = non_parallel_side return result
Student: A circular pond has a diameter of 10 meters. If the pond is surrounded by a walkway with a uniform width of 2 meters, what is the area of the walkway?
def solve() -> int: d = 10 w = 2 r = d/2 c = 2 * 3.14 * r result = c * w return result
Student: There are three boxes in a cupboard. Box 1 contains 12 apples, box 2 contains 30 apples and box 3 contains 25 apples. If the total weight of all the apples is 18kg, how much does one apple weigh?
def solve() -> int: box1 = 12 box2 = 30 box3 = 25 total_apples = box1 + box2 + box3 one_apple = 18 / total_apples result = one_apple return result
The first act has 25 minutes of dialogue and 10 minutes of songs. The second act has 20 minutes of dialogue and 15 minutes of songs. The rest is applause. How many minutes of applause are in the play?
def solve() -> int: total_time = 25 + 10 + 20 + 15 applause_time = 90 - total_time - 15 result = applause_time return result
A school has four classes: A, B, C and D. Class A has 25 students, class B has 20 students, class C has 18 students and class D has 22 students. The school organizes a field trip and each class needs one bus. A bus can fit 30 students. How many empty seats are there in total on the four buses?
def solve() -> int: class_A = 25 class_B = 20 class_C = 18 class_D = 22 bus_capacity = 30 empty_A = bus_capacity - class_A empty_B = bus_capacity - class_B empty_C = bus_capacity - class_C empty_D = bus_capacity - class_D total_empty = empty_A + empty_B + empty_C +...
Ethan owns 2 parakeets and 4 canaries. Silvia owns half as many parakeets and one more canary than Ethan. Ismael owns one less canary than Ethan and no parakeets. How many birds are there in total?
def solve() -> int: n_ethan_parakeets = 2 n_ethan_canaries = 4 n_silvia_parakeets = n_ethan_parakeets/2 n_silvia_canaries = n_ethan_canaries + 1 n_ismael_parakeets = 0 n_ismael_canaries = n_ethan_canaries - 1 total_parakeets = n_ethan_parakeets + n_silvia_parakeets + n_ismael_...
Noah has a fish tank that can hold 40 liters of water. He fills it with 30 liters of water and adds some fish. The fish need 4 liters of water per fish to survive. How many fish can Noah add to the tank without harming them?
def solve() -> int: available_water = 40 - 30 fish_number = available_water // 4 result = fish_number return result
Student: Kevin collects stamps from different countries. He has 36 stamps from Canada, 24 stamps from France, and 18 stamps from Japan. He wants to arrange them in equal rows in his album. What is the largest number of rows he can make without mixing stamps from different countries?
def solve() -> int: canada_stamps = 36 france_stamps = 24 japan_stamps = 18 canada_rows = canada_stamps // canada_stamps france_rows = france_stamps // france_stamps japan_rows = japan_stamps // japan_stamps rows = min(canada_rows, france_rows, japan_rows) result = rows return resul...
A bike costs $200 and is on sale for 30% off. How much will the bike cost after the discount?
def solve() -> int: bike_price = 200 discount = bike_price * 0.3 price_after_discount = bike_price - discount result = price_after_discount return result
Lisa has a bag of 420 crayons. If she gives 3/7 of the crayons to her little brother, how many crayons will be left in the bag?
def solve() -> int: num_crayons = 420 given_away = num_crayons * 3/7 crayons_left = num_crayons - given_away result = crayons_left return result
John wants to paint his room. One paint can covers 20 square meters. The room is rectangular with dimensions 4 meters by 5 meters. How many paint cans does he need?
def solve() -> int: length = 5 width = 4 area = length * width paint_cans = area/20 result = paint_cans return result
A pair of shoes costs $60, with the addition of a 10% discount. What is the final price?
def solve() -> int: original_price = 60 discount_percentage = 0.1 final_price = original_price * (1 - discount_percentage) result = final_price return result
Elizabeth needs to buy a certain amount of paper for her office. She needs 5/8 of a stack of paper. If there are 24 sheets of paper in 1 stack, how many sheets of paper will Elizabeth buy?
def solve() -> int: stack = 1 paper = 24 fraction = 5/8 decimal = fraction * 1 result = decimal * paper return result
Student: On the planet Lixar, there are two modes of transportation: the Flinxes and the Slixes. Each Flinx can carry 6 passengers and costs 8 Lixar coins, while each Slix can carry 4 passengers and costs 5 Lixar coins. If a Lixar travel agency needs to transport 36 passengers with the minimum cost, how many Flinxes an...
def solve() -> int: num_passengers = 36 cost_Flinx = 8 cost_Slix = 5 capacity_Flinx = 6 capacity_Slix = 4 num_Flinx = num_passengers // capacity_Flinx num_Slix = (num_passengers - num_Flinx * capacity_Flinx) // capacity_Slix result = num_Flinx * cost_Flinx + num_Slix * cost_Slix ret...
Sophia has 3 pet birds. The first bird needs 3 teaspoons of seed every 2 days and the other two need 2 more teaspoons of seed than the first one. If Sophia has to feed the birds every day, how many teaspoons of seed will she need in four days?
def solve() -> int: num_birds = 3 seed_first_bird = 3 seed_other_birds = seed_first_bird + 2 total_seed_daily = (seed_first_bird + seed_other_birds * 2) * num_birds seed_four_days = total_seed_daily * 4 result = seed_four_days return result
Student: If Harry runs at a speed of 12 km/hour for 5 hours, how far would he have traveled in total?
def solve() -> int: speed = 12 time = 5 distance = speed * time result = distance return result
A video rental store charges $3 per day to rent a DVD and $5 per day to rent a Blu-ray. If a customer rented 2 DVDs and 1 Blu-ray for 4 days, what is the total cost?
def solve() -> int: dvd_price = 3 blu_ray_price = 5 num_dvds = 2 num_blu_rays = 1 rental_days = 4 total_cost = (dvd_price*num_dvds*rental_days) + (blu_ray_price*num_blu_rays*rental_days) result = f'${total_cost}' result = total_cost return result
Linda has a fruit market with 50 apples and four times as many bananas. If she can sell each apple for $2 and each banana for $3, what is the total amount she can earn by selling all the fruits?
def solve() -> int: apples = 50 bananas = 4 * apples apple_price = 2 banana_price = 3 apple_earnings = apples * apple_price banana_earnings = bananas * banana_price total_earnings = apple_earnings + banana_earnings result = total_earnings return result
Max wants to go on a road trip. He plans to drive 200 miles per day and his car gets 25 miles to the gallon. If gas costs $3.50 per gallon, how much will Max spend on gas for the entire trip?
def solve() -> int: miles_per_day = 200 miles_per_gallon = 25 cost_per_gallon = 3.50 total_miles = 2000 total_days = total_miles // miles_per_day total_gallons = total_miles / miles_per_gallon total_cost = total_gallons * cost_per_gallon result = total_cost r...
Student: **** Mandy is selling books at the library. She sold 8 books on Monday and 5 times as many books on Tuesday. She sold 2 times as many books on Wednesday compared to Tuesday. How many books did Mandy sell on Wednesday?
def solve() -> int: monday_books = 8 tuesday_books = 5 * monday_books wednesday_books = 2 * tuesday_books result = wednesday_books return result
Abigail has 22 pencils in her pencil case. She loses 8 of them but she still has seven times as many as her cousin. How many pencils do Abigail and her cousin have together?
def solve() -> int: pencils_in_pencil_case = 22 lost_pencils = 8 remaining_pencils = pencils_in_pencil_case - lost_pencils cousin_pencils = remaining_pencils / 7 total_pencils = remaining_pencils + cousin_pencils result = total_pencils return result
A store sells shirts for $20 and pants for $30. If a customer buys 2 shirts and 3 pants, how much does the customer spend in total?
def solve() -> int: price_shirt = 20 price_pants = 30 num_shirts = 2 num_pants = 3 total_spent = price_shirt * num_shirts + price_pants * num_pants result = total_spent return result
Student: Mike has a square fruit basket and he needs 193 apples to fill the basket. How many apples does he need to place in each row and each column?
def solve() -> int: apples = 193 rows = 0 columns = 0 rows = apples // 4 columns = apples // 4 result = rows * columns return result
Jeff is making pancakes for breakfast. He needs 1 cup of flour for each batch of pancakes. If he want to make 10 batches of pancakes, how many cups of flour will he need in total?
def solve() -> int: num_batches = 10 cups_per_batch = 1 result = num_batches * cups_per_batch return result
Ben and Sam are painters. Ben can paint a room in 4 hours and Sam can paint the same room in 6 hours. They decide to work together on a room and split the payment. How long will it take them to finish the room and how much will each of them earn if the total payment is $240?
def solve() -> int: time = round(12 / 5, 2) ben_share = round(25, 2) sam_share = round(16.67, 2) result = [time, ben_share, sam_share] return result
There are 450 marbles in 30 boxes. If 12 of the boxes have 15 marbles each, how many marbles are in each of the remaining boxes?
def solve() -> int: total_marbles = 450 total_boxes = 30 known_marbles = 12 * 15 unknown_boxes = total_boxes - 12 unknown_marbles = (total_marbles - known_marbles) / unknown_boxes result = unknown_marbles return result
A rectangular room is 16 feet long and 12 feet wide. What is the area of the room?
def solve() -> int: length = 16 width = 12 area = length*width result = area return result
John is ordering pizza for his friends. Each pizza can feed 4 people. If he has 8 friends coming over, how many pizzas should he order?
def solve() -> int: num_friends = 8 ppl_per_pizza = 4 num_pizzas = num_friends/ppl_per_pizza result = num_pizzas return result
A box of pencils costs $2.50 and a notebook costs $4.75. If John buys one box of pencils and two notebooks, how much does he spend?
def solve() -> int: price_of_pencil_box = 2.50 price_of_notebook = 4.75 quantity_of_pencil_box = 1 quantity_of_notebook = 2 total_cost = (price_of_pencil_box * quantity_of_pencil_box) + (price_of_notebook * quantity_of_notebook) result = total_cost return result
A pizza has a diameter of 14 inches. What is the area of the pizza?
def solve() -> int: diameter = 14 radius = diameter/2 area = 3.14159 * radius ** 2 result = round(area,2) return result
One fourth of Noah's money was $80. He gave a third of this amount to Mason and half the remaining amount to Elijah. How much does Noah have left?
def solve() -> int: one_fourth_money = 80 given_money = one_fourth_money / 3 remaining_money = one_fourth_money * 3 / 4 - given_money elijah_money = remaining_money / 2 noah_money = remaining_money - elijah_money result = noah_money return result
If a charity organization receives donations from 25% of its members, and 2/5 of those members donate $100, and the total donation amount is $10,000, how many members does the organization have?
def solve() -> int: total_donation_amount = 10000 donating_members_percentage = 0.25 donating_members_donation_percentage = 0.4 donating_members_donation_amount = 100 total_donating_members = total_donation_amount / (donating_members_donation_percentage * donating_members_donation_amount) ...
A cake was divided equally amongst 3 siblings, Molly, Jack and Alice. If the cake had 18 slices, how many slices did Jack and Alice get combined?
def solve() -> int: cake_slices = 18 siblings = 3 jack_and_alice_slices = (cake_slices // siblings) * 2 result = jack_and_alice_slices return result
Anna's sticker album has four times as many stickers as Bella's. Cara's scrapbook has 12 more stickers than Anna's and Bella's albums combined. If Cara's scrapbook has 68 stickers, how many stickers are in Bella's album?
def solve() -> int: anna_and_bella = 68 - 12 anna = anna_and_bella / 5 bella = anna / 4 result = bella return result
A train traveled a distance of 580 kilometers in 8 hours. If the average speed is constant, what was the average speed of the train in kilometers per hour?
def solve() -> int: average_speed = 580 / 8 result = average_speed return result
The zoo charges $15 for adults and $10 for children under 12. Lucas is 11 years old and has two friends who are 12 and 13. He also has a coupon that gives him 20% off the total admission fee. How much does Lucas pay for himself and his friends to enter the zoo?
def solve() -> int: lucas_fee = 10 friend_1_fee = 15 friend_2_fee = 15 total_fee = lucas_fee + friend_1_fee + friend_2_fee discount = 0.2 * total_fee final_fee = total_fee - discount result = final_fee return result
Tim works at an associates store where he is paid a base pay of $8 per hour and earns a commission of 5% on all his sales. Last month he worked 120 hours and sold $6500 worth of merchandise. How much did he make in total?
def solve() -> int: base_pay_per_hour = 8 hours_worked = 120 sales = 6500 commission_rate = 0.05 base_pay = base_pay_per_hour * hours_worked commission = sales * commission_rate total_pay = base_pay + commission result = total_pay return result
Alex and Olivia went on a hike. They hiked a total of 30 miles. If Olivia hiked 2/5 of the distance that Alex hiked, how many miles did Alex hike?
def solve() -> int: alex_hiked = 30 * (5/7) result = alex_hiked return result
Student: A school has 300 students and 15 teachers. Each student has to pay $50 for a field trip, and each teacher has to pay $20. The school also has to pay $500 for the bus and $1000 for the entrance fee. However, the school receives a $200 discount for booking the field trip in advance. How much money does the schoo...
def solve() -> int: students = 300 teachers = 15 student_fee = 50 teacher_fee = 20 bus_fee = 500 entrance_fee = 1000 discount = 200 total_fee = (students * student_fee) + (teachers * teacher_fee) + bus_fee + entrance_fee - discount result = total_fee return result
The school has a total of 10 tables where each table can accommodate 8 students. If all tables are full, how many students are there in the prom in total?
def solve() -> int: num_tables = 10 capacity_per_table = 8 total_students = num_tables * capacity_per_table result = total_students return result
Student: 10. Jean and John have a total of 260 pencils. Jean will take 35% of the pencils while John will take the remainder. How much more than John will Jean get?
def solve() -> int: total_pencils = 260 jean_pencils = total_pencils * 0.35 john_pencils = total_pencils - jean_pencils result = jean_pencils - john_pencils return result
A pizza with a diameter of 12 inches costs $12.00. A pizza with a diameter of 16 inches is priced at $18.00. What is the cost per square inch of each pizza?
def solve() -> int: price1 = 12 diameter1 = 12 radius1 = diameter1 / 2 area1 = 3.14 * radius1 ** 2 cost_per_inch1 = price1 / area1 price2 = 18 diameter2 = 16 radius2 = diameter2 / 2 area2 = 3.14 * radius2 ** 2 cost_per_inch2 = price2 / area2 result = (cost_per_inch1, cost_per...
If Michael purchased 4 times as many books as notebooks for $15 per notebook and $20 per book, and he got a 30% discount on books if he bought 120 notebooks, how much did he spend on his purchase?
def solve() -> int: notebooks = 120 books = 4 * notebooks notebook_cost = 15 book_cost = 20 total_notebook_cost = notebooks * notebook_cost total_book_cost = books * book_cost discount = 0.3 total_book_cost_after_discount = total_book_cost * (1 - discou...
A marathon runner completed a race in 3 hours and 45 minutes. What was his average speed in km/h if the length of the race was 42 km?
def solve() -> int: total_time = 3 + (45/60) average_speed = 42 / total_time result = average_speed return result
Jessica wants to learn photography. She buys a camera for $800 and hires a photography teacher for 20 lessons at $45 per lesson, but she gets a 10% discount. How much did it cost Jessica to learn photography?
def solve() -> int: camera_cost = 800 lesson_cost = 45 num_lessons = 20 discount = 0.10 total_lesson_cost = lesson_cost * num_lessons discounted_lesson_cost = total_lesson_cost * (1 - discount) total_cost = camera_cost + discounted_lesson_cost result = total_cost return res...
A painting is on sale for $1200 but the original price was $1500. What is the discount percentage?
def solve() -> int: original_price = 1500 discounted_price = 1200 percent_discount = (original_price - discounted_price)/original_price * 100 result = percent_discount return result
Student: - Tara can bake 10 cupcakes per batch with her new oven. She needs to bake 150 cupcakes in total for a birthday party. She has already baked 70 cupcakes. How many more batches will it take Tara to finish baking all 150 cupcakes?
def solve() -> int: cupcakes_needed = 150 cupcakes_baked = 70 cupcakes_remaining = cupcakes_needed - cupcakes_baked cupcakes_per_batch = 10 batches_needed = cupcakes_remaining // cupcakes_per_batch result = batches_needed return result
In his first swimming race, Ryan swam the 50-meter freestyle in 25 seconds. His relay teammate, who has swum for five seasons, has swum twice as fast as Ryan's best time in each race. If each season has 15 races, how many total meters have the relay teammates swum between them if Ryan swam 200 meters in previous races?
def solve() -> int: ryan_time = 25 ryan_distance = 50 ryan_total_distance = 200 teammate_speed = 2 * ryan_distance / ryan_time teammate_distance = teammate_speed * ryan_total_distance / (15 * 5) total_distance = ryan_total_distance + teammate_distance result = total_dist...
Emily has 7 metres of fabric. She cuts 35cm for a dress. How many cm of fabric does she have left?
def solve() -> int: fabric = 7 cut = 0.35 result = (fabric * 100) - (cut * 100) return result
Maria took out a $3000 loan from a credit union with an 8% annual interest rate compounded monthly. If she doesn't make any payments, how much will she owe in interest after six months?
def solve() -> int: principal = 3000 rate = 0.08 time = 6/12 interest = principal * (1 + rate/12)**(12*time) - principal result = interest return result
Student: Ms White wanted to buy a new phone for her dad. The phone was priced at $500, but the store was offering a 10% discount if she paid in cash. How much was the discounted price?
def solve() -> int: price = 500 discount = 0.1 discounted_price = price * (1 - discount) result = discounted_price return result
Student: A water bottle can hold 500 ml of water. If a person wants to drink 2 liters of water everyday, how many water bottles will they need?
def solve() -> int: water_bottle_capacity = 500 daily_water_intake = 2000 num_water_bottles = daily_water_intake // water_bottle_capacity result = num_water_bottles return result
Mrs. Garcia has an indoor garden with five different herbs: rosemary, thyme, oregano, sage, and basil. Throughout the year, the oregano plant sprouted two new stems. Unfortunately, Mrs. Garcia's cat knocked over the rosemary plant and it died. How many herb plants did Mrs. Garcia have left in her indoor garden at the e...
def solve() -> int: rosemary = 0 thyme = 1 oregano = 2 + 1 sage = 1 basil = 1 rosemary -= 1 total_plants = rosemary + thyme + oregano + sage + basil result = total_plants return result
Olivia had some stickers, and she gave eight of them to Emma. Now, Olivia has 5 times more stickers than Emma. If Emma had 10 stickers at first, how many stickers did Olivia have at first?
def solve() -> int: emma_initial = 10 olivia_gave = 8 emma_now = emma_initial + olivia_gave olivia_now = 5 * emma_now olivia_initial = olivia_now - olivia_gave result = olivia_initial return result
A recipe for cookies requires 2 cups of sugar for every 3 cups of flour. If you want to make 12 cups of flour worth of cookies, how much sugar do you need?
def solve() -> int: flour = 12 sugar = flour * (2/3) result = sugar return result
Possible additional questions and programs are: A red balloon costs $4 and a blue balloon costs $6. Jia bought 12 balloons in total and spent $60. How many red balloons did Jia buy?
def solve() -> int: total_balloons = 12 total_cost = 60 red_cost = 4 blue_cost = 6 blue_cost_total = total_cost - red_cost * total_balloons blue_balloons = blue_cost_total / blue_cost red_balloons = total_balloons - blue_balloons result = red_balloons return...
Rachel bought 80 sheets of stickers. She uses eight stickers every day. How many days will it take for her to finish using all the stickers?
def solve() -> int: sheets_of_stickers = 80 stickers_per_day = 8 days_to_finish = sheets_of_stickers / stickers_per_day result = days_to_finish return result
If a book costs $20 and the sales tax is 8%, what is the total cost of the book including tax?
def solve() -> int: book_cost = 20 sales_tax_percentage = 8 total_cost = book_cost * (1 + sales_tax_percentage / 100) result = total_cost return result
-Possible new questions: Alan has a bike that can go 20 miles per hour on flat roads, but loses 5 miles per hour for every 10% incline. He wants to bike from his house to a park that is 10 miles away, but there is a hill with a 15% incline in between. How fast can Alan bike to the park if he spends half of his time goi...
def solve() -> int: uphill_speed = 20 - 5 * (15 / 10) downhill_speed = 20 + 5 * (15 / 10) average_speed = 2 * uphill_speed * downhill_speed / (uphill_speed + downhill_speed) time = 10 / average_speed time_in_minutes = time * 60 result = time_in_minutes return result
Bob is selling lemonade at a fair. He bought 5 gallons of lemonade for $25 and plans to sell each cup for $1. He can fill 16 cups from one gallon of lemonade. How much profit will he make if he sells all the lemonade?
def solve() -> int: revenue = 5 * 16 * 1 cost = 25 profit = revenue - cost result = profit return result
John has a job where he gets paid $12 an hour. If he works 8 hours a day for 5 days, what is his total pay?
def solve() -> int: hourly_rate = 12 hours_per_day = 8 days_worked = 5 total_hours = hours_per_day * days_worked total_pay = total_hours * hourly_rate result = total_pay return result