question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Student: 2. Shira needs 6 blocks of ice for the party. Each block of ice weights 3 kilograms. What is the total weight of the blocks of ice that she needs in kilograms?
def solve() -> int: blocks = 6 weight = 3 total_weight = blocks * weight result = total_weight return result
A rectangular room is 10 feet long and 8 feet wide. If the room has a ceiling height of 6 feet, what is the volume of the room in cubic feet?
def solve() -> int: length = 10 width = 8 height = 6 volume = length * width * height result = volume return result
There are three grocery stores and Ali has to buy groceries from two of them. First, he chose store A and store B and found that their total bill is $70. Later, he noted that store B and store C bill is $90 and store A and store C bill is $80. What would be Ali's total bill when he shops in all stores?
def solve() -> int: bill_a_b = 70 bill_a_c = 80 bill_b_c = 90 total_bill = (bill_a_b + bill_a_c + bill_b_c) / 2 result = total_bill return result
Emma has 12 muffins that she wants to split equally among her and her 3 friends. If each person gets 2 muffins, how many muffins will Emma have left for later?
def solve() -> int: muffins = 12 friends = 3 muffins_per_person = 2 muffins_given = friends * muffins_per_person muffins_left = muffins - muffins_given result = muffins_left return result
A company has 600 employees. In a survey, 80% of the employees said they were satisfied with their job. How many employees are satisfied with their job?
def solve() -> int: total_employees = 600 percentage_satisfied = 80 satisfied_employees = (percentage_satisfied / 100) * total_employees result = satisfied_employees return result
Daisy bakes a cake every 2 days. How many cakes will she bake in a month (30 days)?
def solve() -> int: days_in_month = 30 cakes_per_day = 1/2 cakes_in_month = days_in_month * cakes_per_day result = cakes_in_month return result
Henry has 99 erasers. He gives away one sixth of them, then a third of the remaining erasers away. How many erasers does Henry have left?
def solve() -> int: erasers_given = 99 * 0.17 erasers_remaining = 99 - erasers_given erasers_given_again = erasers_remaining * 0.33 erasers_left = erasers_remaining - erasers_given_again result = erasers_left return result
Student: There are 12 oranges in a box and each orange costs $1.25. What is the total cost of all the oranges in the box?
def solve() -> int: num_oranges = 12 price_per_orange = 1.25 total_cost = num_oranges * price_per_orange result = total_cost return result
Audrey, Lucas, Bella, and Oliver each have a favorite food. Audrey's favorite food is 3 more slices of pizza than Lucas's favorite food. Bella's favorite food is double Lucas's favorite food, and Oliver's favorite food is 3/4 as much as Bella's favorite food. If Lucas's favorite food is a whole pizza, what is the total...
def solve() -> int: lucas_favorite_food = 1 audrey_favorite_food = lucas_favorite_food + 3 bella_favorite_food = lucas_favorite_food * 2 oliver_favorite_food = bella_favorite_food * 3/4 total_slices = lucas_favorite_food + audrey_favorite_food + bella_favorite_food + oliver_favorite_food ...
Jack has 500 marbles. If he gives one-third to his sister and two-fifths to his brother, how many more marbles will he have left than his sister after the gifting?
def solve() -> int: num_marbles = 500 sisters_marbles = num_marbles/3 brothers_marbles = (2*num_marbles)/5 jacks_marbles_left = num_marbles - sisters_marbles - brothers_marbles result = jacks_marbles_left - sisters_marbles return result
(make sure to write the programs properly and correctly! ) The sum of two numbers is 20 and their difference is 8, what are the two numbers?
def solve() -> int: number1 = 20 number2 = number1 - 8 result = [number1, number2] return result
The distance between two cities is 700 kilometers. How long it will take to travel the distance at the speed of 50 km/h?
def solve() -> int: distance = 700 speed = 50 time = distance/speed result = time return result
Jeremy wants to purchase a new bike that costs $500. If he already has 20% of the amount, how much more money does he need to buy the bike?
def solve() -> int: amount_of_bike = 500 already_have = amount_of_bike * 0.2 money_needed = amount_of_bike - already_have result = money_needed return result
Mason was owed $50 by his friend. A few days later, his friend paid him back 80% of what he owed. The next day, his friend borrowed an additional $25. How much money does Mason's friend still owe him?
def solve() -> int: owed_amount = 50 paid_back_amount = owed_amount * 0.8 remaining_amount = owed_amount - paid_back_amount borrowed_amount = 25 total_owed_amount = remaining_amount + borrowed_amount result = total_owed_amount return result
Student: Tom is cooking dinner. It takes him 10 minutes to prep the vegetables, 20 minutes to cook the rice, and 15 minutes to cook the main dish. How long does dinner take him to make?
def solve() -> int: prep_time = 10 rice_time = 20 main_dish_time = 15 total_time = prep_time + rice_time + main_dish_time result = total_time return result
Jacob had $32 and gave $16 to Han. He then spent half of the new remainder on clothes. How much money does Jacob have left?
def solve() -> int: initial_amount = 32 given_to_han = 16 remainder = initial_amount - given_to_han spent_on_clothes = remainder/2 final_amount = initial_amount - given_to_han - spent_on_clothes result = final_amount return result
Amy is buying ingredients to make lasagna for her dinner party. She needs 2 pounds of ground beef and a box of lasagna noodles. Each pound of beef costs $5 and the box of noodles is $3. How much will she spend on beef and noodles if she has budgeted $20 for ingredients?
def solve() -> int: beef_cost = 5 noodles_cost = 3 budget = 20 beef_quantity = 2 noodles_quantity = 1 total_cost = (beef_cost * beef_quantity) + (noodles_cost * noodles_quantity) result = total_cost return result
Andrea sells a television every day for $200. If she sells 280 televisions, how much money has she made?
def solve() -> int: price_tv = 200 n_tvs_sold = 280 rev_generated = price_tv*n_tvs_sold result = rev_generated return result
Joseph has 80 candies. He shares them with his friend, dividing them equally between them. How many candies do they each get?
def solve() -> int: total_candies = 80 friends = 2 candies_per_friend = total_candies / friends result = candies_per_friend return result
Student: Zoe has 30 marbles. She gives 1/3 of her marbles to her friend and 1/4 of her marbles to her sister. How many marbles does Zoe have now?
def solve() -> int: marbles = 30 friend = marbles // 3 sister = marbles // 4 left = marbles - friend - sister result = left return result
Lily was four years old when her sister was born. If her sister is now half Lily's age, how old is Lily?
def solve() -> int: lily_age = 4 sister_age = lily_age + 2 lily_age = sister_age * 2 result = lily_age return result
A truck travels at a speed of 50 km/h for 2 hours, then at a speed of 70 km/h for 3 hours. What is the total distance traveled by the truck?
def solve() -> int: speed1 = 50 time1 = 2 speed2 = 70 time2 = 3 distance1 = speed1 * time1 distance2 = speed2 * time2 total_distance = distance1 + distance2 result = total_distance return result
Floyd had 65 tomatoes, but he ate 15 of them and gave 10 to his neighbor. How many tomatoes does he have now?
def solve() -> int: num_tomatoes = 65 eaten_tomatoes = 15 given_tomatoes = 10 num_tomatoes_updated = num_tomatoes - eaten_tomatoes - given_tomatoes result = num_tomatoes_updated return result
John bought 10 rare stamps for $20 each. He sells 4 of them for $40 each. The remaining stamps decreased in value by 15%. What is John's profit?
def solve() -> int: num_stamps_bought = 10 cost_per_stamp = 20 num_stamps_sold = 4 selling_price_per_stamp = 40 decrease_percentage = 15 total_cost = num_stamps_bought * cost_per_stamp total_revenue = num_stamps_sold * selling_price_per_stamp remaining_stamps = num_stamps_bought - n...
Student: A box contains a mixture of 3 blue balls and 7 red balls. If 4 balls are drawn, what is the probability of getting 2 blue balls and 2 red balls?
def solve() -> int: blue_balls = 3 red_balls = 7 total_balls = blue_balls + red_balls drawn_balls = 4 total_outcomes = total_balls * (total_balls - 1) * (total_balls - 2) * (total_balls - 3) favorable_outcomes = blue_balls * (blue_balls - 1) * red_balls * (red_balls - 1) probability = favora...
Student: A bakery makes 500 cupcakes a day, and sells them for $2.50 each. The cost of ingredients and labor for each cupcake is $1.00. The bakery also pays a fixed rent of $1000 a month, and a variable utility fee of $0.10 per cupcake. How much profit does the bakery make in a month, assuming 30 days?
def solve() -> int: cupcakes_per_day = 500 price_per_cupcake = 2.50 cost_per_cupcake = 1.00 fixed_rent = 1000 variable_utility_fee = 0.10 days_in_month = 30 total_cupcakes_in_month = cupcakes_per_day * days_in_month total_revenue = total_cupcakes_in_month * price_per_cupcake total_co...
A building is 150 feet tall. If a person stands 5 feet tall, how many people standing on top of each other would it take to reach the roof of the building?
def solve() -> int: height_people = 5 num_people = 150/height_people result = num_people return result
A triangle has a base of 14 cm and a height of 8 cm. What is its area?
def solve() -> int: base = 14 height = 8 area = 0.5 * base * height result = f'The area of the triangle is {area} sq cm' result = area return result
Possible questions and programs: Mona bought a pair of shoes for $40 and a dress for three times the price of the shoes. She paid with a $100 bill and a $50 bill. How much change did she get back?
def solve() -> int: shoes = 40 dress = 3 * shoes paid = 100 + 50 change = paid - (shoes + dress) result = change return result
Student: Adam was offered two dozen doughnuts. He ate 12 and then gave away 8. How many doughnuts did Adam have left?
def solve() -> int: doughnuts_offered = 2 * 12 doughnuts_eaten = 12 doughnuts_given = 8 doughnuts_left = doughnuts_offered - doughnuts_eaten - doughnuts_given result = doughnuts_left return result
A shopping mall increased its parking space by 25%, allowing 60 more cars to park. However, at the end of the day, traffic was so bad that 1/6 of the parked cars had to leave early. If the original number of parking spaces was 300, calculate the final number of cars that were parked by the end of the day.
def solve() -> int: original_parking_spaces = 300 increase_percentage = 25 additional_parking_spaces = original_parking_spaces * increase_percentage / 100 total_parking_spaces = original_parking_spaces + additional_parking_spaces additional_cars_parked = 60 total_cars_parked = total_parking...
The Smiths are buying drinks for their camping trip. There are 8 family members and they are inviting their neighbors, who are a family of 4. They order 12 extra drinks just in case. If each drink costs $1.50, what is the total cost for all the drinks?
def solve() -> int: smith_family = 8 neighbor_family = 4 total_people = smith_family + neighbor_family extra_drinks = 12 total_drinks = total_people * 2 + extra_drinks cost_per_drink = 1.5 total_cost = total_drinks * cost_per_drink result = total_cost ...
If the perimeter of a square is 36 units, what is the length of one side of the square?
def solve() -> int: p = 36 side_length = p/4 result = side_length return result
A toy store provides a 12% discount for every purchase worth $100 or more. Robbie bought a remote-controlled car for $60, a stuffed toy for $23, and a game worth $17. How much did Robbie pay for those items?
def solve() -> int: car_price = 60 toy_price = 23 game_price = 17 total_price = car_price + toy_price + game_price if total_price >= 100: discount = total_price * 0.12 total_price -= discount result = total_price return result
Tom has a salary of $5000 per month with an increase of 10% each year. What will his salary be in 5 years?
def solve() -> int: salary = 5000 increase = 0.1 total_years = 5 for i in range(total_years): salary = salary * (1 + increase) result = salary return result
Thomas went to a jewelry store to buy a necklace for his girlfriend. The necklace was priced at $125.00. The salesman offered a discount of 20%. What was the final price of the necklace?
def solve() -> int: price = 125.00 discount = 0.20 discount_amount = price * discount final_price = price - discount_amount result = final_price return result
*** Here are some possible questions and programs: Harry has three times as many marbles as his brother, Tom. Tom has only a third as many marbles as his sister, Mia. If Mia gives away 9 of her marbles to a friend, how many marbles does Harry have, which he could also choose to give away to his friend?
def solve() -> int: gave_away = 9 mia = 3 * gave_away + 9 tom = mia / 3 harry = 3 * tom result = int(harry) return result
Tom has $50. He spends 20% of his money on food and then 30% of the remaining money on clothes. How much money does Tom have left?
def solve() -> int: total_money = 50 food_cost = total_money * 0.2 remaining_money = total_money - food_cost clothes_cost = remaining_money * 0.3 total_leftover_money = remaining_money - clothes_cost result = round(total_leftover_money, 2) return result
A cell phone company offers a monthly plan for $50 and an additional $10 per gigabyte of data. If someone used 5 gigabytes of data in a month, what is their total bill?
def solve() -> int: monthly_cost = 50 per_gig_cost = 10 gig_used = 5 total_cost = monthly_cost + (per_gig_cost * gig_used) result = total_cost return result
John is building shelves, and it takes him 10 minutes to make each shelf. How many shelves can he make in 4 hours?
def solve() -> int: time = 4 per_shelf = 10 total_shelves = time * (60 / per_shelf) result = total_shelves return result
A pitcher contains 4.5 liters of juice and can hold up to 5 liters. How many liters more of juice are needed to fill the pitcher to its brim?
def solve() -> int: juice_in_pitcher = 4.5 pitcher_capacity = 5.0 liters_needed = pitcher_capacity - juice_in_pitcher result = liters_needed return result
Student: David bought a bag of peanuts. In the bag he found 4 peanuts for every 7 walnuts. There were a total of 144 peanuts in the bag. How many walnuts were there?
def solve() -> int: peanuts = 144 walnuts = 0 walnuts = peanuts * 7 / 4 result = walnuts return result
Aaron wants to buy 3 bottles of water, 2 cans of energy drink, and 1 pack of chewing gum. One bottle of water costs $0.80, and one can of energy drink costs $1.50. The pack of chewing gum costs $1. How much does Aaron need to pay for his purchases?
def solve() -> int: water_price = 0.80 energy_drink_price = 1.50 gum_price = 1 num_water = 3 num_energy_drink = 2 num_gum = 1 total_cost = (water_price * num_water) + (energy_drink_price * num_energy_drink) + (gum_price * num_gum) result = total_cost return result...
Amy has 8 marbles. She gives her brother 3 more than what she has. How many marbles does Amy's brother have?
def solve() -> int: Amy_marbles = 8 given_marbles = 3 Brother_marbles = Amy_marbles + given_marbles result = Brother_marbles return result
A store purchased 20 dresses, 15 pants and 10 shirts for a total of $2250. If a dress costs $75, a pant costs $45, how much does a shirt cost?
def solve() -> int: num_dresses = 20 dress_cost = 75 num_pants = 15 pant_cost = 45 total_cost = 2250 num_shirts = total_cost - ((num_dresses * dress_cost) + (num_pants * pant_cost)) shirt_cost = num_shirts/10 result = shirt_cost return result
Alex wants to buy a watch. He can get a 12% discount on a $500 watch with Rolex. He can also save 25% off a $700 watch with Tissot. How much money would he save by choosing the cheapest watch?
def solve() -> int: discount_rolex = 0.12 discount_tissot = 0.25 price_rolex = 500 price_tissot = 700 savings_rolex = price_rolex * discount_rolex savings_tissot = price_tissot * discount_tissot if savings_rolex < savings_tissot: cheapest_watch = "Rolex" savings = s...
Mary and Jane have a total of $35 in their wallets. Mary has $8 more than Jane. How much money does Jane have?
def solve() -> int: wallet_total = 35 mary_money = (wallet_total + 8) / 2 jane_money = wallet_total / 2 - 4 result = jane_money return result
Some possible questions and programs are: Ellie is collecting apples from her orchard. She has 12 trees, and each tree produces 24 apples. She can fit 9 apples in a basket, and she needs to fill 18 baskets. How many apples will she have left over after filling the baskets?
def solve() -> int: total = 12 * 24 needed = 9 * 18 leftover = total - needed result = leftover return result
The length of a rectangle is 4 cm longer than its width. If its area is 63 cm², what are the dimensions of the rectangle?
def solve() -> int: area = 63 width = (area / 4) ** 0.5 length = width + 4 result = (length, width) return result
Student: A store had $5000 in revenue last month. $1200 of the revenue was used to pay rent. What percentage of the revenue was spent on rent last month?
def solve() -> int: revenue = 5000 rent = 1200 percentage = rent / revenue * 100 result = percentage return result
If the number of cars in the parking lot increased from 614 to 845, how many cars were added to the lot?
def solve() -> int: first_num = 614 sec_num = 845 cars_added = sec_num - first_num result = cars_added return result
Elena has a bag of 20 candies. She gives 25% of them to her sister and 15% of them to her brother. She eats 3 candies herself and saves the rest for later. How many candies does Elena have left?
def solve() -> int: candies = 20 candies_sister = candies * 0.25 candies_brother = candies * 0.15 candies_eaten = 3 candies_given = candies_sister + candies_brother candies_left = candies - candies_given - candies_eaten result = candies_left return result
John is making a dress for a dance party. He needs to make a skirt and a top. The skirt requires a rectangular piece of fabric that measures 6 feet by 3 feet, while the top requires 3 square feet of fabric. If the cost of fabric is $5 per square foot, how much will John spend on the fabric?
def solve() -> int: skirt_length = 6 skirt_width = 3 top_area = 3 skirt_area = skirt_length * skirt_width total_area = skirt_area + top_area cost_per_square_foot = 5 total_cost = total_area * cost_per_square_foot result = total_cost return result
A car uses 40% of its fuel for a journey of 400 miles. If Caroline spent $80 for the fuel for the whole journey and spent twice the amount spent on fuel on accommodation, how much did she spend in total?
def solve() -> int: fuel_used = 0.4 distance = 400 fuel_cost = 80 accommodation_cost = fuel_cost * 2 total_cost = fuel_cost + accommodation_cost fuel_used_for_whole_journey = distance / fuel_used total_cost += accommodation_cost result = total_cost return result
Liam put 45 coins in his piggy bank. His sister, Emma, then removed 1/9 of the coins Liam had put in. If there are now 40 coins in the piggy bank, how many coins were originally put in the piggy bank?
def solve() -> int: coins_in_piggy_bank = 45 removed_coins = coins_in_piggy_bank / 9 remaining_coins = coins_in_piggy_bank - removed_coins if remaining_coins == 40: original_coins = coins_in_piggy_bank else: original_coins = (40 * 9) / 8 result = original_coins return result
A pizza place charges $10 per pizza with one free topping. If Jane orders 4 pizzas and 2 additional toppings, how much will the order cost?
def solve() -> int: num_pizzas = 4 num_toppings = 2 total_cost = (num_pizzas * 10) + (num_toppings * 2) result = total_cost return result
A square garden is surrounded by a 6 feet tall fence. If the garden is 40 feet wide, how much fencing material is required to build the entire garden?
def solve() -> int: width = 40 height = 6 fence_length = width * 4 result = fence_length return result
Gina has 10 ducks. She buys food to feed them 2 times in a month. She feeds them 6 pounds of food each feeding. How many pounds of food should she buy in total?
def solve() -> int: ducks = 10 feedings = 2 food_per_duck_per_feeding = 6 food_needed_for_all_ducks = ducks * feedings * food_per_duck_per_feeding result = food_needed_for_all_ducks return result
Student: Mark works at a car wash and earns a base pay of $10 per hour. In addition to this, he receives a 20% commission on the total amount of car wash packages he sells. During a 4-hour shift, he sold 10 deluxe car wash packages at $20 each, and 12 regular car wash packages at $10 each. How much does he earn (before...
def solve() -> int: base_pay = 10 deluxe_package_price = 20 regular_package_price = 10 shift_hours = 4 deluxe_package_sold = 10 regular_package_sold = 12 total_package_sold = deluxe_package_sold + regular_package_sold total_package_earnings = (deluxe_package_price * deluxe_package_...
Susan has 36 pieces of candy. She wants to divide them equally among her 6 friends, but keeps 4 pieces for herself. How many pieces of candy does each of Susan's friends receive?
def solve() -> int: candy = 36 friends = 6 candy_remaining = candy - 4 result = candy_remaining / friends return result
A recipe calls for 2 cups of sugar to make 24 cookies. How many cups of sugar are needed to make 72 cookies?
def solve() -> int: cookies_needed = 72 cookies_produced = 24 sugar_needed = 2 result = (sugar_needed / cookies_produced) * cookies_needed return result
Suppose Lisa has to pay $14.00 for her daily commute and an extra $3.50 for parking. If she commutes to work for five days a week, how much will she spend on transportation in a month?
def solve() -> int: commute_cost = 14.00 parking_cost = 3.50 days_per_week = 5 weeks_per_month = 4 total_cost = (commute_cost + parking_cost) * days_per_week * weeks_per_month result = total_cost return result
Rachel worked for 5 hours at a rate of $8 per hour. She then spent 1/4 of her earnings on lunch and 1/3 of what was left on shopping. How much money did Rachel have left from her earnings, in dollars?
def solve() -> int: hours_worked = 5 rate_per_hour = 8 earnings = hours_worked * rate_per_hour money_spent_lunch = earnings / 4 earnings_left = earnings - money_spent_lunch money_spent_shopping = earnings_left / 3 total_money_left = earnings_left - money_spent_shopping result = to...
Joe has a tuition fee of $120 and he receives a 25% discount every month due to his good academic record. How much money does he need to pay for 3 months of his tuition fee?
def solve() -> int: tution_fee = 120 discount_first_month = tution_fee * 0.25 tution_fee_after_first_month = tution_fee - discount_first_month discount_second_month = tution_fee_after_first_month * 0.25 tution_fee_after_second_month = tution_fee_after_first_month - discount_second_month discount...
On Monday and Tuesday, 20 cars drove by Happy Street, and 20% less cars drove the following days. On Sunday, how many cars drove by?
def solve() -> int: total_cars = 20 percent = 0.80 result_mon = total_cars result_tue = total_cars result_wed = total_cars * percent result_thu = result_wed * percent result_fri = result_thu * percent result_sat = result_fri * percent result_sun = r...
Student: To win a brand new puzzle at Emily's Toy Store, an attendee has to win 6 yellow vouchers; each yellow voucher is obtained by trading in 8 red vouchers; each red voucher is obtained by trading in 12 blue vouchers; and blue vouchers are earned by solving a math problem. Ricky has traded some possessions with his...
def solve() -> int: yellow_needed = 6 red_per_yellow = 8 blue_per_red = 12 yellow_ricky = 3 red_ricky = 4 blue_ricky = 47 total_yellow_ricky = yellow_ricky + red_ricky // red_per_yellow total_red_ricky = red_ricky % red_per_yellow + (blue_ricky // blue_per_red) * (red_per_yellow // blue_...
David is a contractor. He earns $5,000 for each home renovation he completes. Last year, he renovated five homes. What was David's total earnings for the year?
def solve() -> int: renovation_fee = 5000 num_homes_renovated = 5 total_earnings = renovation_fee * num_homes_renovated result = total_earnings return result
Student: A salon has a 15% discount on their services. If the original price for a haircut is $40, how much will it cost after the discount?
def solve() -> int: original_price = 40 discount_percentage = 15 discount_amount = original_price * (discount_percentage / 100) discounted_price = original_price - discount_amount result = discounted_price return result
A train travels a distance of 540 kilometers in 6 hours. What is the average speed of the train in kilometers per hour?
def solve() -> int: distance = 540 time = 6 speed = distance/time result = speed return result
A fence is being built around a square garden. Each fence panel is 5 feet wide and there must be at least 3 feet of space between panels and the garden. If the garden is 18 feet wide, how many fence panels will be needed?
def solve() -> int: garden_width = 18 total_width = garden_width + 2*3 num_panels = total_width // 5 result = num_panels return result
Alex has 5/6 of a cake. If he wants to evenly share it with 3 friends, how much cake will each of them get?
def solve() -> int: cake_whole = 1 frac_left = 5/6 num_friends = 3 total_cakes_frac = frac_left * cake_whole total_cakes_dec = float(total_cakes_frac) result = total_cakes_dec / num_friends return result
Rebecca is 15 years old. Five years ago, Rebecca added her age with her grandmother's age and the sum was 65. How old is Rebecca's grandmother today?
def solve() -> int: rebecca_age = 15 sum_5_years_ago = 65 rebecca_grandmother_age_5_years_ago = sum_5_years_ago - rebecca_age rebecca_grandmother_age = rebecca_grandmother_age_5_years_ago + 5 result = rebecca_grandmother_age return result
imon has 6 apples and he wants to share them with his friends. Each friend needs 1/3 of an apple. How many more friends does Simon need to share his apples?
def solve() -> int: apples = 6 friend_portion = 1/3 result = (apples // friend_portion) - 1 return result
Student: 7. On her way to school, Leah needed to bike 32 miles. She biked at a constant speed of 14 miles per hour. How many hours did it take Leah to bike to school?
def solve() -> int: distance = 32 speed = 14 time = distance / speed result = time return result
Tom has three times as many tulips as daffodils in his garden. If there are 14 daffodils, how many tulips does Tom have?
def solve() -> int: number_daffodils = 14 number_tulips = number_daffodils * 3 result = number_tulips return result
Hoona needs to set aside 45 minutes of her day to study for an upcoming exam. She finds that each problem in her workbook takes her 12 minutes to complete. How many problems can she solve?
def solve() -> int: time_for_studying = 45 time_per_problem = 12 problems_solved = time_for_studying / time_per_problem result = problems_solved return result
If Sam can finish a puzzle in 2 hours, and he increases his puzzle-solving speed by 50%, how long will it take him to finish the same puzzle?
def solve() -> int: puzzle_time = 2 speed_increase = 0.5 new_puzzle_time = puzzle_time * (1 - speed_increase/100) result = new_puzzle_time return result
In a survey, 80% of the respondents stated that they supported a certain policy. If there were 500 respondents, and 1/5 of those who supported the policy changed their minds, how many people were left in support of the policy?
def solve() -> int: respondents = 500 support_percentage = 80 supporters = respondents * support_percentage / 100 changed_minds = supporters / 5 remaining_supporters = supporters - changed_minds result = remaining_supporters return result
In ten years, Willa will be four times as old as Eli. If Eli is now 5 years old, how old is Willa now?
def solve() -> int: eli_age = 5 willa_age_in_ten_years = 4 * (eli_age + 10) willa_age = willa_age_in_ten_years - 10 result = willa_age return result
A bus with a capacity of 40 passengers went on a trip. If there were 10 empty seats on the bus, what is the percentage of occupied seats?
def solve() -> int: capacity = 40 occupied_seats = capacity - 10 percentage_of_occupied_seats = occupied_seats/capacity * 100 result = percentage_of_occupied_seats return result
After living in the same apartment for 15 years, Mark decided it was time to upgrade to a new place. His new apartment was twice as expensive as the old one, plus he had to pay a broker fee of $3,980. How much money did Mark spend upgrading to the new apartment?
def solve() -> int: old_apartment = 15 * 780 extra_cost = 2 * old_apartment fee = 3980 total_cost = extra_cost + fee result = round(total_cost, 2) return result
John has 2 fewer than twice as many books as his friend Lucy. If Lucy has 14 books, how many books does John have?
def solve() -> int: lucy_books = 14 john_books = 2 * lucy_books - 2 result = john_books return result
Helen was at a retail store where you pay based on the weight of jewelry. She buys 25 grams of silver earrings and then gets 12 grams of gold earrings, in the ratio of 4:3 to silver earrings. Then she gets 5 grams of diamond earrings, making up 18% of the weight of earrings in the bag. How many grams of earrings does s...
def solve() -> int: silver_earrings = 25 gold_earrings = (12/7)*4 total_weight = silver_earrings + gold_earrings + 5 result = total_weight/(1-0.18) return result
If a flower shop sells 8 bouquets every hour and is open for 9 hours in a day, how many bouquets do they sell in a day?
def solve() -> int: bouquets_per_hour = 8 hours_open = 9 total_bouquets = bouquets_per_hour * hours_open result = total_bouquets return result
A room measures 10 m in length, 6 m in width and 4 m in height. What is the volume of the room?
def solve() -> int: length = 10 width = 6 height = 4 volume = length*width*height result = volume return result
There are 3 birds in line for the bird bath and five times as many birds waiting for the bird feeder. If each bird spends 1 minute in the bird bath and 10 seconds at the bird feeder, how many seconds shorter is the shorter wait?
def solve() -> int: birds_in_bath = 3 birds_waiting_feeder = 5 * birds_in_bath time_in_bath = birds_in_bath * 60 time_at_feeder = birds_waiting_feeder * 10 shorter_wait = time_in_bath - time_at_feeder result = shorter_wait return result
A rectangle has a perimeter of 24 cm. If its length is twice its width, what are the dimensions of the rectangle?
def solve() -> int: w = 4 l = 2 * w result = (l, w) return result
When a car travels 50 miles in 1 hour, how long will it take for the car to travel 120 miles?
def solve() -> int: distance_1 = 50 time_1 = 1 distance_2 = 120 speed = distance_1 / time_1 time_2 = distance_2 / speed result = time_2 return result
There are 50 guests invited to a party. The host has 6 bottles of wine, each containing 750 milliliters of wine. She pours 100 milliliters of wine for each guest. Unfortunately, one of the bottles fell and 400 milliliters of wine were spilled. How much wine is left?
def solve() -> int: num_guests = 50 num_bottles = 6 wine_per_bottle = 750 wine_per_guest = 100 wine_spilled = 400 total_wine = num_bottles * wine_per_bottle wine_poured = num_guests * wine_per_guest remaining_wine = total_wine - wine_poured - wine_spilled result = remain...
Mark has 740 apples. He wants to divide them into equal groups and each group should have 18 apples. How many groups are there?
def solve() -> int: num_apples = 740 num_apples_per_group = 18 num_groups = num_apples / num_apples_per_group result = num_groups return result
Casey works for a dog grooming company as a groomer. She gets paid $18 per hour, plus $5 for every dog she grooms, and $3 for every dog she washes. Today, she worked for seven hours, groomed 10 dogs, and washed 12 dogs. She also had to pay for her own parking for $6. How many dollars did she earn for her work today?
def solve() -> int: hourly_wage = 18 grooming_fee = 5 washing_fee = 3 parking_expense = 6 hourly_wage_earned = hourly_wage * 7 grooming_fee_earned = grooming_fee * 10 washing_fee_earned = washing_fee * 12 parking_expense_paid = parking_expense total_earned = hourly_wage_...
Adam is 30 years old today. In 7 years, he will be the age his father was when Adam was born, which was 42 years ago. How old is Adam's father today?
def solve() -> int: adam_age = 30 years_in_future = 7 father_age_when_adam_born = 42 adam_age_in_future = adam_age + years_in_future father_age_in_past = adam_age_in_future + father_age_when_adam_born father_age_today = father_age_in_past - years_in_future result = father_age_...
A box contains 3 green balls, 6 red balls, and 5 blue balls. What is the total percentage of red and green balls?
def solve() -> int: total_balls = 14 green_balls = 3 red_balls = 6 percentage_red_green = ((green_balls+red_balls)/total_balls)*100 result = percentage_red_green return result
Anna wants to buy 3 different board games for her kids. The first and second board game cost $25 each and the third one costs 10% more than the first two. How much does Anna have to pay in total?
def solve() -> int: total_cost1 = 2 * 25 cost_3rd_boardgame = total_cost1 * 0.1 + total_cost1 total_cost = total_cost1 + cost_3rd_boardgame result = total_cost return result
Student: A store sells a shirt for $20 and a pair of pants for $30. If Marcy buys two shirts and three pants, how much does she spend?
def solve() -> int: shirt_price = 20 pants_price = 30 shirt_quantity = 2 pants_quantity = 3 shirt_cost = shirt_price * shirt_quantity pants_cost = pants_price * pants_quantity total_cost = shirt_cost + pants_cost result = total_cost return result
Student: A pizza costs 20 dollars each before tax is added. If the tax rate is 8%, what is the total cost of the pizza after tax?
def solve() -> int: cost_before_tax = 20 tax_rate = 0.08 tax = cost_before_tax * tax_rate total_cost = cost_before_tax + tax result = total_cost return result
arah and Carla had 20 books. Sarah had 3 times as many books as Carla. How many books did Sarah have?
def solve() -> int: num_books = 20 carla_books = num_books / (3 + 1) sarah_books = 3 * carla_books result = sarah_books return result
Oliver is planning a sightseeing tour and wants to see how long it will take him to reach the historical building. He decides that he will drive for 45 minutes to the parking lot, walk for 5 minutes to the entrance, wait for 15 minutes for the tour to start, and then visit the building for 2 hours. If Oliver’s entire t...
def solve() -> int: drive_time = 45 walk_time = 5 tour_wait_time = 15 building_visit_time = 120 total_trip_time = 190 total_travel_time = drive_time + walk_time + building_visit_time waiting_time = total_trip_time - total_travel_time - tour_wait_time result = waiting...
There are only red and green balloons in a party. The total number of balloons is 50. The number of green balloons is half the number of red balloons. If a red balloon costs $1.50 and a green balloon costs $2, what is the total cost of the green balloons?
def solve() -> int: red_balloons = 2 green_balloons = 1 total_balloons = 50 green_balloons = total_balloons / (red_balloons + green_balloons) * green_balloons total_cost = green_balloons * 2 result = total_cost return result
Tom has a collection of stamps. He has 8 albums, each with 20 pages. Each page can hold 15 stamps. He fills up 5 albums completely and leaves the rest empty. How many stamps does he have in his collection?
def solve() -> int: albums = 8 pages = 20 stamps = 15 filled = 5 * pages * stamps result = filled return result