question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A company has a profit margin of 25% on all items sold. If the cost of production of a product is $80, what is the selling price of the product?
def solve() -> int: cost_of_prod = 80 profit_margin = 0.25 selling_price = cost_of_prod + (cost_of_prod*profit_margin) result = selling_price return result
A recipe requires 2 cups of sugar for every 3 cups of flour. If you have 9 cups of flour, how much sugar do you need?
def solve() -> int: flour = 9 sugar_per_flour = 2 / 3 sugar_needed = sugar_per_flour * flour result = sugar_needed return result
Sophia is feeding her rabbits. Each rabbit needs 1 ounce of food per 1/4 pound of body weight. She has 15 pounds of rabbits. Each bag of food contains 12 ounces and costs $4. How much does it cost to feed the rabbits?
def solve() -> int: rabbits_weight = 15 food_per_pound = 1/4 food_per_rabbit = rabbits_weight * food_per_pound bags_of_food = food_per_rabbit / 12 cost_per_bag = 4 total_cost = bags_of_food * cost_per_bag result = total_cost return result
A basic phone plan costs $20 for the first month and $10 for every following month. Rohan has subscribed to this plan for 8 months. How much did he pay in total?
def solve() -> int: initial_cost = 20 each_month_cost = 10 n_of_months = 8 result = initial_cost + (n_of_months-1)*each_month_cost return result
Jake's bedroom has an area of 256 square feet. He wants to put furniture in it that takes up half the space. How much area is left for him to move around in the room? Emma had 60 candies to give out to her classmates. One third of them were chocolate, and the rest were divided equally between vanilla, strawberry, and m...
def solve() -> int: total_area = 256 furniture_area = total_area / 2 remaining_area = total_area - furniture_area total_candies = 60 chocolate_candies = total_candies / 3 other_candies = total_candies - chocolate_candies mint_candies = other_candies / 3 result = remaining_area,...
The sum of three consecutive odd numbers is 57. What is the smallest of the three numbers?
def solve() -> int: for num in range(1, 100): sum_of_threes = num + (num+2) + (num+4) if sum_of_threes == 57: result = num return result
Lindsay was given 72 books as a gift. She wants to divide them into stacks of 16 books. How many stacks can she make?
def solve() -> int: total_books = 72 books_per_stack = 16 total_stacks = total_books // books_per_stack result = total_stacks return result
A coffee shop has 200 customers per day and makes an average of $4 per customer. How much money do they make in 365 days?
def solve() -> int: number_of_customers_per_year = 200 * 365 average_revenue_per_customer = 4 total_revenue_per_year = number_of_customers_per_year * average_revenue_per_customer result = total_revenue_per_year return result
A company has 200 employees. If 35% of the employees are women, how many men work at the company?
def solve() -> int: total_employees = 200 women_percent = 35 women_employees = round(total_employees * (women_percent / 100)) men_employees = total_employees - women_employees result = men_employees return result
Jake has 18 coins. He spends 6 coins on a toy and then earns 9 coins for doing chores. How many coins does he have in total?
def solve() -> int: jake = 18 jake = jake - 6 jake = jake + 9 result = jake return result
A garden is 10 meters long and 5 meters wide. If she wants to put a fence around the garden, how much fence will she need?
def solve() -> int: length = 10 width = 5 fence = (2 * length) + (2 * width) result = fence return result
Mountain range is populated by bears. 50% of the bears are males. The rest are females. Among the females, 35% are cubs. There are 75 adult female bears. How many male bears are there? If Jack spends $600 per week on his salary where 1/4 of it goes to his personal expenses, 1/3 goes to his savings, and the rest goes to...
def solve() -> int: female_bears = 75 female_cubs_percentage = 35 male_bears_percentage = 50 female_adult_bears = female_bears / (1 - (female_cubs_percentage / 100)) total_bears = female_adult_bears / (1 - (male_bears_percentage / 100)) male_bears = total_bears * (male_b...
A catering company charges $15.00 per person for a taco buffet that includes 3 tacos, rice, beans, and salsa. If Rosa wants to order the buffet for her daughter's quinceañera party of 75 guests, how much will she pay in total, excluding tax and tip?
def solve() -> int: guests = 75 price_per_person = 15.00 total_cost = guests * price_per_person result = total_cost return result
A store is offering a 15% discount on all items. If a customer buys a $50 item, how much is discounted from the original price?
def solve() -> int: item_price = 50 discount = 0.15 discount_amount = item_price * discount result = discount_amount return result
Mia is trying to remember when her mother was born. She knows her mother's older sister was born in 1960, her younger brother was born in 1971, and the gap between her mother and her brother is half the gap between the older sister and the younger brother. What year was Mia's mother born?
def solve() -> int: older_sister_birth_year = 1960 younger_brother_birth_year = 1971 gap_between_sister_and_brother = younger_brother_birth_year - older_sister_birth_year gap_between_mother_and_brother = gap_between_sister_and_brother / 2 mother_birth_year = younger_brother_birth_year - ga...
A car rental company charges $50 per day plus $0.25 per kilometer driven. If a customer rents their car for 5 days and drives 120 kilometers, what is their total bill?
def solve() -> int: rental_days = 5 distance_driven = 120 rental_cost = (rental_days * 50) + (distance_driven * 0.25) result=rental_cost return result
John saved up 80 dollars over the summer. He spent a quarter of it on a new book and half of what's left on a new video game. How much money does John have left?
def solve() -> int: savings = 80 book_cost = savings / 4 remaining = savings - book_cost game_cost = remaining / 2 result = remaining - game_cost return result
Possible questions and programs are: Patrick likes to eat cereal for breakfast. He eats 1/2 cup of cereal per day. A box of cereal has 10 cups of cereal and costs $3. He also adds 1/4 cup of milk to his cereal. A gallon of milk has 16 cups and costs $4. How much does he spend on his breakfast per week?
def solve() -> int: cereal_per_day = 1/2 cereal_per_week = cereal_per_day * 7 cereal_per_box = 10 cereal_cost_per_box = 3 cereal_cost_per_cup = cereal_cost_per_box / cereal_per_box cereal_cost_per_week = cereal_cost_per_cup * cereal_per_week milk_per_day = 1/4 milk_per_week = milk...
Mark wants to split his land into 5 equal parts. If each part is 0.75 acres, what is the total area of his land?
def solve() -> int: num_parts = 5 part_area = 0.75 total_area = num_parts * part_area result = total_area return result
The perimeter of a square is 80cm. What is the area of the square?
def solve() -> int: perimeter = 80 side = perimeter / 4 area = side ** 2 result = area return result
Student: A faucet can fill a 5-gallon bucket in 45 seconds. How long will it take the faucet to fill a 7-gallon bucket?
def solve() -> int: bucket_5 = 5 bucket_7 = 7 time_5 = 45 rate = bucket_5 / time_5 time_7 = bucket_7 / rate result = time_7 return result
Emma collects seashells and wants to display them in her cabinet. The top shelf can hold 20 shells, the middle shelf can hold three times as many, and the bottom shelf can hold 15 shells with the shells divided equally among the two sections. As Emma is putting shells in the bottom section, one of the sections falls ou...
def solve() -> int: top_shelf_capacity = 20 middle_shelf_capacity = 3 * top_shelf_capacity bottom_shelf_capacity = 15 bottom_section_capacity = bottom_shelf_capacity / 2 total_capacity = top_shelf_capacity + middle_shelf_capacity + bottom_section_capacity result = total_capacity re...
There are 24 cupcakes and 8 children. Each child gets the same number of cupcakes. How many cupcakes will each child get?
def solve() -> int: total_cupcakes = 24 num_children = 8 cupcakes_per_child = total_cupcakes / num_children result = cupcakes_per_child return result
Mia wants to bake some cupcakes for her friends. She can bake 12 cupcakes at a time in her oven, which takes 20 minutes. She also needs 10 minutes to prepare the batter and 5 minutes to decorate each cupcake. She has enough ingredients for 36 cupcakes. If she wants to bake and decorate all the cupcakes, how many minute...
def solve() -> int: batches = 36 / 12 baking_time = batches * 20 preparing_time = batches * 10 decorating_time = 36 * 5 total_time = baking_time + preparing_time + decorating_time result = (total_time, batches) return result
If Noah wants to buy himself a camera for $100.00 and a tripod for $25.00, and he has $300.00, how many of his friends can have a camera and a tripod that cost $125.00 altogether?
def solve() -> int: noah_camera_cost = 100.00 noah_tripod_cost = 25.00 noah_total_cost = noah_camera_cost + noah_tripod_cost noah_budget = 300.00 noah_remaining_budget = noah_budget - noah_total_cost friends_camera_tripod_cost = 125.00 friends_count = noah_remaining_budget // frien...
Student: Marcus had 3 paperweights, each weighing 10 ounces each. How much does the whole collection weigh in kilograms?
def solve() -> int: num_paperweights = 3 weight_per_paperweight = 10 weight_per_paperweight_grams = weight_per_paperweight * 28.35 total_weight_grams = num_paperweights * weight_per_paperweight_grams total_weight_kilograms = total_weight_grams / 1000 result = total_weight_kilograms return r...
Joe weighs 40 pounds more than Karen currently. He also weighs 90 pounds more than Karen did 4 years ago. How much did Karen weigh 4 years ago if she currently weighs 180 pounds?
def solve() -> int: karen_current_weight = 180 joe_current_weight = karen_current_weight + 40 joe_weight_4_years_ago = joe_current_weight - 90 karen_weight_4_years_ago = joe_weight_4_years_ago result = karen_weight_4_years_ago return result
A car rental company charges $40 per day plus $0.25 per mile for renting a car. Tom rented a car for 3 days and drove 120 miles. Jerry rented a car for 2 days and drove 150 miles. How much more did Tom pay than Jerry?
def solve() -> int: tom_cost = 40 * 3 + 0.25 * 120 jerry_cost = 40 * 2 + 0.25 * 150 difference = tom_cost - jerry_cost result = difference return result
Student: 6. To buy school supplies, Muriel had a budget of $200. She spent 80% of the budget and wanted to find out the exact amount she spent. How much did Muriel spend?
def solve() -> int: budget = 200 percentage_spent = 0.8 amount_spent = budget * percentage_spent result = amount_spent return result
Aiden can paint 18 tiles in 30 minutes. His sister Ava can paint 10% more tiles than Aiden in the same time frame. Their friend Ella can paint half of the tiles that Ava can paint. How many tiles can Ella paint in 30 minutes?
def solve() -> int: ava_tiles = 18 * 1.1 ella_tiles = ava_tiles / 2 result = ella_tiles return result
A fashion boutique has a selection of shirts and four times as many pants as shirts. If the total number of clothes in the store is 80, how many shirts are there?
def solve() -> int: s = 16 result = s return result
Student: Sarah has $100. She makes a purchase of $75 and receives $10 as change. How much money does Sarah have now?
def solve() -> int: money = 100 purchase = 75 change = 10 result = money - purchase + change return result
A company has a total of 500 employees. If 40% of the employees are female and 60% are male, how many male employees does the company have?
def solve() -> int: female_employees = 0.4 * 500 male_employees = 0.6 * 500 result = male_employees return result
Student: Sara has eight more than a fourth of the number of crayons as Tom. Tom has three times as many crayons as Uma. If Uma has 16 crayons, how many crayons does Sara have?
def solve() -> int: tom_crayons = 0 uma_crayons = 16 tom_crayons = uma_crayons * 3 sara_crayons = tom_crayons + (tom_crayons // 4) + 8 result = sara_crayons return result
Student: John is decorating a rectangular garden with length of 110 feet and width of 80 feet. If he plants a flower bed covering an area of 4000 square feet, what is the remaining area of the garden?
def solve() -> int: length = 110 width = 80 flower_bed_area = 4000 remaining_area = length * width - flower_bed_area result = remaining_area return result
A hardware store purchased 8 boxes of light bulbs for their inventory. Each box contains 12 bulbs. During the first day, 36 bulbs were sold. By the end of the week, only 4 bulbs were left. How many bulbs were sold during the last day of the week?
def solve() -> int: boxes_purchased = 8 bulbs_per_box = 12 bulbs_sold_first_day = 36 bulbs_left_end_week = 4 total_bulbs = boxes_purchased * bulbs_per_box bulbs_sold_week = total_bulbs - bulbs_left_end_week bulbs_sold_last_day = bulbs_sold_week - bulbs_sold_first_day result = b...
Noah is building a dog kennel that is 15 feet by 10 feet by 6 feet. Concrete costs $. 02 per pound and has a density of 155 pounds per cubic foot. What is the cost of the concrete for the kennel?
def solve() -> int: length = 15 width = 10 height = 6 volume = length * width * height density = 155 weight = volume * density cost_per_pound = 0.02 cost = weight * cost_per_pound result = cost return result
In the first three months of the year, Kim saved up for a new laptop. If Kim saved 100 dollars in the first month and added 50 more each following month, how much did she save in total?
def solve() -> int: month1 = 100 month2 = month1 + 50 month3 = month2 + 50 total_savings = month1 + month2 + month3 result = total_savings return result
A fish tank has 6 glass panes. Each pane has a length of 14 inches and a width of 10 inches. What is the total area of the glass in the fish tank?
def solve() -> int: pane_length = 14 pane_width = 10 total_area = pane_length * pane_width * 6 result = total_area return result
If Alex has 500 coins, and there are 5 coins in every jar, how many jars will Alex need to put all his coins in?
def solve() -> int: coins = 500 coins_per_jar = 5 number_of_jars = coins / coins_per_jar result = number_of_jars return result
A car is driving at 65 mph. How long will it take to travel 180 miles?
def solve() -> int: time_taken = 0 distance = 180 speed = 65 for i in range(0,distance,speed): time_taken = time_taken + 1 result = time_taken return result
A company's profit increased by 20% in the first year and decreased by 15% in the second year. If the profit in the second year was $12000, what was the profit in the first year?
def solve() -> int: first_year_profit = 12000/0.85/1.2 result = first_year_profit return result
Lisa has 3 bags with 8 apples in each bag. Linda has 4 bags with 5 apples in each bag. How many more apples does Lisa have?
def solve() -> int: lisa_bags = 3 lisa_apples = 8 lisa_total = lisa_bags * lisa_apples linda_bags = 4 linda_apples = 5 linda_total = linda_bags * linda_apples difference = lisa_total - linda_total result = difference return result
``` Alex has $1000 in his savings account. He deposits $50 every month. How much money will he have after 2 years?
def solve() -> int: savings = 1000 months_saved = 24 money_saved_per_month = 50 money_saved = money_saved_per_month * months_saved savings += money_saved result = savings return result
A classroom has 30 students. If 60% of them are girls and the rest are boys, how many boys are in the classroom?
def solve() -> int: total_students = 30 girls = total_students * 0.6 boys = total_students - girls result = boys return result
Rachel usually bakes 8 chocolate cakes, 4 vanilla cakes, and 3 strawberry cakes every day. If she doubles the number of chocolate cakes, triples the number of vanilla cakes, quadruples the number of strawberry cakes, and quintuples the number of banana cakes (which she didn't bake earlier), how many more cakes did she ...
def solve() -> int: rachel_regular = [8, 4, 3] rachel_this_week = [2*8, 3*4, 4*3, 5*0] more_cakes = sum(rachel_this_week) - sum(rachel_regular) result = more_cakes return result
David works as a construction worker. Every day, he builds four more walls than he did the day before. On the fifth day, he builds 100 walls. How many walls did David build on the first day?
def solve() -> int: day_five = 100 walls_built = 0 for i in range(1, 6): walls_built += i day_one = day_five - walls_built + 1 result = day_one return result
A billboard on the side of the road is 8 meters tall and 16 meters wide. What is the area of the billboard in square meters?
def solve() -> int: billboard_area = 8 * 16 result = billboard_area return result
A rectangular box has a length of 12 inches, width of 8 inches, and height of 5 inches. What is the volume of the box?
def solve() -> int: length = 12 width = 8 height = 5 volume = length * width * height result = volume return result
John helps a local farmer by picking apples. He picked 5 bushels in the morning and 3 bushels in the afternoon. Each bushel contains 50 apples. How many apples did John pick in total?
def solve() -> int: apples_morning = 5*50 apples_afternoon = 3*50 total_apples = apples_morning + apples_afternoon result = total_apples return result
amuel needs to make 900 units during 3 weeks. He finished 300 units in the first2 weeks and had another 450 units ready by the end of the 2nd week. How many more units should he produce in the third week to meet his target?
def solve() -> int: n1 = 300 n2 = 450 quota = 900 total = n1 + n2 result = quota - total return result
Daniel has 70 apples and wants to make applesauce. Each batch of applesauce requires 7 apples. How many batches of applesauce can Daniel make?
def solve() -> int: total_apples = 70 batch_size = 7 result = total_apples // batch_size return result
Mark goes skiing for 2 days. He travels 40 miles on the first day and 30 miles on the second day. How many total miles did he travel?
def solve() -> int: miles_first_day = 40 miles_second_day = 30 total_miles = miles_first_day + miles_second_day result = total_miles return result
Zoe is buying a book that costs $15. The sales tax is 7%. How much will Zoe pay in total for the book including tax?
def solve() -> int: book_price = 15 sales_tax_percent = 7 sales_tax = book_price * (sales_tax_percent/100) total_price = book_price + sales_tax result = total_price return result
There are 12 apples in a basket. If 3 people take turns taking 2 apples at a time, how many apples are left?
def solve() -> int: total_apples_taken = 3 * 2 apples_remaining = 12 - total_apples_taken result = apples_remaining return result
Coren had some books. She bought 9 books and gave 4 books to her brother. How many books did Coren have in total?
def solve() -> int: total_book = 9 given_to_brother = 4 result = total_book + given_to_brother return result
Ana has 7 cans in a rectangular box. The length of the box is 20 cm and the breadth is 6 cm. What is the total height of the cans in cm?
def solve() -> int: num_cans = 7 l_box = 20 b_box = 6 v_box = l_box*b_box h_can = v_box/num_cans total_height = h_can*num_cans result = total_height return result
``` A chocolate cake recipe calls for 2 cups of sugar, 3 cups of flour, and 1 cup of cocoa powder. If John wants to make half of the recipe, how much flour should he use?
def solve() -> int: sugar_ratio = 2 / 3 cocoa_ratio = 1 / 3 half_flour = 3 / 2 result = half_flour return result
On Monday, Tom jogged 3 kilometers and cycled 8 kilometers. On Tuesday, he jogged 5 kilometers and cycled 6 kilometers. If Tom's goal is to jog a total of 12 kilometers and cycle a total of 24 kilometers this week, how much more does he need to jog and cycle altogether?
def solve() -> int: jogging_distance = 3 + 5 cycling_distance = 8 + 6 total_distance = jogging_distance + cycling_distance jogging_goal = 12 cycling_goal = 24 jogging_remaining = jogging_goal - jogging_distance cycling_remaining = cycling_goal - cycling_distance result = jogging_remainin...
Lisa was selling books at a yard sale. She sold 48 paperbacks in packages of 6 each, and 57 hardbacks in packages of 4 each. How many packages did Lisa sell in total?
def solve() -> int: n_paperbacks = 48 // 6 n_hardbacks = 57 // 4 result = n_paperbacks + n_hardbacks return result
In a school, there are 120 students in grade 10, 80 students in grade 11, and 200 students in grade 12. If the school decides to split the grade 12 students into two equal groups, calculate the number of students in each group.
def solve() -> int: grade_10 = 120 grade_11 = 80 grade_12 = 200 group_12 = grade_12/2 result = group_12 return result
A football team loses 5 yards on each of three consecutive plays. Then they gain 7 yards on the fourth play. How many yards must they gain on the fifth play to break even?
def solve() -> int: total_loss = 5 * 3 total_gain = 7 break_even = total_loss - total_gain result = break_even return result
A company offers a 10% discount on all items sold during a clearance sale. If a customer bought $500 worth of items, how much did the customer save?
def solve() -> int: original_price = 500 discount = 0.10 discounted_price = original_price*(1-discount) savings = original_price - discounted_price result = savings return result
Student: An electronic store offers a discount of 25% on a laptop that costs $800. If the customer pays with a credit card that charges an interest rate of 18% per year, what is the total amount the customer needs to pay if they pay off the card in 12 months?
def solve() -> int: discount_rate = 0.25 original_price = 800 discounted_price = original_price * (1 - discount_rate) interest_rate = 0.18 total_amount = discounted_price * (1 + interest_rate / 12) ** 12 result = total_amount return result
Adeline has 28 chalks and Marco has 3 times more than Adeline. How many more chalks does Marco have compared to Adeline?
def solve() -> int: AdelineChalks = 28 MarcoChalks = AdelineChalks * 3 result = MarcoChalks - AdelineChalks return result
Student: The total amount of chickens and pigs on a farm is 54 animals and there are 6 times as many pigs as chickens. How many chickens are there?
def solve() -> int: c = 54/7 c = int(c) result = c return result
In Beachville, the population is 200 and every single person drives to work. Each car on the road pollutes 15 pounds of carbon a year. A single truck pollutes 150 pounds of carbon a year. A truck can hold 20 people. The town decides to start running a truck and 30% of the people who used to drive now take the truck. Ho...
def solve() -> int: population = 200 car_pollution = 15 truck_pollution = 150 truck_capacity = 20 truck_passengers = population * 0.3 car_emissions = population * car_pollution truck_emissions = truck_pollution * (truck_passengers // truck_capacity) total_emissions = car_emissions + truc...
Jacob spent 4 hours building a treehouse, while his brother Lucas spent 6 hours to finish the same treehouse. How long will it take Jacob and Lucas to build two treehouses if working together?
def solve() -> int: jacob_hours = 4 lucas_hours = 6 total_hours = jacob_hours + lucas_hours time_for_two_treehouses = total_hours / 2 result = time_for_two_treehouses return result
Student: Lisa has $25. She wants to buy a $10 shirt and enough flowers that cost $2 each to give to her friends. If she buys 6 flowers, how much money will she have left?
def solve() -> int: shirt_price = 10 flower_price = 2 total_money = 25 total_cost = shirt_price + flower_price * 6 result = total_money - total_cost return result
A company makes 60 widgets per hour. If it works 8 hours a day, how many widgets will be produced in a 5-day workweek?
def solve() -> int: widgets_per_hour = 60 hours_worked_per_day = 8 working_days_per_week = 5 total_hours_worked = hours_worked_per_day * working_days_per_week widgets_produced_per_week = widgets_per_hour * total_hours_worked result = widgets_produced_per_week return result
Lily is baking cookies for her class. She has 6 cups of flour, 2 times as many cups of sugar as flour, and 12 eggs. Lily then uses a cookie cutter to make 18 cookies from each cup of flour. If Lily wants to give each student in her class 3 cookies, how many students are in her class?
def solve() -> int: flour = 6 sugar = 2 * flour eggs = 12 cookies = flour * 18 students = cookies // 3 result = students return result
Lucas is 6 years younger than Kira. Kira is three times as old as Remy. If Remy is 15, how old is Lucas?
def solve() -> int: remy = 15 kira = 3 * remy lucas = kira - 6 result = lucas return result
Christine is using an air conditioner that consumes 500 watts daily. How much kWh of electric energy does she consume per month (30 days)?
def solve() -> int: time_in_hours = 24 wattage = 500 days = 30 kWh = wattage/1000 kWh_used = kWh*time_in_hours*days result = kWh_used return result
Mary wants to buy 3 apples for each of her 7 friends. How many apples does she need to buy?
def solve() -> int: number_of_apples = 7 * 3 result = number_of_apples return result
A worker earns 400 dollars in 8 hours. How much does the worker earn in 5 hours?
def solve() -> int: earnings_per_hour = 400/8 number_of_hours = 5 total_earnings = number_of_hours*earnings_per_hour result = total_earnings return result
A shuttle service charges a flat fee of $25 plus an additional charge of $1.50 per mile. If the shuttle drove 60 miles, how much would it cost in total?
def solve() -> int: driven_miles = 60 flat_fee = 25 mileage_rate = 1.5 total_cost = flat_fee + driven_miles*mileage_rate result = total_cost return result
A baker has a recipe that calls for 3 eggs. She has only 2/3 of an egg. How many eggs does she need to have to complete the recipe?
def solve() -> int: eggs_needed = 3 eggs_have = 2/3 eggs_needed_to_complete = eggs_needed - eggs_have result = eggs_needed_to_complete return result
Gramby the 5-legged Squarak, walks 6 times slower than Pogo and Grimzi combined. If the two creatures, Pogo and Grimzi, travel 12,000 meters in total, how far does Gramby travel?
def solve() -> int: gramby_travel = 12000 * 0.5 result = gramby_travel return result
Charlie's tree grows at the rate of 60 centimeters every three weeks. If the tree is currently 2.5 meters tall, how tall, in centimeters, will the tree be in 5 months?
def solve() -> int: tree_height = 2.5 growth_rate = 60 time = 5 weeks = time * 4 total_growth = weeks * growth_rate final_tree_height = tree_height * 100 + total_growth result = final_tree_height return result
Student: The perimeter of a rectangular field is 100 meters. If the width of the field is half of its length, what is the area of the field?
def solve() -> int: perimeter = 100 length = 0 width = perimeter / 4 area = length * width result = area return result
Anna is organizing a blood donation event. She received $500 from 100 donors, and four times as many individuals made donations worth $50 to her event. This accounts for 60% of the total money that Anna raised. How much money did Anna raise in total?
def solve() -> int: donors = 100 individuals = donors * 4 individuals_money = individuals * 50 donors_money = 500 total_money = (individuals_money + donors_money) / 0.6 result = total_money return result
Anna and Jane run a race together that is a total of 4 kilometers. Anna runs at a speed of 12 kilometers per hour and Jane runs at a speed of 8 kilometers per hour. In which place will they finish the race?
def solve() -> int: total_kms = 4 anna_mph = 12 jane_mph = 8 anna_time = total_kms / anna_mph jane_time = total_kms / jane_mph if anna_time > jane_time: result = "Anna finished in second place." else: result = "Jane finished in second place." return result
A store sells a product for $6,300 with a down payment of $2,000 and the rest is to be paid in four equal payments that increase with $50. What is the value of the third payment?
def solve() -> int: balance = 6300 - 2000 total_increase = balance / 4 third_payment = 2000 + (total_increase * 2) + 50 result = third_payment return result
Ben had 52 stickers in a box. He gave 4 stickers to each of his 11 cousins. How many stickers did he give away if he had 8 stickers left in the box?
def solve() -> int: stickers_in_box = 52 stickers_given_to_each_cousin = 4 number_of_cousins = 11 stickers_left_in_box = 8 total_stickers_given_away = (stickers_in_box - stickers_left_in_box) - (stickers_given_to_each_cousin * number_of_cousins) result = total_stickers_given_away r...
Linda has 16 red pencils and 8 blue pencils. What is the ratio of red pencils to blue pencils?
def solve() -> int: red_pencils = 16 blue_pencils = 8 ratio = red_pencils / blue_pencils result = ratio return result
Olivia reads 16 pages each day. Her brother Jack reads twice as many pages per day as Olivia does. How many pages do they read together in a single day?
def solve() -> int: olivia_pages = 16 jack_pages = 2 * olivia_pages total_pages = olivia_pages + jack_pages result = total_pages return result
A student spends 40 minutes on homework for each subject. If the student has 6 subjects, how many hours does the student spend on homework in total?
def solve() -> int: num_subjects = 6 time_per_subject = 40/60 total_time = num_subjects*time_per_subject result = total_time return result
Student: On a pizza night, 5 colleagues decided to order 4 large pizzas. Each pizza cost $15. They equally split the cost of the pizzas but one colleague decided not to eat any. What is the extra cost for each colleague?
def solve() -> int: pizza_num = 4 colleague_num = 5 pizza_cost = 15 total_cost = pizza_num * pizza_cost cost_per_colleague = total_cost / colleague_num extra_cost = total_cost - cost_per_colleague result = extra_cost / (colleague_num - 1) return result
arah has 50 pieces of candy. She gives 1/5 of her candy to her sister, then gives 1/4 of her remaining candy to her brother. How many pieces of candy does Sarah have left?
def solve() -> int: candy = 50 sister_candy = candy * 1/5 remaining_candy = candy - sister_candy brother_candy = remaining_candy * 1/4 candy_left = remaining_candy - brother_candy result = candy_left return result
Joan can bike 12 miles per hour. She starts biking at 8 am and stops at 10 am. If she takes a 10-minute break at 9 am, how far did Joan bike in miles?
def solve() -> int: distance = 12 * 1.1667 result = distance return result
A store is selling an item at a 20% discount. If the sale price is $40, what was the original price of the item?
def solve() -> int: sale_price = 40 discount = 0.2 original_price = sale_price / (1 - discount) result = original_price return result
A bag of candy contains 24 chocolate candies and 16 gummy candies. If a person randomly selects a candy without looking, what are the odds of getting a gummy candy?
def solve() -> int: total_candies = 24 + 16 number_of_gummy_candies = 16 odds_of_getting_gummy_candy = number_of_gummy_candies / total_candies result = odds_of_getting_gummy_candy return result
Sarah is counting her coin collection and wants to know how many coins she has. She has 5 jars, each filled with 100 coins, but decides to take out 35 coins to give to her friend. How many coins does Sarah have left?
def solve() -> int: jars = 5 coins_per_jar = 100 coins_given_to_friend = 35 total_coins = jars * coins_per_jar remaining_coins = total_coins - coins_given_to_friend result = remaining_coins return result
A school has 150 students. The ratio of boys to girls is 2:3. Calculate the number of girls in the school.
def solve() -> int: total_ratio = 2 + 3 num_girls = (3 / total_ratio) * 150 result = num_girls return result
Amy has a jar of 120 jelly beans. She knows that 30 percent of them are red, 25 percent are green, and the rest are yellow. She wants to give some jelly beans to her friends Bob and Cindy. She gives Bob 10 percent of the red jelly beans and 15 percent of the green jelly beans. She gives Cindy 20 percent of the green je...
def solve() -> int: red = 0.3 * 120 green = 0.25 * 120 yellow = 120 - red - green bob_red = 0.1 * red bob_green = 0.15 * green bob_total = bob_red + bob_green cindy_green = 0.2 * green cindy_yellow = 0.25 * yellow cindy_total = cindy_green + cindy_yellow amy_total = 120 ...
A charity has received 2000 dollars in donations and they decide to split the money evenly among 5 charities. How much does each charity receive?
def solve() -> int: num_charities = 5 total_donations = 2000 donations_per_charity = total_donations // num_charities result = donations_per_charity return result
A class has 25 students, 12 boys and 13 girls. Each student has 2 books, one math book and one science book. The math book weighs 1.2 kg and the science book weighs 0.8 kg. How much does the total weight of all the books in the class?
def solve() -> int: students = 25 books_per_student = 2 math_book_weight = 1.2 science_book_weight = 0.8 books = students * books_per_student math_books_weight = books * math_book_weight / books_per_student science_books_weight = books * science_book_weight / books_per_student total_...
Anna drinks 3 glasses of milk that have a total of 300 calories. She then drinks 9 glasses of water, with each glass having 1/3 as many calories as a glass of milk. How many total calories did she drink?
def solve() -> int: milk_glasses = 3 milk_calories = 300 water_glasses = 9 water_calories = milk_calories / 3 total_milk_calories = milk_glasses * milk_calories total_water_calories = water_glasses * water_calories total_calories = total_milk_calories + total_water_calories res...
In his first season on Best Hockey’s team, Louie scored six goals in the first six matches. In the two seasons that followed, his brother scored twice as many goals as Louie did in the previous match. How many goals have been scored cumulatively by the two brothers in the first fifty matches?
def solve() -> int: total_goals = 0 for i in range(1, 51): if i == 1: total_goals = total_goals + 6 else: total_goals = total_goals + (2*i) result = total_goals return result
A hardware store has a sale where everything is 25% off. If you buy a hammer that is regularly priced at $20, how much money would you save?
def solve() -> int: regular_price = 20 discount = 0.25 discounted_price = regular_price - (regular_price * discount) total_saved = regular_price - discounted_price result = total_saved return result