question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A bakery makes 200 loaves of bread every day. If they increase production by 10% every week, how many loaves of bread will they make after a month?
def solve() -> int: bread = 200 for i in range(1, 5): bread *= 1.1 result = round(bread * 30) return result
If Amanda is half as old as her grandmother, who is currently 72 years old, how old is Amanda?
def solve() -> int: grandmother_age = 72 amanda_age = grandmother_age / 2 result = amanda_age return result
Sarah is getting 12 cookies for her friends Emma and Ethan. The day before the study group, she invites her other friends Noah and Hannah and asks them to bring the same. Sarah's mom decides to buy one extra cookie for each friend just in case. How many cookies will Sarah's mom need to buy in total?
def solve() -> int: cookies_per_person = 6 num_friends = 2 total_cookies = cookies_per_person * (num_friends + 2) extra_cookies = num_friends + 2 total_cookies_needed = total_cookies + extra_cookies result = total_cookies_needed return result
Student: If a store sells 16 shirts for $320, what is the cost of 1 shirt?
def solve() -> int: shirts = 16 total = 320 cost = 0 cost = total / shirts result = cost return result
Mary has 3 pairs of shoes and 2 pairs of sandals. She can mix and match them. How many possible combinations of shoes and sandals does Mary have?
def solve() -> int: shoes = 3 sandals = 2 combinations = shoes * sandals result = combinations return result
David's age is two times the age of George. 5 years ago, David was four times older than George. How old is David now?
def solve() -> int: david_age = 1 george_age = david_age / 2 four_years_ago = 5 david_age -= four_years_ago george_age -= four_years_ago multiplier = david_age / george_age david_current_age = (david_age + four_years_ago) * multiplier result = david_current_age return result
A delivery truck travels 84 miles in 2 hours. Another delivery truck travels 63 miles in 45 minutes. Which truck has a faster average speed and how much faster is it than the other truck in miles per hour?
def solve() -> int: truck1_speed = 84 / 2 truck2_speed = 63 / (45/60) if truck1_speed > truck2_speed: faster_truck = "truck 1" speed_diff = truck1_speed - truck2_speed else: faster_truck = "truck 2" speed_diff = truck2_speed - truck1_speed result = round(speed_diff, 2) re...
A village has a yearly budget of $190,000 divided between the local government and health services. The local government has $120,000 to use for its activities. How much money does the health services receive?
def solve() -> int: total_budget = 190000 gov_budget = 120000 health_services_budget = total_budget - gov_budget result = health_services_budget return result
A classroom has 30 desks and 60 chairs. If each desk has 2 chairs, how many students can the classroom accommodate?
def solve() -> int: desks = 30 chairs = 60 students_per_desk = 2 students = desks * students_per_desk result = students return result
Every week, Emma buys 72 pens to use for her school work. Unfortunately, Mia stole some of Emma's pens during recess and 18 pens fell out of a hole in the bottom of her bag. So when it was time for class, Emma only had 30 pens left. How many pens did Mia steal from Emma?
def solve() -> int: pens_bought = 72 pens_before = pens_bought - 18 pens_after = 30 pens_stolen = pens_before - pens_after result = pens_stolen return result
A new phone costs $450. The sales tax is 7%. What is the total cost of the phone, including tax?
def solve() -> int: tax = 0.07*450 total_cost = 450 + tax result = total_cost return result
Michelle went to the store and bought 6 bottles of juice and 2 loaves of bread. Each bottle of juice cost $3 and each loaf of bread was $4. How much money did Michelle spend?
def solve() -> int: juice = 6 bread = 2 juicePrice = 3 breadPrice = 4 totalMoneySpent = juice * juicePrice + bread * breadPrice result = totalMoneySpent return result
A recipe calls for 2 cups of sugar per 3 cups of flour. If you use 12 cups of flour, how many cups of sugar do you need?
def solve() -> int: sugar_per_flour = 2/3 flour_amount = 12 sugar_needed = sugar_per_flour * flour_amount result = sugar_needed return result
A store is giving a flat discount of $15 on all items costing over $100. You have bought a watch for $120, a pen for $15 and a shirt for $25. Calculate the total pay amount.
def solve() -> int: watch_price = 120 pen_price = 15 shirt_price = 25 item_total = watch_price + pen_price + shirt_price if watch_price > 100: discount_watch = 15 else: discount_watch = 0 if pen_price > 100: discount_pen = 15 else: discount_pen = 0 if shirt_pr...
Student: Tom wants to buy a pizza that costs $12. He has a coupon that gives him 25% off. He also has to pay 10% tax on the final amount. How much does he end up paying for the pizza?
def solve() -> int: pizza_cost = 12 discount = 0.25 tax = 0.1 discount_amount = pizza_cost * discount new_price = pizza_cost - discount_amount tax_amount = new_price * tax final_price = new_price + tax_amount result = final_price return result
Ms. Chen is organizing a picnic for her department at work. There are 20 employees in her department and 5 managers. She ordered 3 extra lunch boxes, just in case. Each lunch box costs $9. How much will the picnic cost in total?
def solve() -> int: num_employees = 20 num_managers = 5 extra_lunch_boxes = 3 lunch_box_cost = 9 total_people = num_employees + num_managers total_lunch_boxes = total_people + extra_lunch_boxes total_cost = total_lunch_boxes * lunch_box_cost result = total_cost return resul...
Mary wants to throw a party. She invites 20 people and plans to serve each of them 2 slices of pizza and one drink. A pizza has 8 slices. How many pizzas should she order?
def solve() -> int: number_of_people = 20 slices_per_person = 2 slices_per_pizza = 8 number_of_pizzas = (slices_per_person * number_of_people) / slices_per_pizza result = number_of_pizzas return result
Lily baked some cookies and gave 1/3 of them to her friends. She then gave 10 cookies to her mother. If she has 65 cookies now, calculate how many cookies she baked initially.
def solve() -> int: initial_cookies = 0 given_to_friends = 0 given_to_mother = 10 current_cookies = 65 given_to_friends = current_cookies * 1/3 initial_cookies = given_to_friends + given_to_mother result = initial_cookies return result
Student: Charlie is collecting stamps. He has 250 stamps at the beginning of the month. He buys 20 stamps every week and sells 15 stamps every weekend. How many stamps does he have at the end of the month?
def solve() -> int: stamps = 250 buy = 20 sell = 15 stamps = stamps + 20 result = stamps return result
Student: Ben has 18 markers. He used two fifths of the markers for drawing and the rest for writing. How many markers did he use for writing?
def solve() -> int: markers_total = 18 markers_drawing = markers_total * 2/5 markers_writing = markers_total - markers_drawing result = markers_writing return result
A store offers a 15% discount on all items. How much will an item cost if its original price is $75?
def solve() -> int: original_price = 75 discount_percentage = 15 discounted_price = original_price - ((discount_percentage/100) * original_price) result = discounted_price return result
Tom is twice as old as his brother. In 5 years, Tom's age will be 30 years old. How old are Tom and his brother now?
def solve() -> int: age_Tom_in_5_years = 30 age_Tom = age_Tom_in_5_years - 5 age_brother = age_Tom / 2 result = (age_Tom, age_brother) return result
There are 33 textbooks on a shelf. There are twice as many Spanish textbooks as English textbooks and three times as many French textbooks as English textbooks. How many Spanish textbooks are there?
def solve() -> int: number_of_textbooks = 33 number_of_English_textbooks = 1 number_of_Spanish_textbooks = 2 * number_of_English_textbooks number_of_French_textbooks = 3 * number_of_English_textbooks total_number_of_textbooks = number_of_English_textbooks + number_of_Spanish_t...
Student: Ryan is painting fences in his neighborhood to earn money. He charges $25 for a small fence and $40 for a large fence. He can paint 2 small fences or 1 large fence in an hour. He works for 6 hours a day for 3 days a week. How much money does he earn in a week?
def solve() -> int: small_price = 25 large_price = 40 small_rate = 2 large_rate = 1 hours_per_day = 6 days_per_week = 3 small_fences_per_week = small_rate * hours_per_day * days_per_week large_fences_per_week = large_rate * hours_per_day * days_per_week small_money = small_pr...
Michael has 10 bags of candy, with 20 candies in each bag. How many candies does Michael have?
def solve() -> int: bags = 10 candies_per_bag = 20 total_candies = bags * candies_per_bag result = total_candies return result
Sarah spends $20 per week on lunch during work. If she works for 50 weeks in a year, how much does she spend in total on lunch per year?
def solve() -> int: cost_per_week = 20 weeks_per_year = 50 total_cost = cost_per_week * weeks_per_year result = total_cost return result
John's age is twice Alice's age. In 5 years, John will be 22. How old is Alice now?
def solve() -> int: john_age_in_5_years = 22 john_age = john_age_in_5_years - 5 alice_age = john_age / 2 result = alice_age return result
If a rectangle has a width of 5 meters and a length of 10 meters, what is the area of the rectangle?
def solve() -> int: width = 5 length = 10 area = width*length result = area return result
Lucas went to the bookstore and bought 2 novels, 3 comics and a magazine. The novels cost $12 each, the comics cost $5 each, and the magazine costs $2. How much money did Lucas spent in total?
def solve() -> int: novel_cost = 12 comic_cost = 5 magazine_cost = 2 novels = 2 comics = 3 total_cost = novel_cost * novels + comic_cost * comics + magazine_cost result = total_cost return result
A recipe calls for 2 cups of flour, 1/4 cup of sugar, and 3 eggs to make 12 pancakes. How much of each ingredient is needed to make 48 pancakes?
def solve() -> int: pancakes = 48 flour_per_pancake = 2/12 sugar_per_pancake = 1/4/12 eggs_per_pancake = 3/12 total_flour = flour_per_pancake * pancakes total_sugar = sugar_per_pancake * pancakes total_eggs = eggs_per_pancake * pancakes result = (total_flour, total_sugar, total_eggs) ...
A recipe uses 2/3 cup of sugar for 1 pint of strawberries. How much sugar would you need if you have 3 pints of strawberries?
def solve() -> int: sugar_per_pint = 2/3 pints = 3 total_sugar = sugar_per_pint * pints result = total_sugar return result
Ella has a digital watch that can run for 100 days on a full battery. She has used her watch for 80 days, and she wants to know how many hours of battery she has left. How many hours of battery will Ella's watch have left?
def solve() -> int: remaining_battery = 1 - 80/100 battery_left = remaining_battery * 100 * 24 result = battery_left return result
If a company sells a product at $15 with a profit margin of 20%, what is the cost of producing the product?
def solve() -> int: selling_price = 15 profit_margin = 20 cost_price = selling_price / (1 + profit_margin / 100) result = cost_price return result
Cindy won a stuffed animal at a carnival. She decided to give it away to her little brother as a gift. If she paid $6 for the toy, how much did she save from the original price of $10?
def solve() -> int: paid_price = 6 original_price = 10 money_saved = original_price - paid_price result = money_saved return result
The price of a shirt is $20. If the shirt is discounted by 25%, what is the new price?
def solve() -> int: original_price = 20 discount = 25 new_price = original_price * (100 - discount) / 100 result = new_price return result
Marcus has 24 marbles and his brother has 10. If Marcus gives his brother 4 marbles, how many marbles does he have left?
def solve() -> int: marbles_marcus = 24 marbles_brother = 10 marbles_gifted = 4 marbles_left = marbles_marcus - marbles_gifted result = marbles_left return result
Leo buys 8 packs of pencils. Each pack contains 12 pencils. He gives 3 pencils to each of his 4 classmates. How many pencils does Leo have left?
def solve() -> int: packs_of_pencils = 8 pencils_per_pack = 12 pencils_given = 3 classmates = 4 total_pencils = packs_of_pencils * pencils_per_pack pencils_away = pencils_given * classmates pencils_left = total_pencils - pencils_away result = pencils_left return result
Student: Lucas has driven 250 miles so far. He needs to drive at least 800 miles more before the end of his road trip. How many more miles does he need to drive?
def solve() -> int: miles_driven = 250 miles_goal = 800 miles_left = 0 miles_left = miles_goal - miles_driven result = miles_left return result
In a school, there are 120 students and each student has 2/3 as many pencils as the number of students. If each pencil has an average length of 20cm, how long are all the pencils in the school?
def solve() -> int: num_students = 120 pencils_per_student = num_students * (2/3) avg_pencil_length = 20 total_pencil_length = num_students * pencils_per_student * avg_pencil_length result = total_pencil_length return result
Daniel is five years older than his sister Jane. If Jane will be 20 in two years, how old is Daniel now?
def solve() -> int: daniel_age = 0 jane_age = 0 daniel_age = jane_age + 5 jane_age = 20 - 2 daniel_age = jane_age + 5 result = daniel_age return result
A building has 120 floors. If the floors are numbered starting from 1 at the bottom, how many floors do you need to climb to reach the floor numbered 83?
def solve() -> int: target_floor = 83 num_floors_climbed = target_floor - 1 result = num_floors_climbed return result
A rectangular pool has a length of 12m and a width of 6m. If the pool is being filled at a rate of 2 cubic meters per minute, how long will it take to fill the pool to a depth of 3 meters?
def solve() -> int: length = 12 width = 6 depth = 3 volume = length * width * depth rate = 2 time = volume / rate result = time return result
Mike sold a car for $25,000 which he bought for $18,000 and spent $2,000 on its repair. What was his profit in dollars?
def solve() -> int: cost_price = 18000 + 2000 profit = 25000 - cost_price result = profit return result
A recipe for a cake requires 2 and 1/2 cups of sugar. If you want to make a half batch, how many cups of sugar should you need?
def solve() -> int: x = 2.5 / 2 result = round(x, 2) return result
John wants to paint his room and needs 3 cans of red paint and 2 cans of white paint. If each can of red paint costs $10 and each can of white paint costs $12, how much will John spend?
def solve() -> int: red_paint_cost = 10 white_paint_cost = 12 red_paint_quantity = 3 white_paint_quantity = 2 total_cost = (red_paint_cost * red_paint_quantity) + (white_paint_cost * white_paint_quantity) result = total_cost return result
A farmer has 60 acres of land. He wants to divide the land into equal parts of 15 acres each. How many parts can he divide the land into?
def solve() -> int: acres_of_land = 60 acres_per_part = 15 parts = acres_of_land // acres_per_part result = parts return result
Hugh has three jars of coins, one contains 80 coins, one with 65 coins, and one with 85 coins. How many coins does Hugh have in total?
def solve() -> int: jar_1 = 80 jar_2 = 65 jar_3 = 85 total_coins = jar_1 + jar_2 + jar_3 result = total_coins return result
Tina and Lisa are collecting stamps. Tina has 18 stamps and Lisa has 24 stamps. They each buy 3 more stamps from a store that sells them for $0.50 each. How much money did Tina spend on stamps if she also gave Lisa $2 to buy a sticker?
def solve() -> int: tina_stamps = 18 + 3 tina_cost = 3 * 0.5 tina_total = tina_cost + 2 result = tina_total return result
A box can hold 34 books. Alex wants to pack his books. He counted his books and realized he had 173 books. How many boxes does he need to pack all his books?
def solve() -> int: books = 173 box_capacity = 34 boxes_required = books // box_capacity + int(books % box_capacity > 0) result = boxes_required return result
A fence needs to be built around a rectangular garden with dimensions 20 ft by 30 ft. If each fence segment is 5 ft long, how many segments are needed to fence the entire garden?
def solve() -> int: perimeter = 2*(20+30) segments_needed = perimeter / 5 result = segments_needed return result
If a train can travel 500 km in 12 hours, how far can it travel in 8 hours?
def solve() -> int: total_distance = 500 total_time = 12 required_time = 8 result = (total_distance/total_time) * required_time result = 333.333333333333 return result
Jasmine is painting a wall at the rate of 1 liter every 30 minutes. If the wall is 10 liters and she has been painting for 2 hours, how much more paint does she need to cover the wall entirely?
def solve() -> int: painting_rate = 1 / 30 time_painting = 2 * 60 total_paint_needed = 10 paint_used = painting_rate * time_painting paint_needed = total_paint_needed - paint_used result = paint_needed return result
The circumference of a circular track is 660 yards and is divided into 11 equal portions. Sarah is running at a speed of 8 yards per second. After running for 20 seconds, how many portions of the track has she covered?
def solve() -> int: circumference = 660 portions = 11 speed = 8 time = 20 distance_covered = speed * time portions_covered = distance_covered / (circumference / portions) result = portions_covered return result
The average of 5 consecutive odd numbers is 39. What is the largest of these 5 numbers?
def solve() -> int: smallest_number = 39 - 4 * 2 largest_number = smallest_number + 4 * 2 result = largest_number return result
At the bird feeder, Audrey fills 1/4 of the feeder with birdseed. She fills the feeder in this way for 10 days. After 10 days, what percentage of the feeder is filled with birdseed?
def solve() -> int: feeder_capacity = 1 birdseed_filled = 1/4 days = 10 birdseed_filled_total = birdseed_filled * days percentage_filled = (birdseed_filled_total / feeder_capacity) * 100 result = percentage_filled return result
Student: Sarah has 5 more daisies than lilies in her garden. If she has a total of 24 flowers, how many of them are daisies?
def solve() -> int: daisies = 0 lilies = 0 total_flowers = 24 daisies = total_flowers - lilies lilies = daisies - 5 daisies = lilies + 5 result = daisies return result
Sarah lives with her husband and 4 children. They also have 3 parrots, 4 rabbits, and 1 hamster. How many legs are there in total in Sarah's household?
def solve() -> int: husband_legs = 2 children_legs = 4 * 4 parrot_legs = 3 * 2 rabbit_legs = 4 * 4 hamster_legs = 1 * 4 total_legs = husband_legs + children_legs + parrot_legs + rabbit_legs + hamster_legs result = total_legs return result
Claire had 50 pens. Emma gave her another 15 pens. Claire then used 25 pens for her project and kept the rest. How many pens did Claire keep?
def solve() -> int: pens_initial = 50 pens_given = 15 pens_used = 25 pens_kept = pens_initial + pens_given - pens_used result = pens_kept return result
Sarah sold a third of her toys collection to her friend Mike, who then gave half of what he got to his little sister. If the little sister received 10 toys, how many toys did Sarah have to start with?
def solve() -> int: toys_sold_to_sister = 10 toys_received_by_mike = toys_sold_to_sister * 2 toys_collection = toys_received_by_mike * 3 result = toys_collection return result
Tom has $500 and wants to buy a bike that costs $250. However, he wants to have some money left over after buying the bike. If he wants to have at least $100 left over, how much maximum could he spend on the bike?
def solve() -> int: total_money = 500 bike_cost = 250 minimum_leftover = 100 max_spending = total_money - minimum_leftover result = max_spending return result
Student: If a car travels 120 miles in 2 hours, what is its average speed in miles per hour?
def solve() -> int: distance = 120 time = 2 average_speed = distance / time result = average_speed return result
A cafeteria serves hamburgers and fries. If a meal consists of 1 hamburger and 2 servings of fries, and 24 meals have been ordered, how many total servings of fries have been ordered?
def solve() -> int: meals_ordered = 24 fries_per_meal = 2 total_fries_ordered = meals_ordered * fries_per_meal result = total_fries_ordered return result
Ava and Noah are preparing for a science fair. Ava has 20 test tubes and Noah has 60 test tubes at his house. Each experiment requires 5 test tubes and they need to set up 30 experiments in total. How many test tubes did Ava have to bring from her own house?
def solve() -> int: ava_test_tubes = 20 noah_test_tubes = 60 test_tubes_per_experiment = 5 total_experiments = 30 test_tubes_needed = test_tubes_per_experiment * total_experiments ava_test_tubes_brought = test_tubes_needed - ava_test_tubes result = ava_test_tubes_brought return...
There are 64 cookies in a jar and 25% of them are chocolate chip cookies. How many chocolate chip cookies are there in the jar?
def solve() -> int: num_cookies = 64 percent_choc_chip = 0.25 num_choc_chip = num_cookies * percent_choc_chip result = num_choc_chip return result
Lucy has 12 marbles, and she wins 4 more marbles in a game. Her brother has 1/3 times as many marbles as Lucy. He loses 2 marbles in another game. How many marbles do they have together?
def solve() -> int: lucy = 12 brother = 1/3 * lucy lucy = lucy + 4 brother = brother - 2 total = lucy + brother result = total return result
Alice and Bob shared a pizza. Alice ate 3 slices and Bob ate 5 slices. The pizza had 12 slices in total and cost $18. If Alice paid $2 more than Bob, how much did Bob pay?
def solve() -> int: x = 8 result = x return result
A can of paint can cover 25 square meters of surface. If a room has a length of 5 meters, a width of 8 meters, and a height of 2.5 meters, how many cans of paint are needed to paint all walls (exclude windows and doors)?
def solve() -> int: room_area = 2 * (5*2.5 + 8*2.5) num_cans = room_area / 25 result = num_cans return result
Every time Tyler saves $4, he puts it towards a new video game. If he saves $8 each week for 5 weeks, how much money will he have accumulated for the video game?
def solve() -> int: savings_per_week = 8 weeks = 5 savings = savings_per_week * weeks result = savings return result
A model train set consists of tracks that form a square with one long side and three short sides. The long side is twice the length of the short sides. If Jake wants the square to be 140.6 feet on each side, how long is the long side of the square?
def solve() -> int: SHORT_SIDE = 0 LONG_SIDE = 0 square_side = 140.6 SHORT_SIDE = square_side/3 LONG_SIDE = SHORT_SIDE * 2 result = LONG_SIDE return result
Sarah went grocery shopping and bought 12 apples for $4. How much did Sarah pay for each apple?
def solve() -> int: cost_per_apple = 4/12 result = cost_per_apple return result
Peter wants to buy 3 boxes of candy, 7 bags of chips and 9 bottles of soda. Each box of candy costs $2.50, each bag of chips costs $1.50, and each bottle of soda costs $2. How much does Peter spend in total?
def solve() -> int: boxes_of_candy_cost = 3 * 2.50 bags_of_chips_cost = 7 * 1.50 bottles_of_soda_cost = 9 * 2 total_cost = boxes_of_candy_cost + bags_of_chips_cost + bottles_of_soda_cost result = total_cost return result
Student: A restaurant had 100 customers today. Each customer paid $5 for the meal. The restaurant gave a 10% discount to 20 customers. How much money did the restaurant earn today?
def solve() -> int: num_customers = 100 price_per_customer = 5 num_discounted_customers = 20 discount_percentage = 0.1 total_amount_before_discount = num_customers * price_per_customer total_amount_discounted = num_discounted_customers * price_per_customer * discount_percentage total_amount_...
If Kristen's pace is 4 miles per hour and she walks for 2 hours a day, how many miles will she have walked in 4 weeks?
def solve() -> int: pace = 4 time = 2 days = 28 distance_per_day = pace * time total_distance = distance_per_day * days result = total_distance return result
Student: A box contains 6 red balls, 4 blue balls, and 5 green balls. If a ball is picked at random, what is the probability that it is not blue?
def solve() -> int: red_balls = 6 blue_balls = 4 green_balls = 5 total_balls = red_balls + blue_balls + green_balls probability = (red_balls + green_balls) / total_balls result = probability return result
Emily is trying to save money for a new computer. She saves $5 every day and $10 every weekend. If the computer costs $1000 and she starts saving today, how many days will it take for her to save enough money to buy it?
def solve() -> int: computer_cost = 1000 daily_savings = 5 weekend_savings = 10*2 total_savings = 0 days = 0 while total_savings < computer_cost: if days % 7 == 0 or days % 7 == 6: total_savings += weekend_savings else: total_savings += daily_savings ...
In a classroom of 32 students, the ratio of girls to boys is 3:5. How many girls are in the classroom?
def solve() -> int: total_students = 32 girls_ratio = 3 boys_ratio = 5 girls = (girls_ratio / (girls_ratio + boys_ratio)) * total_students result = girls return result
8. At a toy store, 20% of the items are board games, 30% are dolls, and the rest are outdoor toys. If there are 150 outdoor toys, how many items are there in total?
def solve() -> int: outdoor_toys = 150 total_items = outdoor_toys / (1-20/100-30/100) result = total_items return result
Ryan has two dogs. One weighs 20 pounds, whereas the other weighs 35 pounds. If Ryan wants to increase the weight of the smaller dog and the new total weight of both dogs will be 80 pounds, how much weight will be added to the smaller dog?
def solve() -> int: smaller_dog_weight = 20 larger_dog_weight = 35 total_weight = 80 added_weight = total_weight - (smaller_dog_weight + larger_dog_weight) result = added_weight return result
A baker makes 24 muffins and sells them for $1.25 each. He also makes 16 cookies and sells them for $0.75 each. He spends $12 on ingredients and $8 on electricity. How much profit does he make?
def solve() -> int: muffins = 24 muffin_price = 1.25 cookies = 16 cookie_price = 0.75 revenue = muffins * muffin_price + cookies * cookie_price ingredients = 12 electricity = 8 cost = ingredients + electricity profit = revenue - cost result = profit return result
Sarah's monthly rent is $1500. She works as a part-time barista and makes $10 per hour. If she works 5 hours every weekday and 7 hours on a Saturday, how many weeks will it take for her to earn enough to cover her rent?
def solve() -> int: rent = 1500 hourly_wage = 10 weekday_hours = 5 saturday_hours = 7 weekly_hours = (weekday_hours * 5) + saturday_hours weekly_earnings = weekly_hours * hourly_wage weeks_needed = rent / weekly_earnings result = weeks_needed return result
A bank is currently offering a 2% annual interest rate on savings accounts. If a person deposits $5000, how much money will they have in their account after 3 years?
def solve() -> int: initial_deposit = 5000 interest_rate = 0.02 years = 3 total_amount = initial_deposit * (1 + interest_rate) ** years result = total_amount return result
Jessica had $16 while Jakob and Luke each had $10. They wanted to buy a new bike that costs $85. How much more money do Jessica, Jakob and Luke need to borrow in order to buy the bike?
def solve() -> int: jessica_saved = 16 jakob_luke_saved = 10 bike_cost = 85 total_needed = bike_cost - jessica_saved - jakob_luke_saved result = total_needed return result
Tommy has 30 markers. He will keep 12 markers for himself and give the other 18 markers to his 4 friends. How many markers will Tommy give to each friend?
def solve() -> int: num_markers = 30 num_markers_for_Tommy = 12 num_friends = 4 markers_per_friend = (num_markers - num_markers_for_Tommy) // num_friends result = markers_per_friend return result
If the discount rate is 20%, and the original price of a laptop is $1000, what is the new price of the laptop after the discount?
def solve() -> int: original_price = 1000 discount_rate = 0.2 discount_amount = discount_rate*original_price new_price = original_price - discount_amount result = new_price return result
Emily went to a restaurant and spent $30 on a meal. She left a 20% tip for the server. How much did Emily tip?
def solve() -> int: meal_cost = 30 tip_percentage = 20 tip_amount = meal_cost * tip_percentage / 100 result = tip_amount return result
A grocery store is selling milk for $4.00 per gallon and juice for $3.00 per gallon. If the grocery store sold 40 gallons of milk and 30 gallons of juice, how much money did they make?
def solve() -> int: milk_price = 4.00 juice_price = 3.00 milk_sold = 40 juice_sold = 30 total_milk_sales = milk_price * milk_sold total_juice_sales = juice_price * juice_sold total_sales = total_milk_sales + total_juice_sales result = total_sales return result
``` A group of 10 people decided to donate towards a charity fund. They already have $800 in the fund and they need to make a total donation of $3000. If they each donate the same amount, how much does each person have to donate?
def solve() -> int: initial_fund = 800 final_fund = 3000 num_donors = 10 amount_needed = final_fund - initial_fund each_person = amount_needed / num_donors result = round(each_person, 2) return result
A recipe calls for 2 cups of sugar to make 12 cookies. How many cups of sugar would you need to make 24 cookies?
def solve() -> int: sugar_per_cookie = 2/12 sugar_for_24_cookies = sugar_per_cookie * 24 result = sugar_for_24_cookies return result
Lily's gym is 2.1 miles away from her house, and the bank is 1.5 miles away from her house. She makes the round trip to the gym twice a day for 5 days a week. Then she goes to the bank once a week. What is the total distance that she covers in a week?
def solve() -> int: gym_distance = 2.1 bank_distance = 1.5 round_trip_gym = gym_distance * 2 round_trip_gym_per_day = round_trip_gym * 2 total_gym_distance_per_week = round_trip_gym_per_day * 5 total_bank_distance_per_week = bank_distance total_distance_per_week = total_gym_distance_per_week...
Alex bought 35 pencils for 9 dollars each. If he provides a 10% discount, what is the total cost of his order?
def solve() -> int: cost_pencils = 35*9 discount = cost_pencils*10/100 total_cost = cost_pencils-discount result = int(total_cost) return result
Lucy bought 36 apples and 24 pears from the market. She ate 3 apples and 2 pears on her way home. Then she gave an equal number of apples and pears to each of her 4 neighbors. How many apples and pears did she have left?
def solve() -> int: apples = 36 pears = 24 apples = apples - 3 pears = pears - 2 apples_per_neighbor = apples // 4 pears_per_neighbor = pears // 4 apples = apples - apples_per_neighbor * 4 pears = pears - pears_per_neighbor * 4 result = (apples, pears) ...
You want to purchase a new sofa for $500 plus 10% tax. You can either pay for it all upfront or make a down payment of $200 and pay the rest in 5 monthly payments with no additional interest. How much is each monthly payment?
def solve() -> int: sofa_cost = 500 * 1.10 down_payment = 200 remaining_cost = sofa_cost - down_payment number_of_payments = 5 monthly_payment = remaining_cost/number_of_payments result = f'{monthly_payment}' result = monthly_payment return result
Sam had 18 cupcakes. He ate 4 cupcakes and gave 6 cupcakes to his friends. He then baked another 12 cupcakes and kept them for himself. How many cupcakes does Sam have in the end?
def solve() -> int: cupcakes = 18 cupcakes = cupcakes - 4 cupcakes = cupcakes - 6 cupcakes = cupcakes + 12 result = cupcakes return result
-See below for some possible questions and programs: A square garden has a side length of 6 meters and a fence around it. How many meters of fence are needed to enclose the garden and a path that is 0.5 meters wide on all sides of the garden?
def solve() -> int: result = 28 + 24 return result
If John can paint a room in 3 hours and Jane can paint the same room in 4 hours, how long will it take if they work together to paint the room?
def solve() -> int: result = 1/(1/3+1/4) * 60 return result
John bought 500 apples and 300 oranges for his fruit stand. If 60% of the apples were sold and 80% of the oranges were sold, and 90% of the sold fruit were used to make juice, how many liters of juice can John make?
def solve() -> int: apples_bought = 500 oranges_bought = 300 apples_sold = apples_bought * 0.6 oranges_sold = oranges_bought * 0.8 fruit_used_for_juice = (apples_sold + oranges_sold) * 0.9 result = fruit_used_for_juice return result
Chris makes $15 per hour for the first 40 hours he works each week. If he works more than 40 hours, he gets paid 1.5 times his hourly rate for those extra hours. Last week, he worked 50 hours. How much did he make?
def solve() -> int: hourly_rate = 15 regular_hours = 40 overtime_hours = 10 overtime_rate = hourly_rate * 1.5 total_income = (hourly_rate * regular_hours) + (overtime_hours * overtime_rate) result = total_income return result
Student: A recipe calls for 3/4 cups of sugar and yields 12 servings. If you want to make half of the recipe, how much sugar will you need?
def solve() -> int: sugar_per_serving = 3/4 / 12 servings = 12 / 2 sugar = sugar_per_serving * servings result = sugar return result
A square has a side length of 5 cm. What is the perimeter of the square in meters?
def solve() -> int: side_length = 5 perimeter = side_length * 4 perimeter_m = perimeter / 100 result = perimeter_m return result
A music album has 18 songs and the total run time is 1 hour and 5 minutes. If each song is of equal length, what is the length of each song in minutes?
def solve() -> int: total_songs = 18 total_time = 65 time_per_song = total_time / total_songs result = time_per_song return result