question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
In a bookshelf, there are 8 shelves. Each shelf has 10 books and each book has 300 pages. A student tears out 10 pages from each book. How many pages were torn out from the bookshelf?
def solve() -> int: shelves = 8 books_per_shelf = 10 pages_per_book = 300 pages_torn_out_per_book = 10 total_books = shelves * books_per_shelf total_pages = total_books * pages_per_book total_pages_torn_out = total_books * pages_torn_out_per_book result = total_pages_torn_out ...
Benjamin has a $300 credit card bill that is 3 months overdue. The bill charges a 15% interest rate for each overdue month. How much does Benjamin owe in total? Sophia starts with a specific amount of pencils in her pencil case in the morning. Throughout the day, she adds 5 pencils after using up 12. By nighttime, she ...
def solve() -> int: bill = 300 overdue_months = 3 interest_rate = 0.15 interest = bill * interest_rate * overdue_months total_owed = bill + interest pencils_left = 20 pencils_added = 5 pencils_used = 12 pencils_initial = pencils_left + pencils_used - pencils_added ...
How many square feet are in one acre?
def solve() -> int: acres = 1 square_feet = 43560 result = acres * square_feet return result
8. A chocolate factory has 31 employees. If each employee works for 8 hours per day, how many hours does the factory collectively work per day?
def solve() -> int: num_employees = 31 hours_per_day = 8 total_hours = num_employees * hours_per_day result = total_hours return result
If Jack has twice as many markers as Sarah and Sarah has seven yellow markers, six red markers, and five blue markers, how many markers do Jack and Sarah have combined?
def solve() -> int: sarah_yellow_markers = 7 sarah_red_markers = 6 sarah_blue_markers = 5 sarah_total_markers = sarah_yellow_markers + sarah_red_markers + sarah_blue_markers jack_total_markers = sarah_total_markers * 2 total_markers = sarah_total_markers + jack_total_markers r...
If the number of books in the library increases from 1200 to 1600, by what percentage did the number of books increase?
def solve() -> int: original = 1200 changed = 1600 percentage_increase = ((changed - original) / original) * 100 result = percentage_increase return result
A car travels 180 miles in 3 hours. What is its average speed in miles per hour?
def solve() -> int: distance = 180 time = 3 average_speed = distance / time result = average_speed return result
Student: Jody bought potting soil and sand for her garden. The potting soil cost 20 cents per kilogram and the sand cost 15 cents per kilogram. If she bought a total of 6 kilograms, how much did she pay altogether?
def solve() -> int: potting_soil_cost = 0.20 sand_cost = 0.15 total_kg = 6 total_potting_soil_cost = potting_soil_cost * total_kg total_sand_cost = sand_cost * total_kg total_cost = total_potting_soil_cost + total_sand_cost result = total_cost return result
Ava is in charge of building a new chicken coop for her backyard. The coop measures six feet by eight feet and needs six wooden beams for the base and walls. Each chicken nesting box requires five wooden planks, and there are four nesting boxes in total. How many wooden planks in total does Ava need to build the chicke...
def solve() -> int: coop_length = 6 coop_width = 8 num_beams = 6 planks_per_box = 5 num_boxes = 4 total_planks = num_beams + (planks_per_box * num_boxes) result = total_planks return result
Simon had a bottle of juice that contained 750 milliliters. He drank 1/5 of the juice in the morning and 2/9 of the remaining juice in the afternoon. How many milliliters of juice did Simon have left in the bottle?
def solve() -> int: juice = 750 juice -= juice / 5 juice -= juice * 2 / 9 result = juice return result
There are 250 students in an honors program. 9/10 of them are upperclassmen. How many upperclassmen are in the honors program?
def solve() -> int: total_honors = 250 ratio_upperclassmen = 9 / 10 result = total_honors * ratio_upperclassmen return result
The age difference between Lila and Leo's age is half the total number of pens Lila has. If their ages add up to 200 and Lila is 60 years old, and Leo has 80 more pens than Lila, what's the total number of pens they have together?
def solve() -> int: lila_age = 60 leo_age = 200 - lila_age pens_difference = leo_age / 2 lila_pens = pens_difference - 80 leo_pens = lila_pens + 80 total_pens = lila_pens + leo_pens result = total_pens return result
John splits a watermelon into six equal pieces, gives his friends a quarter of the pieces, and divides the remaining pieces into three equal parts. What is the total number of pieces?
def solve() -> int: pieces = 6 friends_share = pieces / 4 remaining_pieces = pieces - friends_share total_pieces = remaining_pieces * 3 result = total_pieces return result
Possible additional questions are: The flower shop has 6 bouquets of roses and 10 bouquets of lilies. Each bouquet of roses has 12 roses and each bouquet of lilies has 8 lilies. How many flowers are there in total?
def solve() -> int: bouquets_of_roses = 6 bouquets_of_lilies = 10 roses_per_bouquet = 12 lilies_per_bouquet = 8 total_roses = bouquets_of_roses * roses_per_bouquet total_lilies = bouquets_of_lilies * lilies_per_bouquet total_flowers = total_roses + total_lilies result...
Student: Julia is one third the age of her mother. If Julia is 30 years old now, how old is her mother?
def solve() -> int: julia_age = 30 ratio = 1/3 mother_age = julia_age / ratio result = mother_age return result
If 16 people can paint a house in 6 days, how many days will it take 9 people to paint the same house?
def solve() -> int: people_1 = 16 days_1 = 6 people_2 = 9 days_2 = (people_1 * days_1) / people_2 result = days_2 return result
Corey needs to buy supplies for a school project. She needs 7 reams of copy paper, 8 boxes of markers, and 4 eraser sets. Each ream of copy paper costs $7.50, each box of markers costs $10.50, and one eraser set costs $15. What is the total cost for the supplies?
def solve() -> int: total_cost = 7.5 * 7 + 10.5 * 8 + 15 * 4 result = total_cost return result
A bakery sold 80 cakes on Monday. They sold twice as many cakes on Tuesday and half as many cakes on Wednesday. If they sold a total of 200 cakes in those three days, how many cakes did they sell on Tuesday?
def solve() -> int: cakes = 80 cakes *= 2 cakes /= 2 cakes += 80 result = cakes return result
A class of 30 students took a math quiz. If the average score was 85 and 3 students received a score of 65, what was the average of the remaining students?
def solve() -> int: num_students = 30 total_score = num_students*85 total_score -= 3*65 remaining_students = num_students-3 average_score = total_score/remaining_students result = average_score return result
Jacob is 12 years older than Emily, while Emily is 7 years older than Lily. How old will Jacob be when Lily is half the age of Emily?
def solve() -> int: lily_age = 1 emily_age = lily_age + 7 jacob_age = emily_age + 12 while lily_age!= emily_age/2: lily_age += 1 emily_age += 1 jacob_age += 1 result = jacob_age return result
In a jewelry store, thereA taxi driver has to spend $3 per gallon of gas. He can drive 20 miles per gallon. He drives at a rate of 40 miles per hour. If he is paid $0.75 per mile, how much money does he make if he drives for 8 hours?
def solve() -> int: gas_price = 3 miles_per_gallon = 20 rate_per_mile = 0.75 hours_driven = 8 miles_per_hour = 40 total_miles_driven = miles_per_hour * hours_driven total_gallons_used = total_miles_driven / miles_per_gallon total_gas_cost = total_gallons_used * gas_price total_m...
In a school, there were 21 students in grade 8 and 13 students in grade 9. If 80% of the students were present during a seminar, and the same ratio of students form grade 8 and 9 were present, how many students from grade 8 and 9 were there in total?
def solve() -> int: total_students = 21 + 13 present_students = total_students * 0.8 grade8_present = present_students * 21 / total_students grade9_present = present_students - grade8_present total_present = grade8_present + grade9_present result = total_present return result
A construction worker operates a crane to lift a steel beam into place on a skyscraper. The beam is lifted with cables that spread out in a diameter that is seven times as far as the height of the crane from the ground. If the crane is 200 feet tall, what is the radius of the cable spread in feet?
def solve() -> int: height = 200 diameter = height * 7 radius = diameter / 2 result = radius return result
Tom can solve 3 math problems in 5 minutes. If he has 60 math problems to solve, how long does he need?
def solve() -> int: problems_solved = 3 time_per_problem = 5 total_problems = 60 time_needed = (total_problems / problems_solved) * time_per_problem result = time_needed return result
During his backpacking trip last month, Jack experienced some rain on 3 days. The amount of rainfall was 7 cm, 10 cm, and 8 cm on those three days respectively. During the same period, it rained 25 cm in his hometown. How much less rain did Jack experience during his backpacking trip?
def solve() -> int: rainfall_jack_trip = 7 + 10 + 8 rainfall_hometown = 25 less_rain = rainfall_hometown - rainfall_jack_trip result = less_rain return result
In theory, a mouse can give birth to 18 babies in 18 days. However, after 10 days a certain mouse had given birth to only 14 babies. How many more babies should the mouse have in the next 8 days?
def solve() -> int: total_babies = 18 given_babies=14 remaining_babies= total_babies-given_babies days=8 babies_new_days=remaining_babies/days result = babies_new_days return result
Lucas wants to fill up his car with gas. Gas costs $2.50 per gallon. If his car's gas tank can hold 12 gallons of gas, how much will it cost to fill up the tank?
def solve() -> int: price_per_gallon = 2.5 gallons_in_tank = 12 total_cost = price_per_gallon * gallons_in_tank result = total_cost return result
Ben had 20 cookies in a jar. He ate four cookies every day for three days. Then he baked six more cookies and added them to the jar. How many cookies were left in the jar?
def solve() -> int: cookies = 20 cookies_eaten = 4 * 3 cookies_left = cookies - cookies_eaten cookies_left = cookies_left + 6 result = cookies_left return result
There are five birds in the park. They like cherries, nuts, and worms. The first bird, which likes cherries, eats 4 times as many cherries as the number of nuts eaten by the second bird that likes nuts. The bird that likes nuts eats 1/4 times as many nuts as the number of worms eaten by the third bird. The fourth bird ...
def solve() -> int: result = 44 + 24 return result
Student: 2. A shop sells 3 bags of 10 chips for $14. How much money would the shop earn if they sold 10 bags of chips?
def solve() -> int: bags_per_pack = 3 chips_per_bag = 10 price_per_pack = 14 packs_sold = 10 bags_sold = packs_sold * bags_per_pack chips_sold = bags_sold * chips_per_bag total_earned = packs_sold * price_per_pack result = total_earned return result
A rectangle has a length of 8 meters and a width of 4 meters. What is the perimeter and area of the rectangle?
def solve() -> int: length = 8 width = 4 perimeter = 2*length + 2*width area = length * width result = (perimeter, area) return result
Student: If there are 14 pieces of chocolate and Jonas gets to eat 5 pieces, how many pieces of chocolate does he have left?
def solve() -> int: pieces_of_chocolate = 14 pieces_eaten = 5 pieces_left = pieces_of_chocolate - pieces_eaten result = pieces_left return result
If Robert's income is now 80% of what it used to be and Lily makes four times as much as Robert used to make, what is their total earning if Robert used to make $5,000?
def solve() -> int: robert_income = 5000 robert_now_income = 0.8 * robert_income lily_income = 4 * robert_income total_earning = robert_now_income + lily_income result = total_earning return result
A pizza place has a special deal: a 16 inch pizza costs $16, and each additional inch costs $1. How much would a 22 inch pizza cost?
def solve() -> int: diameter = 22 cost = 16 + (diameter - 16) result = f'${cost}' result = cost return result
Amy and Ben went to the toy store to buy some toys. They spent the same amount. Amy bought a doll at $6 and two puzzles at $3 each. Ben bought a car at $8 and a stuffed animal. How much did Ben's stuffed animal cost?
def solve() -> int: amy_doll = 6 amy_puzzles = 2 amy_puzzle_price = 3 ben_car = 8 amy_total = amy_doll + amy_puzzles * amy_puzzle_price ben_total = amy_total ben_animal = ben_total - ben_car result = ben_animal return result
A car traveled 90 miles in 1.5 hours. What was its average speed in miles per hour?
def solve() -> int: distance = 90 time = 1.5 speed = distance / time result = speed return result
A school has a total of 240 students, and the ratio of boys to girls is 3:5. How many boys are in the school?
def solve() -> int: total_students = 240 boy_to_girl_ratio = 3/5 num_boys = total_students * boy_to_girl_ratio * 5 / 8 result = num_boys return result
A jar of peanut butter has 16 servings and each serving contains 188 calories. A jar of jelly has 20 servings and each serving contains 131 calories. How many more calories does the jar of peanut butter have?
def solve() -> int: pb_servings = 16 pb_calories = 188 jelly_servings = 20 jelly_calories = 131 pb_total_calories = pb_servings * pb_calories jelly_total_calories = jelly_servings * jelly_calories calories_difference = pb_total_calories - jelly_total_calories result = calo...
Student: An RV can carry a maximum of 4,800 kgs of supplies. Today, it was loaded with 600 crates that weigh 25 kgs each. Then, it was loaded with 15 sacks which weigh 40 kgs each. How many bags weighing 85 kilograms each can we still load in the RV?
def solve() -> int: max_weight = 4800 crates_weight = 25 crates_num = 600 sacks_weight = 40 sacks_num = 15 bags_weight = 85 total_weight = crates_num * crates_weight + sacks_num * sacks_weight remaining_weight = max_weight - total_weight bags_num = remaining_weight // bags_weight...
A recipe requires 2 1/2 cups of flour. If a bag of flour contains 10 cups and was used for baking 4 times, how much flour is left?
def solve() -> int: recipe = 2.5 bag = 10 bake = 4 used_flour = bake * recipe left_flour = bag - used_flour result = left_flour return result
Marie wants to buy a toy car that costs $25. If she has $60 saved, how much money will she have left after buying the toy car?
def solve() -> int: total = 60 toy_cost = 25 remaining = total - toy_cost result = remaining return result
Janice goes to the store to buy a box of cereal that costs $6.20. She also wants to buy some milk that costs $1.25 per liter. If Janice wants to buy 4 liters of milk, how much will Janice spend for the cereal and milk altogether?
def solve() -> int: cereal_cost = 6.20 milk_cost = 1.25 num_liters = 4 cost_cereal = cereal_cost cost_milk = num_liters * milk_cost total_cost = cost_cereal + cost_milk result = total_cost return result
A pizza has 8 slices. If 3 friends equally share 2 pizzas, how many slices of pizza does each person get?
def solve() -> int: num_slices = 8 * 2 num_friends = 3 slices_per_person = num_slices / num_friends result = slices_per_person return result
Jorge is able to solve a Rubik's cube in 2 minutes at the age of 15. When he turns 20, he will be able to solve it in 300% less time than his previous solve. How much faster will he be each year?
def solve() -> int: age_now = 15 time_now = 2 age_future = 20 time_future = time_now - (time_now * 3) time_difference = time_now - time_future years_difference = age_future - age_now faster_each_year = time_difference / years_difference result = faster_each_year ...
Every Tuesday, Peter makes spaghetti for his family. He and his wife each eat 1/2 pound of pasta, while his daughter eats 1/3 pound. If a box of spaghetti weighs 1 pound, how many boxes will Peter need to buy over a year?
def solve() -> int: peter_pasta = 1/2 wife_pasta = 1/2 daughter_pasta = 1/3 box_weight = 1 total_pasta_per_week = peter_pasta + wife_pasta + daughter_pasta boxes_per_week = total_pasta_per_week / box_weight boxes_per_year = boxes_per_week * 52 result = boxes_per_year ...
Nia's deposit in the bank is 3 times larger than her sister's deposit. If her sister deposited $200, how much did Nia deposit?
def solve() -> int: sister_deposit = 200 nia_deposit = 3 * sister_deposit result = nia_deposit return result
Ethan is collecting books. He has four times as many fiction books as non-fiction books. He has 120 total books. How many non-fiction books does he have?
def solve() -> int: non_fiction_books = 0 fiction_books = 0 total_books = 120 non_fiction_books = total_books / 5 result = non_fiction_books return result
Every pound of grapes that Sarah picks gives her 1 cup of juice. If she drinks 2 cups of juice a day from June 1 through September 30, how many pounds of grapes will she need to pick?
def solve() -> int: days = 122 cups_per_day = 2 total_cups = days * cups_per_day cups_per_pound = 1 pounds = total_cups / cups_per_pound result = pounds return result
Sarah has 7 cats. She adopts some more cats and now has 19. How many cats did she adopt?
def solve() -> int: initial_cats = 7 total_cats = 19 new_cats = total_cats - initial_cats result = new_cats return result
Tommy has 24 candies and Amanda has 16 candies. If Tommy gives Amanda half of his candies, Amanda will have more candies than Tommy. But if Amanda eats 3 candies, how many more candies does Amanda have than Tommy?
def solve() -> int: tommy_candies = 24 amanda_candies = 16 tommy_candies = tommy_candies / 2 amanda_candies = amanda_candies + tommy_candies amanda_candies = amanda_candies - 3 difference = amanda_candies - tommy_candies result = difference return result
There are 120 flowers planted in a flower bed. 75% of the flowers are pink, and half of the remaining flowers are yellow. How many yellow flowers are in the flower bed?
def solve() -> int: total_flowers = 120 num_pink_flowers = total_flowers * 0.75 num_remaining_flowers = total_flowers - num_pink_flowers num_yellow_flowers = num_remaining_flowers * 0.5 result = num_yellow_flowers return result
Amanda baked 12 muffins, 8 brownies, and 6 cookies for a bake sale. She sold 3 muffins, 5 brownies, and 4 cookies. She gave away 2 muffins and 1 brownie to her friends. How many baked goods did she have left?
def solve() -> int: muffins = 12 brownies = 8 cookies = 6 muffins = muffins - 3 brownies = brownies - 5 cookies = cookies - 4 muffins = muffins - 2 brownies = brownies - 1 cookies = cookies total = muffins + brownies + cookies result = total return r...
Mario has 14 coins. He spends 4 coins on Wednesday and 8 coins on Thursday. How many coins does he have left?
def solve() -> int: coins = 14 coins = coins - 4 coins = coins - 8 result = coins return result
Maria sold 20 red dresses and 15 blue dresses at her clothing store. Each red dress cost $50 and each blue dress cost $65. If she made a total of $1500 in sales, how many blue dresses did she sell?
def solve() -> int: red_dresses = 20 blue_dresses = 15 red_dress_cost = 50 blue_dress_cost = 65 total_sales = 1500 red_sales = red_dresses * red_dress_cost blue_sales = blue_dresses * blue_dress_cost total_sales = red_sales + blue_sales blue_dresses_sold = (total_sales...
A company sells products for $50 each. If you buy 3 products, you get a 10% discount. If you buy 5 products, you get a 20% discount. How much does it cost to buy 4 products?
def solve() -> int: price_per_product = 50 quantity = 4 if quantity == 3: discount = 0.1 elif quantity == 5: discount = 0.2 else: discount = 0 subtotal = price_per_product * quantity total_discount = subtotal * discount total_price = subtotal - total_discount result...
Jane has a collection of 50 stamps. She traded 10 of them with her friend and found 15 more at an estate sale. She then lost 5 stamps somewhere. How many stamps does Jane have now?
def solve() -> int: stamps = 50 traded = 10 found = 15 lost = 5 stamps = stamps - traded stamps = stamps + found stamps = stamps - lost result = stamps return result
There are 80 students in a classroom, and the room can hold a maximum of 100 students. How many more students can join the classroom?
def solve() -> int: classroom_capacity = 100 current_num_of_students = 80 result = classroom_capacity - current_num_of_students return result
Chad is planning to run a marathon. He wants to run 26.2 miles, but he has only trained to run 20 miles. If he increases his distance by 10% each week, how many weeks will it take him to reach his goal distance?
def solve() -> int: goal_distance = 26.2 current_distance = 20 increase = 0.1 weeks = 0 while current_distance < goal_distance: current_distance += current_distance * increase weeks += 1 result = weeks return result
Bob bought 9 packs of cookies. Each pack has 15 cookies and each cookie has 4 chocolate chips. Calculate the total number of chocolate chips in all the cookies.
def solve() -> int: packs = 9 cookies = 15 chips = 4 total_chips = packs * cookies * chips result = total_chips return result
China brought 4 gallons of paint, if each gallon of paint can cover 85 square feet, how many square feet can she paint?
def solve() -> int: num_gallons = 4 sqft_per_gallon = 85 total_sqft = num_gallons * sqft_per_gallon result = total_sqft return result
A baker made 24 cupcakes on Monday, 18 cupcakes on Tuesday, and 30 cupcakes on Friday. He used 2 eggs for every 6 cupcakes. How many eggs would he use if he made the same number of cupcakes each day?
def solve() -> int: monday_cupcakes = 24 tuesday_cupcakes = 18 friday_cupcakes = 30 eggs_per_cupcakes = 2 / 6 total_cupcakes = monday_cupcakes + tuesday_cupcakes + friday_cupcakes total_eggs = total_cupcakes * eggs_per_cupcakes average_cupcakes = total_cupcakes / 3 average_eggs...
Veronica bought 6 balloons that costed $2 each. How much money did she pay altogether?
def solve() -> int: num_balloons = 6 price_per_balloon = 2 total_amount = num_balloons * price_per_balloon result = total_amount return result
I have 80 marbles in my jar. Two-thirds of them are yellow, one-fourth of the remaining marbles are red, and 5 marbles are white. How many of my marbles are not red or white?
def solve() -> int: totalMarbles = 80 yellowMarbles = totalMarbles * (2/3) remainingMarbles = totalMarbles - yellowMarbles redMarbles = remainingMarbles * (1/4) notRedOrWhiteMarbles = totalMarbles - (yellowMarbles + redMarbles + 5) result = notRedOrWhiteMarbles return re...
A museum has a policy that limits the size of bags visitors can bring inside. Each visitor can bring no more than twice the minimum size of bag and no less than 5 inches larger than the standard limit. The standard limit is a 12-inch bag. What is the maximum size a visitor's bag can be?
def solve() -> int: min_size = 12 extra_size = 5 max_size = min_size * 2 + extra_size result = max_size return result
Eli and Fiona each have 10 more marbles than Gus but only 5 less than Hana. If Hana has 35 marbles, calculate the total number of marbles that the four have?
def solve() -> int: hana = 35 eli = hana - 5 fiona = hana - 5 gus = eli - 10 total = eli + fiona + gus + hana result = total return result
A teacher bought 64 pencils for her class. She gave 5 to each student and left 8 at home. If there were 7 students who didn’t take their pencils, how many students were in her class?
def solve() -> int: pencils_bought = 64 pencils_left_at_home = 8 pencils_given_to_each_student = 5 pencils_taken_by_students = pencils_bought - pencils_left_at_home pencils_taken_by_present_students = pencils_taken_by_students - (7 * pencils_given_to_each_student) number_of_students = pencils_ta...
If a triangle has a base of 15 inches and a height of 12 inches, what is the area of the triangle?
def solve() -> int: base = 15 height = 12 area = 0.5 * base * height result = area return result
Jess has 30 stickers, and her sister has 14 less. If their uncle has five times the total number of stickers Jess and her sister have, what's 75% of their uncle's stickers?
def solve() -> int: jess_stickers = 30 sister_stickers = jess_stickers - 14 uncle_stickers = (jess_stickers + sister_stickers) * 5 result = uncle_stickers * 0.75 return result
Julia bought a laptop for $1,500. She paid $400 upfront and pays the rest by giving $50 per month. In how many months will she fully pay for the laptop?
def solve() -> int: price = 1500 upfront = 400 monthly_payment = 50 remaining_balance = price - upfront months = remaining_balance // monthly_payment result = months return result
Rachel and Jordan are planning a trip to the beach. Beach towels cost $8 each and sunscreen costs $10 per bottle. If they bring $80 with them, how much money do they have left after buying one towel and two bottles of sunscreen?
def solve() -> int: towel_cost = 8 sunscreen_cost = 10 money_with_them = 80 total_cost = towel_cost + (2 * sunscreen_cost) money_left = money_with_them - total_cost result = money_left return result
Liam wants to make a custom-made guitar from a luthier. The luthier charges $350 for the design and $80 an hour for 12 hours to create the guitar. Since it’s Liam's first time getting a guitar built, the luthier allows an 18% discount on labor. What is the total cost of the guitar?
def solve() -> int: design_cost = 350 hourly_rate = 80 hours_worked = 12 discount = 0.18 labor_cost = hourly_rate * hours_worked * (1 - discount) total_cost = design_cost + labor_cost result = total_cost return result
If Eric is three times as old as his son, and their ages add up to 52, how old is Eric's son?
def solve() -> int: son_age = 0 eric_age = 0 son_age = 52 / 4 eric_age = 3 * son_age result = son_age return result
John has 17 coins in his pocket and 5 of them are dimes. How many dimes does John have?
def solve() -> int: no_of_dimes = 0 no_of_coins_in_Johns_pocket = 17 no_of_dimes_in_Johns_pocket = 5 no_of_dimes = no_of_dimes_in_Johns_pocket result = no_of_dimes return result
Student: A family plans a 5-day vacation trip. They have $800 in the bank to spend and they estimate the daily spending to be $120. They know they will need 3 meals per day (cost about $20 each meal). How much money will they have when they come back from the vacation?
def solve() -> int: total_days = 5 total_money = 800 daily_spending = 120 meals_per_day = 3 meal_cost = 20 total_meal_cost = meals_per_day * meal_cost * total_days total_spending = daily_spending * total_days + total_meal_cost remaining_money = total_money - total_spending result = r...
There are 90 pieces of confetti, if 2/3 are red and the rest are green, how many are green?
def solve() -> int: redConfetti = 90 / 3 * 2 totalConfetti = redConfetti remainingConfetti = 90 - totalConfetti result = remainingConfetti return result
A jar contains twice as many red balls as blue balls. If there are 24 red balls, how many blue balls are there in the jar?
def solve() -> int: red_balls = 24 total_balls = red_balls*3 blue_balls = total_balls - red_balls result = blue_balls return result
If a store offers a 10% discount on an item that costs $50, what is the new price of the item?
def solve() -> int: original_price = 50 discount_percent = 10 discounted_price = original_price - (original_price * (discount_percent / 100)) result = discounted_price return result
At a restaurant, a group of 6 people had a total bill of $108. If they want to leave a 20% tip, how much will each person need to pay?
def solve() -> int: bill = 108 tip = 0.20 total_with_tip = bill + (bill * tip) amount_per_person = total_with_tip / 6 result = amount_per_person return result
Emma walked 5.6 miles to the grocery store. Matthew walked twice as far as Emma and Bryan walked an extra 2.4 miles. How many miles did Matthew and Bryan walk in total?
def solve() -> int: distance_emma = 5.6 distance_matthew = 2 * distance_emma distance_bryan = distance_matthew + 2.4 result = distance_matthew + distance_bryan return result
A circular cake has a diameter of 16 inches and is cut into 8 equal slices. What is the area of each slice?
def solve() -> int: cake_radius = 16/2 slice_area = 3.14*(cake_radius**2)/8 result = slice_area return result
In a class of 30 students, 20 students passed the exam. What percentage of students passed the exam?
def solve() -> int: total_students = 30 passed_students = 20 percentage_passed = (passed_students/total_students) * 100 result = percentage_passed return result
A school has 20 classes with 25 students each. Each student needs two notebooks and one pencil for the new term. A notebook costs 3 dollars and a pencil costs 1 dollar. How much money does the school need to buy all the notebooks and pencils for the students?
def solve() -> int: total_students = 20 * 25 total_notebooks = total_students * 2 total_pencils = total_students * 1 total_cost = total_notebooks * 3 + total_pencils * 1 result = total_cost return result
Two engineers can assemble three cars in two days. How many engineers will be needed to assemble six cars in four days?
def solve() -> int: cars_assembled = 3 days = 2 rate = cars_assembled / days new_cars = 6 new_days = 4 new_engineers = (new_cars * rate) / new_days result = new_engineers return result
Dave drives 80 km each day. If he has been driving for 10 days, how many kilometers will he have driven in total?
def solve() -> int: distance_per_day = 80 days_driven = 10 total_distance = distance_per_day * days_driven result = total_distance return result
A store manager calculated their sales tax and determined that the sales tax rate was 7%. If a customer pays $85.20 for an item, calculate the total price including sales tax.
def solve() -> int: item_price = 85.20 sales_tax_rate = 0.07 total_price = item_price + (item_price*sales_tax_rate) result = total_price return result
A group of friends decide to save money and go on a vacation. They each agree to save $200 every month. If they planned to go on vacation after 9 months, how much money will they have together for their trip? result =?
def solve() -> int: savings_per_person = 200 number_of_people = 5 months_of_saving = 9 total_savings = savings_per_person * number_of_people * months_of_saving result = total_savings return result
The ratio of dogs to cats at a shelter is 2:3. If there are 25 dogs, how many cats are there?
def solve() -> int: cats = 3/2*25 result = cats return result
Zoe and her friend Maya want to make some bracelets and sell them at the school fair. They need to buy some beads and strings to make the bracelets. Each bead costs $0.25 and each string costs $0.1. They want to make 20 bracelets, and each bracelet needs 10 beads and 1 string. How much money will they need to spend on ...
def solve() -> int: bead_cost = 0.25 string_cost = 0.1 bracelets = 20 beads_per_bracelet = 10 strings_per_bracelet = 1 total_bead_cost = bead_cost * bracelets * beads_per_bracelet total_string_cost = string_cost * bracelets * strings_per_bracelet total_material_cost...
Student: Kelly earns a 9% commission on all goods she sells. Last week, she sold a piece of furniture for $1200 and a painting for $800. If she saves 25% of her total earnings, how much does she save?
def solve() -> int: furniture_price = 1200 painting_price = 800 commission_rate = 0.09 furniture_commission = furniture_price * commission_rate painting_commission = painting_price * commission_rate total_earnings = furniture_commission + painting_commission savings_rate = 0.25 savings_a...
A fruit seller has 1200 apples. He sells 75% of them and gives away 50 apples to his friends. How many apples does he have left?
def solve() -> int: total = 1200 sold = total * 0.75 given = 50 remaining = total - sold - given result = remaining return result
Maria drove 60 miles in 2.5 hours on a highway but then had to slow down to an average speed of 40 mph for the next 30 miles. If she was fined $24 for each mile per hour over the speed limit and the limit was 55 mph, how much was her fine in total?
def solve() -> int: t1 = 2.5 d1 = 60 t2 = 30/40 d2 = 30 limit = 55 speeding_distance = (d1 + d2) - t1 * limit - t2 * limit fine = speeding_distance * 24 result = fine return result
Elizabeth has 2 boxes with 18 buttons in each box. Nathan has 5 boxes with 7 buttons in each box. How many more buttons does Nathan have?
def solve() -> int: boxes_elizabeth = 2 boxes_nathan = 5 buttons_elizabeth = boxes_elizabeth * 18 buttons_nathan = boxes_nathan * 7 result = buttons_nathan - buttons_elizabeth return result
A recipe for a cake requires 2 cups of flour, 1 cup of sugar, and 3 eggs. How many cakes can be made with 10 cups of flour, 6 cups of sugar, and 15 eggs?
def solve() -> int: cakes_with_flour = 10 / 2 cakes_with_sugar = 6 / 1 cakes_with_eggs = 15 / 3 cakes = min(cakes_with_flour, cakes_with_sugar, cakes_with_eggs) result = cakes return result
Some possible questions are: Leah has a lemonade stand. She makes 8 liters of lemonade every day and sells it for $0.5 per cup. Each cup holds 250 mL of lemonade. In one week, she made a total of $84 from selling lemonade. How many cups of lemonade did she sell each day?
def solve() -> int: liters_to_mL = 8 * 1000 total_cups = liters_to_mL / 250 cups_sold_week = 84 / 0.5 cups_sold_day = cups_sold_week / 7 result = cups_sold_day return result
Student: If a train travels 200 miles in 4 hours, what is its speed in miles per hour?
def solve() -> int: distance = 200 time = 4 speed = distance / time result = speed return result
If 4 pizzas are shared equally among 8 people, how many slices of pizza will each person have?
def solve() -> int: pizzas = 4 people = 8 slices_per_person = (pizzas * 8) / people result = slices_per_person return result
On Monday, Leo goes shopping and spends $7. On Tuesday, he spends four times as much as he did on Monday. On Wednesday, he spends twice the amount he spent on Tuesday plus three times more than what he had on Monday. How much money does Leo spend on Wednesday?
def solve() -> int: amount_monday = 7 amount_tuesday = 4 * amount_monday amount_wednesday = (2 * amount_tuesday) + (3 * amount_monday) result = amount_wednesday return result
A religious group organised a pilgrimage to a holy place. They had 3 cars and 2 trucks, each car can take a maximum of 7 passengers and each truck can take a maximum of 10 passengers. How many more passengers can the group take together?
def solve() -> int: total_capacity_of_cars = 3 * 7 total_capacity_of_trucks = 2 * 10 total_capacity = total_capacity_of_cars + total_capacity_of_trucks result = total_capacity - 32 return result
8. A salsa company just filled 4 containers with salsa. If each container can hold 35 bottles of salsa and the company used 345 bottles in total, how many bottles are in each container?
def solve() -> int: total_bottles = 345 num_containers = 4 bottles_per_container = (total_bottles / num_containers) result = bottles_per_container return result
Ali borrowed $2000 from his friend at 5% interest per year for 3 years. How much interest did Ali have to pay after 3 years?
def solve() -> int: p = 2000 r = 5/100 t = 3 interest = p*r*t result = interest return result