question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A rectangular garden has a length of 20 meters and a width of 15 meters. What is the area of the garden in square meters?
def solve() -> int: area = 20 * 15 result = f'<<<The area of the garden is {area} square meters.>>>' result = area return result
Possible questions and programs: Alice earns $12 an hour working at a bookstore. She works 5 days a week and has a lunch break of half an hour each day. How much does she make a week?
def solve() -> int: hours_per_day = 8 - 0.5 hours_per_week = hours_per_day * 5 income = hours_per_week * 12 result = income return result
If Julian can cook 3 meals in 4 hours, how many meals can he cook in 8 hours?
def solve() -> int: meals_per_hour = 3 original_time = 4 target_time = 8 ratio = target_time / original_time result = meals_per_hour * ratio return result
Student: A store is offering a 10% discount on all items over $20. If a customer bought 3 items for $25 each, how much did they save?
def solve() -> int: item_price = 25 num_items = 3 discount_rate = 0.1 total_price_before_discount = item_price * num_items total_price_after_discount = total_price_before_discount - (total_price_before_discount * discount_rate) amount_saved = total_price_before_discount - total_price_after_disco...
Maya bought five times as many apples as her sister Emily. If Emily paid $3 for 2 pounds of apples, how much more did Maya spend on her apples compared to Emily?
def solve() -> int: emily_apples = 2 emily_price = 3 maya_apples = 5 * emily_apples maya_price = emily_price * maya_apples / emily_apples maya_spent = maya_price - emily_price result = maya_spent return result
Ethan can fill a tank with water in 6 hours, while Fiona can drain the same tank in 9 hours. If the tank is initially empty and both of them start working at the same time, how long will it take to fill the tank completely?
def solve() -> int: ethan_rate = 1 / 6 fiona_rate = -1 / 9 net_rate = ethan_rate + fiona_rate fill_time = 1 / net_rate result = round(fill_time, 2) return result
A machine produces 250 apples per hour. How many apples are produced in 1 day?
def solve() -> int: hours_in_a_day = 24 apples_per_hour = 250 apples_in_a_day = hours_in_a_day * apples_per_hour result = apples_in_a_day return result
Olivia noticed 7 chairs in a room, each with 3 legs. She also saw 4 tables with 4 legs each. There is also a unicycle and a tricycle, which each have one and three wheels, respectively. How many legs and wheels are there in total?
def solve() -> int: chairs = 7 chair_legs = 3 tables = 4 table_legs = 4 unicycle_wheels = 1 tricycle_wheels = 3 total_legs = chairs * chair_legs + tables * table_legs total_wheels = unicycle_wheels + tricycle_wheels result = total_legs + total_wheels return result
A math quiz has 20 questions. Max wants to get a grade of at least 80%, but there are 5 questions on the test where he feels less comfortable and would be ok if he got only half of those questions right. What is the minimum number of questions Max needs to answer correctly to get the grade he wants?
def solve() -> int: num_questions = 20 target_percent = 80 uncomfortable_qns = 5 uncomfortable_pts = uncomfortable_qns * 0.5 target_pts = (target_percent / 100) * num_questions comfortable_pts = num_questions - uncomfortable_qns - uncomfortable_pts min_correct = round(target_pts - uncomforta...
Student: Jeffrey has $14 and he plans to buy a new toy costing $11. How much will he still have left over?
def solve() -> int: amount_Jeffrey_has = 14 cost_of_toy = 11 amount_left_over = amount_Jeffrey_has - cost_of_toy result = amount_left_over return result
A university has 15% of its students in the arts program, 20% in the science program, and the rest in other programs. If a student is chosen randomly, what is the probability that they are in the arts or science program?
def solve() -> int: p_arts_program = 0.15 p_science_program = 0.20 p_arts_or_science_program = p_arts_program + p_science_program result = p_arts_or_science_program return result
If a tree has 3 times as many branches as it has leaves, and it has 60 leaves, how many branches does it have?
def solve() -> int: leaves = 60 branches = 3 * leaves result = branches return result
Anna has a basket containing 60 eggs. She boiled 8 eggs and then gave 3 eggs to each of her 10 neighbors. How many eggs are left in the basket?
def solve() -> int: eggs = 60 eggs -= 8 eggs -= 3*10 result = eggs return result
If a car travels 136 miles in 2 hours and 20 minutes, what is the average speed of the car?
def solve() -> int: distance = 136 time = 2 + 20 / 60 speed = distance / time result = round(speed, 2) return result
A company produces 2000 units of a product at a cost of $5 per unit. If they sell each unit for $20, how much profit do they make?
def solve() -> int: num_units = 2000 cost_per_unit = 5 price_per_unit = 20 total_revenue = num_units * price_per_unit total_cost = num_units * cost_per_unit profit = total_revenue - total_cost result = profit return result
A museum charges $8 for adult tickets and $5 for children's tickets. A souvenir keychain costs $2. On Thursday, they had 75 adults and 100 children visit the museum. If a quarter of the customers also bought a souvenir keychain, how much money did the museum make that day?
def solve() -> int: adult_ticket_price = 8 child_ticket_price = 5 keychain_price = 2 num_adults = 75 num_children = 100 total_adult_sales = adult_ticket_price * num_adults total_child_sales = child_ticket_price * num_children total_sales = total_adult_sales + total_child_s...
A jewelry store buys silver necklaces at a rate of $25 per gram and sells at $35 per gram. If a necklace is bought for $200, how many grams does it weigh?
def solve() -> int: cost_per_gram = 25 price_per_gram = 35 total_cost = 200 cost_per_necklace = total_cost/cost_per_gram price_per_necklace = total_cost/price_per_gram weight = cost_per_necklace - price_per_necklace result = weight return result
John went shopping and spent $45 on clothes. If he bought 3 shirts for $15 each, how much did he spend on the rest?
def solve() -> int: shirts_bought = 3 price_per_shirt = 15 cost_of_shirts = shirts_bought * price_per_shirt total_cost = 45 cost_of_rest = total_cost - cost_of_shirts result = cost_of_rest return result
A library has 1000 books. Every month, 50 books are borrowed and 70 new ones are added. After 2 years, the library adds 300 more books. How many books does the library have altogether?
def solve() -> int: books = 1000 borrowed_per_month = 50 added_per_month = 70 months_in_2_years = 24 books_added_after_2_years = 300 total_borrowed = borrowed_per_month * months_in_2_years total_added = added_per_month * months_in_2_years + books_added_after_2_years total_books...
A group of 60 students took a biology exam. 40 students passed the exam, and the passing grade is 70%. How many students failed the exam?
def solve() -> int: passing_grade = 70/100 passing_students = 60 * passing_grade failed_students = 60 - passing_students result = failed_students return result
Ryan is 21 years old. 6 years ago, he was the same age as Alice is now. In 3 years, Alice will be twice as old as Bob was 2 years ago. If Bob's older brother is 5 years older than Bob, how old is Bob's older brother?
def solve() -> int: x = 21 - 6 y = (x + 3) / 2 + 2 z = y + 5 result = z return result
A recipe calls for 3/4 cups of sugar for every 2 cups of flour. How much sugar is needed for a recipe that calls for 8 cups of flour?
def solve() -> int: sugar_per_flour = 3/4 flour_needed = 8 sugar_needed = flour_needed * (sugar_per_flour / 2) result = round(sugar_needed,2) return result
A box contains 120 jelly beans. If there are 8 jelly beans in each bag, how many bags can be made and how many jelly beans will be left over?
def solve() -> int: total_jelly_beans = 120 jelly_beans_per_bag = 8 bags = total_jelly_beans // jelly_beans_per_bag leftover_jelly_beans = total_jelly_beans % jelly_beans_per_bag result = bags, leftover_jelly_beans return result
A pharmacy sells a prescription drug for 195 dollars per bottle with a wholesale cost of 72 dollars. If the pharmacy's markup on the drug is based on the wholesale cost, what is the percent markup?
def solve() -> int: sale_price = 195 wholesale_cost = 72 markup = sale_price - wholesale_cost markup_rate = markup / wholesale_cost percent_markup = markup_rate * 100 result = f'<<<{percent_markup}>>>' result = percent_markup return result
For his home gym, Jack is deciding between two options for his weights. One set costs $1.20/lb and the other set costs $1.50/lb. If Jack wants to purchase weights to reach a total of 100 lbs, how much will Jack save if he buys the cheaper option?
def solve() -> int: weight_needed = 100 price_option1 = 1.20 price_option2 = 1.50 total_cost_option1 = weight_needed * price_option1 total_cost_option2 = weight_needed * price_option2 cost_difference = total_cost_option2 - total_cost_option1 result = cost_difference r...
A company has 200 employees. Their salaries range from $30,000 to $100,000. Find the total salary expenses for the company if the average salary is $60,000.
def solve() -> int: number_of_employees = 200 average_salary = 60000 total_salary = number_of_employees * average_salary result = total_salary return result
Emily has 50 cookies to distribute equally among her 10 friends. However, 2 of her friends had to leave early. How many cookies does Emily have left for the remaining friends?
def solve() -> int: cookies = 50 friends = 10 left_early = 2 cookies_per_friend = cookies // friends cookies_left = cookies_per_friend * (friends - left_early) result = cookies_left return result
A school has 400 students, and each student has to take a math test and an English test. The math test has 20 questions and each question is worth 5 points. The English test has 10 questions and each question is worth 10 points. The average score on the math test is 75, and the average score on the English test is 80. ...
def solve() -> int: students = 400 math_questions = 20 math_points_per_question = 5 english_questions = 10 english_points_per_question = 10 math_average = 75 english_average = 80 total_math_points = math_average * math_questions * students total_english_points = english_average * en...
A restaurant has 15 tables. Each table can seat 4 people comfortably. If the restaurant is at full capacity, how many customers are there?
def solve() -> int: result =... return result
The animal shelter has 30 dogs waiting for adoption. They have 8 volunteers available. Each volunteer can walk one dog for 30 minutes. Each dog needs to be walked for 20 minutes. The shelter is first come, first served. How many dogs will not get walked?
def solve() -> int: dogs_waiting = 30 volunteers_available = 8 time_each_volunteer_can_walk = 30 time_each_dog_needs_to_be_walked = 20 total_time_volunteers_can_walk = volunteers_available * time_each_volunteer_can_walk total_dogs_that_can_be_walked = total_time_volunteers_can_walk // tim...
The cost of a monthly gym membership is $50. The cost of a yearly membership is $500. How much can you save, in dollars, per month if you buy the yearly membership instead of the monthly membership?
def solve() -> int: monthly_cost = 50 yearly_cost = 500 monthly_savings = monthly_cost * 12 - yearly_cost result = monthly_savings return result
A rectangular garden has a width of 10 feet and a length that is 8 feet more than the width. What is the area of the garden?
def solve() -> int: width = 10 length = width + 8 area_of_garden = width * length result = area_of_garden return result
Maria has a 32-page notebook which she divided into 8 equal parts. If she has used up 5 parts of the notebook, how many pages are not written on?
def solve() -> int: total_pages = 32 parts = 8 used_parts = 5 pages_per_part = total_pages / parts unused_pages = (parts - used_parts) * pages_per_part result = unused_pages return result
Student: Maria has 5 red apples and 3 green apples. If each apple costs 50 cents, how much will she pay for all the apples?
def solve() -> int: red_apples = 5 green_apples = 3 cost_per_apple = 0.5 total_cost = (red_apples * cost_per_apple) + (green_apples * cost_per_apple) result = total_cost return result
John has squirrels and frogs. Squirrels have four legs and frogs have two legs. If he has 18 frogs and half as many squirrels as frogs, what is the total number of legs of all his animals?
def solve() -> int: frogs = 18 frog_legs = 2 squirrels = frogs // 2 squirrel_legs = 4 total_legs = (frogs * frog_legs) + (squirrels * squirrel_legs) result = total_legs result return result
A pizza restaurant sells 150 pizzas per day. 60% of the pizzas are margherita pizzas, 30% are pepperoni pizzas, and the remaining pizzas are veggie pizzas. How many veggie pizzas are sold per day?
def solve() -> int: pizzas_sold = 150 margherita_percent = 60 pepperoni_percent = 30 veggie_percent = 100 - margherita_percent - pepperoni_percent veggie_pizzas = pizzas_sold * veggie_percent / 100 result = veggie_pizzas return result
Emily has a jar of 120 candies. She gave away 30 of them to her friends and then split the remaining candies evenly between herself and her brother. How many candies did each sibling get?
def solve() -> int: emily_candies = 120 given_away = 30 remaining_candies = emily_candies - given_away each_sibling = remaining_candies / 2 result = each_sibling return result
The football team has a total of 660 fingers and toes among the players. If each player has 20 fingers and toes combined, how many players are on the team?
def solve() -> int: total_fingers_toes = 660 fingers_toes_per_player = 20 players = total_fingers_toes // fingers_toes_per_player result = players return result
In a classroom, there are 40 students. One-eighth of the students wear glasses, one-fifth wear braces, and the rest wear neither. How many students wear neither glasses nor braces?
def solve() -> int: glasses = 1/8 * 40 braces = 1/5 * 40 either = glasses + braces neither = 40 - either result = neither return result
Martin's farm is 800 acres larger than 5 times Carter's farm. If Martin's farm is 6000 acres, how many acres is Carter's farm?
def solve() -> int: martin_farm = 6000 carter_farm = (martin_farm - 800) / 5 result = carter_farm return result
If a burger costs $3.50 and a hotdog costs $2.50, how much would it cost to buy 2 burgers and 3 hotdogs?
def solve() -> int: cost_burger = 3.5 cost_hotdog = 2.5 total_cost = 2*cost_burger + 3*cost_hotdog result = total_cost return result
A farmer has 20 acres of land to plant strawberries. Each acre can yield 5,000 pounds of strawberries. Strawberries sell for $3.50 per pound. If the farmer sells all strawberries harvested, how much money will the farmer make?
def solve() -> int: total_yield = 20 * 5000 total_revenue = total_yield * 3.5 result = total_revenue return result
In a trivia contest, Anna, Ben, and Cory answered 20 questions each. Anna got 15 correct answers, Ben got 2 more correct answers than Anna, and Cory got 5 less correct answers than Ben. For each correct answer, they earned 10 points, and for each wrong answer, they lost 5 points. The rest of the points were earned by t...
def solve() -> int: anna = 15 ben = anna + 2 cory = ben - 5 total = 20 points_per_correct = 10 points_per_wrong = -5 group = 500 anna_points = (anna * points_per_correct) + ((total - anna) * points_per_wrong) ben_points = (ben * points_per_correct) + ((total - ben) * poi...
A shirt is discounted by 15%. The original price of the shirt was $80. What is the sale price?
def solve() -> int: original_price = 80 discounted_price = original_price - (original_price * 0.15) result = discounted_price return result
Dylan and Victoria together have 28 apples. If Dylan has 3 times as many apples as Victoria, how many apples does Dylan have?
def solve() -> int: total_apples = 28 victoria_apples = total_apples / 4 dylan_apples = total_apples - victoria_apples result = dylan_apples return result
There were 36 students in a class. James distributed 1/5 of the students to play soccer and then gave away 3 more students to play basketball. How many students are left in the class?
def solve() -> int: total_students = 36 students_distributed_to_soccer = (1/5) * total_students students_given_to_basketball = 3 result = total_students - (students_distributed_to_soccer + students_given_to_basketball) return result
There are 27 books on the shelf. Each book has a total of 410 pages. How many pages are in total?
def solve() -> int: number_of_books = 27 pages_per_book = 410 total_pages = number_of_books * pages_per_book result = total_pages return result
A company ordered 750 pens from a supplier. The supplier sent 100 more pens as a bonus. If the company later returned 50 pens, how many pens does the company have now?
def solve() -> int: pens_ordered = 750 bonus_pens = 100 pens_received = pens_ordered + bonus_pens pens_returned = 50 pens_left = pens_received - pens_returned result = pens_left return result
If a recipe calls for 0.5 cups of sugar and you want to make half the recipe, how many cups of sugar do you need?
def solve() -> int: sugar_per_serving = 0.5 serving_mult = 0.5 total_sugar = sugar_per_serving * serving_mult result = total_sugar return result
Joanna has 10 gray cubes and 15 white cubes. What is the total number of cubes if she gives away 8 gray cubes and 1/4 of the white cubes?
def solve() -> int: x = 10 y = 15 z = 8 a = y/4 result = x - z + y - a return result
Megan works 56 hours in one week. Her hourly pay rate is $10. From her weekly earnings, 15% is deducted as income tax, 8% is deducted as insurance cover, and $3 is deducted for union dues. How much money, in dollars, does Megan take home after deductions?
def solve() -> int: gross_pay = 56 * 10 tax_percentage = 0.15 insurance_percentage = 0.08 union_dues = 3 total_deduction = gross_pay * tax_percentage + gross_pay * insurance_percentage + union_dues net_pay = gross_pay - total_deduction result = net_pay return result
san has 16 toy cars. If she gives 5/8 of them to her brother, how many toy cars does she have left?
def solve() -> int: cars = 16 give_away = 5/8 leftover = cars - (give_away * cars) result = leftover return result
Lily has a piggy bank with 36 coins inside. She counts that there are 12 quarters, 8 dimes, and the rest are nickels. How much money does Lily have in her piggy bank in dollars?
def solve() -> int: nickels = 36 - (12 + 8) quarters_value = 12 * 25 dimes_value = 8 * 10 nickels_value = nickels * 5 total_value = quarters_value + dimes_value + nickels_value total_dollars = total_value / 100 result = total_dollars return result
A department store is closing and selling all of its clothing. They have 5000 different items which would normally retail for $100 each. They are offering a 50% discount and manage to sell 70% of the items. If they owed $200,000 to their creditors, how much money do they have left after the sale?
def solve() -> int: num_items = 5000 retail_price = 100 discount = 0.5 sold_percent = 0.7 creditors_owed = 200000 sale_price = retail_price * (1 - discount) total_revenue = num_items * sale_price * sold_percent money_left = total_revenue - creditors_owed result = ...
Emma has 2 tanks of fish, 4 tanks of shrimp, and 6 tanks of snails. She cleans her fish tanks once a week, cleans her shrimp tanks every 3 days, and cleans her snail tanks every other day. How many times in a year does she clean her aquariums altogether?
def solve() -> int: fish_tanks = 2 shrimp_tanks = 4 snail_tanks = 6 fish_cleaning_frequency = 1 shrimp_cleaning_frequency = 3 snail_cleaning_frequency = 2 days_in_year = 365 total_cleanings = (fish_tanks * fish_cleaning_frequency * days_in_year) + (shrimp_tanks * (days_in_...
A family of six goes camping for three days. Each person needs two liters of water per day for drinking and cooking. They have a water tank that can hold 25 liters. How many times do they need to refill the tank during the trip?
def solve() -> int: water_needed = 6 * 2 * 3 tank_fills = water_needed // 25 remainder = water_needed % 25 if remainder > 0: tank_fills = tank_fills + 1 result = tank_fills return result
Lisa needs to fill her bookshelves with 16 books, and wants the books to be divided into 2 equal piles. How many books will she have in each pile?
def solve() -> int: number_of_books_in_each_pile = 16 // 2 result = number_of_books_in_each_pile return result
Student: 1. John has a container of juice which holds 3 liters of liquid. He takes sips of 120 ml every7 minutes. How much liquid is left in the container after 3 hours?
def solve() -> int: container = 3 sip = 0.12 time = 3 interval = 7 sips = 180 // 7 + 1 drank = sips * sip left = container - drank result = left return result
Student: A box contains 36 red balls, 48 blue balls, and 60 green balls. If 15% of the red balls, 25% of the blue balls, and 40% of the green balls are removed, how many balls are left in the box?
def solve() -> int: red_balls = 36 blue_balls = 48 green_balls = 60 red_balls_removed = red_balls * 0.15 blue_balls_removed = blue_balls * 0.25 green_balls_removed = green_balls * 0.4 total_balls_removed = red_balls_removed + blue_balls_removed + green_balls_removed total_balls_left = re...
Possible new questions are: Anna sells lemonade at a stand. She charges $0.5 for a small cup and $0.8 for a large cup. On Saturday, she sold 12 small cups and 15 large cups. On Sunday, she sold 9 small cups and 18 large cups. How much money did she make in total during the weekend?
def solve() -> int: small_price = 0.5 large_price = 0.8 small_sales_saturday = 12 * small_price large_sales_saturday = 15 * large_price total_sales_saturday = small_sales_saturday + large_sales_saturday small_sales_sunday = 9 * small_price large_sales_sunday = 18 * large_price total_sale...
There is a 30-hour long car journey with 6 gas stops along the way. The maximum capacity of the car’s tank is 15 gallons. The first stop is 4 hours after the trip begins and each gas stop after that is 5 hours apart. On the fourth stop the car tank was 3/8 full and the driver continued to drive until it ran out of fuel...
def solve() -> int: tank_1st = 15 * 3/8 stop_5th = 4 + 5*4 time_traveled_no_fuel = 25.5 - stop_5th gallons_consumed = (15 - tank_1st) * time_traveled_no_fuel / 5 result = gallons_consumed return result
Ramona has 36 apples. She needs 12 more apples to have 4 times as many as Samantha, and Samantha has 6 apples less than Timothy. How many more apples does Ramona have than Timothy?
def solve() -> int: ramona_apples = 36 samantha_apples = ramona_apples / 4 - 12 timothy_apples = samantha_apples + 6 ramona_timothy_diff = ramona_apples - timothy_apples result = ramona_timothy_diff return result
A spaceship launched with 500 crew members at a constant rate. After 2 hours, 100 crew members were transferred to another spaceship at a constant rate. Over the next 7 hours, new crew members entered the spaceship at a constant rate. If the final number of crew members on the spaceship was 650, at what rate did the ne...
def solve() -> int: initial_crew = 500 time_passed = 2 transferred_crew = 100 final_crew = 650 remaining_crew = initial_crew - transferred_crew rate = (final_crew - remaining_crew) / 7 result = rate return result
If the same log is cut into 4 equal parts, how much does each cut piece weigh?
def solve() -> int: part_weight = 150 total_length = 20 number_of_parts = 4 part_length = total_length/number_of_parts result = part_weight * part_length return result
Ben can solve 6 math problems in 25 minutes with his calculator and 4 math problems in 25 minutes without his calculator. How many more math problems would Ben solve in 1 hour and 40 minutes with his calculator than without his calculator?
def solve() -> int: calc_problems = 6 / 25 no_calc_problems = 4 / 25 calc_total = calc_problems * 100 no_calc_total = no_calc_problems * 100 difference = calc_total - no_calc_total result = difference return result
arah has 24 toy cars. She wants to divide them evenly among her 4 friends. How many toy cars will each friend get and how many toy cars will be left over for Sarah?
def solve() -> int: cars = 24 friends = 4 cars_per_friend = cars // friends cars_leftover = cars % friends result = (cars_per_friend, cars_leftover) return result
The school is organizing a swimming competition where students have to swim around the pool 10 times. The pool is 1/2 mile long. The winner finishes in 30 minutes. The previous year's winner finished in 36 minutes. How many minutes on average faster did the winner swim one lap compared to last year?
def solve() -> int: lap_distance = 1/20 winner_time = 30 previous_winner_time = 36 winner_lap_time = winner_time / 10 previous_winner_lap_time = previous_winner_time / 10 lap_time_difference = previous_winner_lap_time - winner_lap_time result = lap_time_difference ...
Dan has 6 soccer balls and 3 basketballs. He wants to divide them into equal batches, how many batches will he make?
def solve() -> int: total_balls = 6 + 3 batch_size = 1 result = total_balls // batch_size return result
Student: - Cindy is eating candy. Each piece of candy is 50 calories. A bag has 20 pieces and costs $4. If she wants to eat 750 calories, how many bags does she have to open?
def solve() -> int: candy_calories = 50 pieces_per_bag = 20 cost_per_bag = 4 total_calories = 750 total_pieces = total_calories / candy_calories bags_needed = total_pieces / pieces_per_bag cost = bags_needed * cost_per_bag result = cost return result
Anna bought six times as many stickers as Ben. If Ben paid $0.2 for a sticker and bought 50 stickers, calculate the average price per sticker that Anna paid if she spent $36 in total.
def solve() -> int: anna_stickers = 50 * 6 ben_money = 50 * 0.2 difference = 36 - ben_money average = difference / anna_stickers result = average return result
A bag contains 60 red balls, 90 white balls, and 120 blue balls. If a ball is picked at random, what is the probability of getting a white ball?
def solve() -> int: total_balls = 60 + 90 + 120 white_balls = 90 probability = (white_balls/total_balls) * 100 result = probability return result
Sarah runs 5 km every day for 3 weeks. If she increases her distance by 1 km every week, how many kilometers will she run in total?
def solve() -> int: day_distance = 5 total_weeks = 3 extra_distance_per_week = 1 total_distance = day_distance * 7 * total_weeks total_distance += (extra_distance_per_week * (total_weeks-1)) * 7 result = total_distance return result
``` Jane scores an average of 80 on her first 11 quizzes and wants to average 84 for the semester. What should she score on her 12th quiz to obtain this average?
def solve() -> int: prev_quizzes_avg = 80 total_quizzes = 12 target_semester_avg = 84 target_sum = target_semester_avg * total_quizzes current_sum = prev_quizzes_avg * (total_quizzes-1) needed_score = target_sum - current_sum result = needed_score return result
A rectangle is circumscribed in a circle with a circumference of 30 cm. What is the length of the side of the rectangle?
def solve() -> int: circumference = 30 side_length = circumference / (2 * 3.14) result = side_length return result
Ethan and Elijah are making pizzas. Ethan can make 3 pizzas in an hour, while Elijah can make 4 in an hour. How many pizzas would they make together in 90 minutes?
def solve() -> int: ethan_pizzas_per_hour = 3 elijah_pizzas_per_hour = 4 total_pizzas_per_hour = ethan_pizzas_per_hour + elijah_pizzas_per_hour total_pizzas_in_90_minutes = total_pizzas_per_hour * 1.5 result = total_pizzas_in_90_minutes return result
Alex has a piggy bank that contains only quarters and nickels. He has 20 quarters and 30 nickels in it. He adds one quarter and two nickels to the piggy bank every week. How much money does he have in the piggy bank after 10 weeks?
def solve() -> int: quarters = 20 nickels = 30 week = 10 for i in range(week): quarters = quarters + 1 nickels = nickels + 2 value = (quarters * 0.25) + (nickels * 0.05) result = value return result
An anaconda that was 4 meters long swallowed a 100-centimeter rabbit. After two weeks, the rabbit was completely digested. If this snake continues to eat 100-centimeter-long rabbits at a constant rate of one rabbit per two weeks, what is the maximum number of rabbits that the snake can eat in 732 days?
def solve() -> int: anaconda_length = 4 rabbit_length = 100 digestion_time = 14 eating_rate = 1 time_period = 732 rabbits_per_cycle = digestion_time // 14 digestion_cycles = time_period // digestion_time total_rabbits = digestion_cycles * rabbits_per_cycle result ...
A company wants to increase the salary of its employees by 5%. If an employee currently makes $40,000, what is their new salary after the increase?
def solve() -> int: current_salary = 40000 increase = 0.05 new_salary = current_salary * (1 + increase) result = new_salary return result
Tom is 1 year younger than twice the age of Eric. If Eric is 18 years old, how old is Tom?
def solve() -> int: Eric = 18 Tom = (2*Eric) - 1 result = Tom return result
Madison and her family are going to the cinema. Tickets cost $7 for adults and $5 for kids. Madison's family consists of 3 adults and 5 kids. How much will they need to pay for tickets in total?
def solve() -> int: ad = 7 kid = 5 adult = 3 kid = 5 total = (ad * adult) + (kid * kid) result = total return result
A rectangle has a width of 5 feet and a length of 10 feet. What is the perimeter of the rectangle in inches?
def solve() -> int: width = 5 length = 10 perimeter_feet = 2 * width + 2 * length perimeter_inches = perimeter_feet * 12 result = perimeter_inches return result
In a set of pencils, the ratio of HB to 2B is 7:4. If there are 99 pencils, how many are HB and how many are 2B?
def solve() -> int: total_pencils = 99 HB_ratio = 7 B2_ratio = 4 HB_amount = total_pencils / (HB_ratio + B2_ratio) * HB_ratio B2_amount = total_pencils / (HB_ratio + B2_ratio) * B2_ratio result = HB_amount, B2_amount return result
Olivia is counting how many pages she read in her book, so far, this week. On Monday, she read 30 pages. On Tuesday, she read 20 pages less than Monday. On Wednesday, she read 15 more pages than Tuesday. On average, Olivia reads 100 pages in the first three days of the week in a typical week. How many fewer pages is sh...
def solve() -> int: monday = 30 tuesday = monday - 20 wednesday = tuesday + 15 total_pages = monday + tuesday + wednesday average_pages = 100 difference = average_pages - total_pages result = difference return result
A water tank can hold 500 liters of water. If it is currently filled to 2/5 of its capacity, how many more liters of water can it hold?
def solve() -> int: tank_capacity = 500 current_amount = tank_capacity * 2/5 remaining_capacity = tank_capacity - current_amount result = remaining_capacity return result
Student: A classroom has 40 students and 4/5 of them pass the exam. If 1/4 of the remaining students take a makeup exam and all of them pass, how many students pass the exam in total?
def solve() -> int: total_students = 40 pass_exam_ratio = 4/5 makeup_exam_ratio = 1/4 pass_exam = total_students * pass_exam_ratio makeup_exam = total_students * (1 - pass_exam_ratio) * makeup_exam_ratio result = pass_exam + makeup_exam return result
A caterer has 200 cupcakes and wants to divide them among 50 guests. The first 20 guests get 3 cupcakes each and the rest get 2 cupcakes. How many cupcakes are left over?
def solve() -> int: cupcakes = 200 first20 = 20*3 last30 = 30*2 totalused = first20 + last30 leftover = cupcakes - totalused result = leftover return result
The gas station sells gasoline for $2.50 per gallon. Juan's car has a fuel tank that can hold 12 gallons of gasoline. If he bought 3.5 gallons of gasoline last Monday and 4.7 gallons of gasoline last Thursday, how much did he spend on gasoline in total?
def solve() -> int: gallon_price = 2.50 fuel_tank_capacity = 12 monday_gallon = 3.5 thursday_gallon = 4.7 total_gallon = monday_gallon + thursday_gallon total_cost = total_gallon * gallon_price result = total_cost return result
am rents a car for 5 days and pays $40 per day. He also pays a $20 service fee and a 15% tax on the total cost. How much does he pay in total?
def solve() -> int: rental_cost = 40 * 5 total_cost_before_tax = rental_cost + 20 tax = total_cost_before_tax * 0.15 total_cost_after_tax = total_cost_before_tax + tax result = total_cost_after_tax return result
A triangle has a height of 12 inches and its base is 16 inches. What is the area of the triangle?
def solve() -> int: b = 16 h = 12 a = (b * h) / 2 result = a return result
A pizza has 8 slices. Julie ate 2 slices and then shared the rest equally with her 3 friends. How many slices did each person get?
def solve() -> int: total_slices = 8 julie_ate = 2 left_after_julie = total_slices - julie_ate friends = 3 each_person = left_after_julie / friends result = each_person return result
John is printing flyers for his store. One pack of paper has 500 sheets. He needs to print 4000 flyers. How many extra sheets of paper can he use if he buys 10 packs of paper?
def solve() -> int: pack_size = 500 flyers_needed = 4000 packs_bought = 10 total_sheets = pack_size * packs_bought extra_sheets = total_sheets - flyers_needed result = extra_sheets return result
In a garden, the number of roses is twice as many as the number of daisies. If there are 30 daisies, how many roses are there?
def solve() -> int: numberOfDaisies = 30 numberOfRoses = numberOfDaisies * 2 result = numberOfRoses return result
Emily finds a dozen pearls worth $500, but when she goes to sell them to a jeweler, they aren't real pearls, and she is fined $100 and sent away. If Emily sells real pearls for $75 each, how much money is she left with?
def solve() -> int: dozen_pearls = 12 pearl_value = 500 fine = 100 selling_price = 75 total_pearl_value = dozen_pearls * pearl_value total_fine = fine total_selling_price = dozen_pearls * selling_price money_left = total_pearl_value - total_fine - total_selling_price r...
Tina's mom bought her a soccer ball for $19.99. She also had to pay 6% sales tax. What was the total retail price of the ball?
def solve() -> int: cost = 19.99 tax_rate = 0.06 tax = cost*tax_rate total_cost = cost + tax result = total_cost return result
A carton of eggs has 30 eggs. 3 such cartons of eggs were delivered to a restaurant. 5 eggs are broken. The remaining eggs are used to make omelettes with 2 eggs each. How many omelettes can be made?
def solve() -> int: cartons_delivered = 3 eggs_per_carton = 30 total_eggs = cartons_delivered * eggs_per_carton broken_eggs = 5 remaining_eggs = total_eggs - broken_eggs eggs_per_omelette = 2 total_omelettes = remaining_eggs // eggs_per_omelette result = total_omelettes return result...
Possible new questions and programs are: There are 256 red apples and 144 green apples in a basket. Each apple weighs 120 grams. If 35% of the apples are eaten, how many kilograms of apples are left in the basket?
def solve() -> int: total_apples = 256 + 144 eaten_apples = 0.35 * total_apples left_apples = total_apples - eaten_apples left_weight = left_apples * 120 / 1000 result = left_weight return result
Student: Jaime's truck can travel 18 miles per hour while Bronn's truck can travel 27 miles per hour. If their destination is 324 miles away, how many hours ahead will Bronn be ahead of Jaime?
def solve() -> int: jaime_speed = 18 bronn_speed = 27 distance = 324 jaime_time = distance / jaime_speed bronn_time = distance / bronn_speed time_difference = bronn_time - jaime_time result = time_difference // 1 return result
A classroom has 28 desks which each hold 2 students. If there are only 48 students, how many desks will be unoccupied?
def solve() -> int: desks = 28 students = 48 totalcapacity = desks * 2 unoccupied = totalcapacity - students result = unoccupied return result
Peter wants to make $100 by selling bracelets. He plans to sell them for $5 each and he calculates that his costs are $2 per bracelet. How many bracelets does he need to sell to reach his goal?
def solve() -> int: desired_profit = 100 sale_price = 5 cost_price = 2 bracelets_needed = (desired_profit / (sale_price - cost_price)) result = bracelets_needed return result
Michelle has a collection of 300 paintings in her art gallery. She recently went on a painting spree and made 50 new paintings in the first week. She made twice that many in the second week. She also sold 40 of her old paintings. How many paintings are in Michelle's art gallery now?
def solve() -> int: total_paintings = 300 new_paintings_week1 = 50 new_paintings_week2 = 2 * new_paintings_week1 sold_paintings = 40 total_paintings += new_paintings_week1 total_paintings += new_paintings_week2 total_paintings -= sold_paintings result = total_paintings retu...