question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A person throws a ball upwards from 80 feet high, with an initial velocity of 64 feet per second. What is the maximum height reached by the ball?
def solve() -> int: height_initial = 80 velocity_initial = 64 acceleration = -32 time_to_peak = (velocity_initial / acceleration) * (-1) height_peak = height_initial + (velocity_initial * time_to_peak) + (0.5 * acceleration * time_to_peak ** 2) result = height_peak return result
James has $500 and wants to buy a book that costs $75. How much money will he have after purchasing the book?
def solve() -> int: starting_money = 500 cost_of_book = 75 money_after_purchase = starting_money - cost_of_book result = money_after_purchase return result
A shirt costs $10 less than a pair of jeans. The pair of jeans is 20% more expensive than a $40 sweater. How much is the shirt?
def solve() -> int: jeans_price = 40 * (1 + 0.2) shirt_price = jeans_price - 10 result = shirt_price return result
Fatima had 12 more pens than Ali but 6 fewer pens than Hassan. Ali and Hassan each gave 3 pens to Fatima so that she has 30 pens now. How many pens did Ali have in the beginning?
def solve() -> int: x = 30 - 18 x = 12 ali = x result = ali return result
Sarah had 60 seashells. She gave her friend a sixth of them, and then she found 45 more seashells on the beach. How many seashells does Sarah have now?
def solve() -> int: seashells = 60 friend_seashells = seashells / 6 seashells -= friend_seashells seashells += 45 result = seashells return result
Student: Alex harvested 20 apples from his garden. He sold 12 of the apples and ate 5 of them. How many apples does he have left?
def solve() -> int: apples_harvested = 20 apples_sold = 12 apples_eaten = 5 apples_left = apples_harvested - apples_sold - apples_eaten result = apples_left return result
Elijah is 8 years old. In 8 years, his grandfather will be 5 times his age then. How old is his grandfather now?
def solve() -> int: elijah_age = 8 change_in_years = 8 grandfather_current_age = (5 * (elijah_age + change_in_years)) - change_in_years result = grandfather_current_age return result
A certain type of candy has either a red or a blue wrapper, but never both. Red candies are scarce, with only one for every seven blue candies that are sold. A store sold 120 candies in a day. How many red candies did the store sell?
def solve() -> int: total = 120 ratio = 1/7 red = total * ratio red = round(red) result = red return result
A store sells a pair of shoes for $50. If the store gives a 10% discount on the shoes, what is the new selling price?
def solve() -> int: original_price = 50 discount_percentage = 0.10 discount_amount = original_price*discount_percentage new_price = original_price - discount_amount result = new_price return result
Jane borrowed 30£ from her friend. She paid 10£ after 10 days. How much money does she owe now?
def solve() -> int: initial_borrowed_money = 30 money_paid = 10 days_passed = 10 interest_percentage = 0.05 interest_rate_per_day = interest_percentage / 365 interest_on_money_due = (initial_borrowed_money - money_paid) * interest_rate_per_day * days_passed money_due = initial_borrowed_mone...
Michael wants to buy a new camera that costs $2,500. He can make a down payment of $500 and needs to get a loan for the rest of the amount. He has to make 36 equal monthly payments on the loan, with an interest rate of 2% on each payment. What will Michael's monthly payments be?
def solve() -> int: price = 2500 down_payment = 500 loan_amount = price - down_payment interest_rate = 0.02 num_payments = 36 monthly_interest_rate = interest_rate / 12 monthly_payment = loan_amount * (monthly_interest_rate * (1 + monthly_interest_rate) ** num_payments) / ((1 + monthly_...
Student: Paul is ordering chairs for his office. He has 8 tables with 6 chairs each. How many chairs does Paul need to order?
def solve() -> int: tables = 8 chairs_per_table = 6 total_chairs = tables * chairs_per_table result = total_chairs return result
A class has 20 students, and 12 of them are boys. If 2 girls join the class, what percentage of the class are boys?
def solve() -> int: number_of_boys = 12 total_number_of_students = 20 total_number_of_students = total_number_of_students + 2 percentage_of_boys = (number_of_boys / total_number_of_students) * 100 result = percentage_of_boys return result
Student: A store is having a 25% off sale on all items. If a customer purchased an item for $120 after the discount, how much did the item originally cost?
def solve() -> int: discount = 0.25 final_price = 120 original_price = final_price / (1 - discount) original_price = round(original_price, 2) result = original_price return result
A rectangle has a width of 10 meters and a length of 15 meters. What is the area of the rectangle in square meters?
def solve() -> int: width = 10 length = 15 area = width * length result = area return result
Mary's fish tank has 5 goldfish and 12 guppies. Jack's fish tank has 2 less than four times as many fish as Mary's fish tank. How many fish does Jack's fish tank have?
def solve() -> int: mary_goldfish = 5 mary_guppies = 12 mary_fish_total = mary_goldfish + mary_guppies jack_fish_total = 4 * mary_fish_total - 2 result = jack_fish_total return result
Amanda has $40. She spends $12 on lunch and the rest of the money on three notebooks that cost the same amount. How much did each notebook cost?
def solve() -> int: total_money = 40 lunch_cost = 12 remaining_money = total_money - lunch_cost notebook_count = 3 notebook_cost = remaining_money / notebook_count result = notebook_cost return result
There are 7 pencils and 11 pens. If the ratio of pencils to pens is 3:4, how many pencils are there?
def solve() -> int: x = 18/7 pencils = 3*x result = pencils return result
A company pays $10 per hour for regular hours of work and $15 per hour for overtime. If John works for 40 hours in a week, with 5 of those hours being overtime, how much will he be paid?
def solve() -> int: regular_rate = 10 overtime_rate = 15 regular_hours = 35 overtime_hours = 5 regular_pay = regular_rate*regular_hours overtime_pay = overtime_rate*overtime_hours total_pay = regular_pay+overtime_pay result = total_pay return result
Mark has saved $10 every month for the last 6 months. How much money will he have in total?
def solve() -> int: months = 6 amount_saved = 10 total_amount = months * amount_saved result = total_amount return result
Larry mows his lawn every week and it takes him about 4 hours. If he wants to complete the mowing in 6 hours, how much more area must he cover?
def solve() -> int: original_time = 4 target_time = 6 time_saved = 4 - 6 saved_area = original_time / time_saved result = saved_area return result
A musician knows she needs to carry 2 sets of strings for every hour she performs. If she plans to perform for 5 hours every day for a week, with a break of 15 minutes every hour, how many sets of strings does she need to bring for her first performance?
def solve() -> int: hours_per_day = 5 break_time = 0.25 total_hours = hours_per_day * 7 - break_time * 7 sets_per_hour = 2 total_sets = total_hours * sets_per_hour result = total_sets return result
A pizza restaurant charges $2 per topping. If a customer orders a pizza with 3 toppings and a large pizza costs $10, how much does their pizza cost?
def solve() -> int: num_toppings = 3 topping_cost = 2 pizza_cost = 10 total_topping_cost = num_toppings * topping_cost total_pizza_cost = pizza_cost + total_topping_cost result = total_pizza_cost return result
Student: There are 40 bananas in a basket. One-fifth of them are ripe. How many of the bananas are not ripe?
def solve() -> int: total_bananas = 40 ripe_bananas = total_bananas * 1/5 not_ripe_bananas = total_bananas - ripe_bananas result = not_ripe_bananas return result
Lily's ten-fingered glove has 2 times more fingertips than fingers, and 8 times more buttons than fingertips. How many fewer fingers does the glove have than the combined number of buttons and fingertips?
def solve() -> int: fingers = 10 fingertips = fingers * 2 buttons = fingertips * 8 combined = fingertips + buttons difference = combined - fingers result = difference return result
Sam and Kim went to the toy store to buy some stuffed animals and puzzles. Sam bought 6 more stuffed animals than Kim, but Kim bought three times as many puzzles as Sam. If Kim bought 9 stuffed animals and 18 puzzles, how many puzzles did Sam buy?
def solve() -> int: s = 9 + 6 p = 18 / 3 result = p return result
A rectangle has a length of 8cm and a width of 5cm. What is its area in square centimeters?
def solve() -> int: length = 8 width = 5 area = length * width result = area return result
A gardener charges $12 per hour for his services. He worked for 5 hours at Mr. Smith's house and 3 hours at Mrs. Lee's house. He also bought some plants and fertilizer for $36, which he split equally between the two houses. How much did Mrs. Lee pay the gardener in total?
def solve() -> int: rate = 12 smith_hours = 5 lee_hours = 3 cost = 36 cost_per_house = cost / 2 smith_charge = smith_hours * rate lee_charge = lee_hours * rate lee_total = lee_charge + cost_per_house result = lee_total return result
Carlos has a baseball collection with 135 baseballs. He plans to separate them evenly into 3 boxes. How many baseballs should Carlos put in each box?
def solve() -> int: total_balls = 135 num_boxes = 3 box_capacity = total_balls // num_boxes balls_in_each_box = box_capacity result = balls_in_each_box return result
Ryan is an avid reader and buys ten books every month. He does this for four years, but then decides to give away a quarter of his collection. How many books does Ryan have left?
def solve() -> int: books_per_month = 10 years_bought_books = 4 total_books_bought = books_per_month * 12 * years_bought_books books_given_away = total_books_bought // 4 books_left = total_books_bought - books_given_away result = books_left return result
A store has 6 different types of apples that each cost different amounts. If you buy 2 of each type of apple, and one type costs $1.50 per apple, what is the total cost of the apples?
def solve() -> int: costs = [1, 1.25, 2, 1.75, 1.5, 1.8] num_each_apple = 2 expensive_apple_index = 4 total_cost = (sum(costs) - costs[expensive_apple_index] + 1.5) * num_each_apple result = total_cost return result
A construction worker builds 5 walls in 10 hours. How many walls can he build in 20 hours?
def solve() -> int: walls_per_hour = 5/10 walls_per_20_hours = walls_per_hour * 20 result = walls_per_20_hours return result
The circumference of a circle is 56cm. Calculate the diameter of the circle.
def solve() -> int: circumference = 56 PI = 3.14 diameter = circumference / PI result = diameter return result
On Friday, Alice sold 15 cupcakes for $2 each. On Saturday, she sold 20 cupcakes for $1.5 each. On Sunday, she sold 25 cupcakes for $1 each. She spent $10 on ingredients and $5 on packaging. How much profit did she make over the weekend?
def solve() -> int: friday_revenue = 15 * 2 saturday_revenue = 20 * 1.5 sunday_revenue = 25 * 1 total_revenue = friday_revenue + saturday_revenue + sunday_revenue total_cost = 10 + 5 profit = total_revenue - total_cost result = profit return result
Emily wants to make brown frosting by combining red and green food colors in the ratio of 2:3. If she gets 50 ounces of brown frosting, what's 3/5 of the difference between the number of red and green colors she used?
def solve() -> int: red_colors = 2 green_colors = 3 total_colors = red_colors + green_colors brown_frosting = 50 red_frosting = (red_colors / total_colors) * brown_frosting green_frosting = (green_colors / total_colors) * brown_frosting difference = red_frosting - green_f...
Student: Maria bought $40 worth of books. She bought a novel for $12, a biography for $8, a cookbook for $10, and some magazines. The magazines cost $2 each, and she bought one more magazine than the number of books. How many magazines did she buy?
def solve() -> int: price_novel = 12 price_biography = 8 price_cookbook = 10 price_magazine = 2 total_price = 40 total_price_books = price_novel + price_biography + price_cookbook total_price_magazines = total_price - total_price_books number_magazines = total_price_magazines // price_ma...
Tom wins a race that is 10 kilometers long. He runs at a pace of 5 minutes per kilometer. His friend David, who finished last, runs at a pace of 6 and a half minutes per kilometer. If David finished the race in 2 hours and 12 minutes, how long did it take Tom to finish the race?
def solve() -> int: distance = 10 time_per_kilometer_tom = 5 time_tom = distance * time_per_kilometer_tom total_time_david = 132 time_per_kilometer_david = (total_time_david - time_tom) / distance time_tom_in_minutes = time_tom result = time_tom_in_minutes return result
In Gary's plant nursery, dividing a particular species of plant increases the number of plants by 40%. If Gary starts with 475 plants, how many of these plants will be left after 4 divisions?
def solve() -> int: plants = 475 for i in range(4): plants += plants * 0.4 result = 5485.2 return result
A man divides his salary into two parts, and he spends 60% of the first part of his salary and 80% of the second part of his salary. If he saves $2000, and spends a total of $6000, what is his monthly salary?
def solve() -> int: saving_money = 2000 spending_money = 6000 fraction_saved = saving_money/spending_money fraction_spent = 1 - fraction_saved fraction_first_part = 0.6/fraction_spent fraction_second_part = 0.8/fraction_spent total_salary = spending_money/fraction_spent monthly_salary = ...
A pizza party was organized for 18 children where each of them ate 4 slices of pizza. If each pizza had 8 slices, how many pizzas were ordered?
def solve() -> int: num_children = 18 slices_per_child = 4 slices_per_pizza = 8 total_slices_needed = num_children * slices_per_child pizzas_needed = total_slices_needed / slices_per_pizza result = pizzas_needed return result
In a candy jar, Jack has 800 pieces of candy. He gives away 2/3 of the candies to his three nephews in a ratio of 5:8:11. How many candies did the second nephew get?
def solve() -> int: candies_in_jar = 800 total_nephews = 3 candies_given_away = candies_in_jar * (2/3) candies_per_nephew = candies_given_away / (5 + 8 + 11) second_nephew_candies = candies_per_nephew * 8 result = second_nephew_candies return result
Roberta has a geography exam with 30 questions and a geometry exam with 20 questions. The geography exam is to be completed in 1 hour and 15 minutes, and the geometry exam in 45 minutes. If Robert wants to spend the same amount of time on each question, how much time does she have for each question?
def solve() -> int: geography_questions = 30 geometry_questions = 20 geography_time = 1 * 60 + 15 geometry_time = 45 total_geography_time = geography_time * 60 total_geometry_time = geometry_time * 60 time_per_geography_question = total_geography_time / geography_questions time...
John ran for 3 hours in the park. The entrance fee was $4 and he made $7 per hour. How much money did John have left after the run?
def solve() -> int: entrance_fee = 4 hourly_income = 7 hours_ran = 3 total_spent = entrance_fee + (hours_ran * hourly_income) result = total_spent return result
Mark deposited $5,000 in a bank that pays 5% interest per annum, compounded monthly. How much interest will he earn at the end of 3 years?
def solve() -> int: p = 5000 r = 0.05/12 n = 12 t = 3 a = p*((1+(r/n))**(n*t)) interest = a - p result = round(interest, 2) return result
Amy can knit 8 rows of a scarf in 6 minutes. At this same rate, how many rows could she knit in 45 minutes?
def solve() -> int: rows_per_minute = 8 / 6 rows_in_45_minutes = rows_per_minute * 45 result = rows_in_45_minutes return result
Ben is making a fruit salad with apples, bananas, oranges, and grapes. He needs 3 apples, 4 bananas, 2 oranges, and 10 grapes for each serving. He has 15 apples, 16 bananas, 8 oranges, and 40 grapes in his kitchen. How many servings of fruit salad can he make with the available fruits?
def solve() -> int: servings_apples = 15 // 3 servings_bananas = 16 // 4 servings_oranges = 8 // 2 servings_grapes = 40 // 10 servings_fruit_salad = min(servings_apples, servings_bananas, servings_oranges, servings_grapes) result = servings_fruit_salad return result
If a recipe needs 2 cups of flour to make 20 cookies, how much flour is needed to make 100 cookies?
def solve() -> int: flour_per_cookie = 2 / 20 flour_for_100_cookies = flour_per_cookie * 100 result = flour_for_100_cookies return result
The number of pianos in a music store is 1/8 of the number of guitars. If there are 72 guitars, how many pianos are there in the store?
def solve() -> int: guitars = 72 pianos = guitars / 8 result = pianos return result
Omar is saving money for a vacation. He earns $15.00 per hour at his part-time job and works 20 hours per week. He spends $10.00 per week on lunch and $20.00 per week on transportation. He also saves 10% of his earnings for emergencies. How much money does he save for his vacation in 4 weeks?
def solve() -> int: hourly_rate = 15.00 hours = 20 weeks = 4 lunch = 10.00 transportation = 20.00 savings_rate = 0.10 gross_income = hourly_rate * hours * weeks net_income = gross_income - (lunch * weeks) - (transportation * weeks) - (gross_income * savings_rate) resul...
A bag contains 20 red balls and 25 blue balls. What is the probability of taking out a blue ball?
def solve() -> int: probability = 25 / (20+25) result = f'<<<{probability}>>>' result = probability return result
Ashley's cable package cost starts out at $80/month. It increases by 6% for every additional premium channel and $2 for every service call. If she adds 3 premium channels and has 2 service calls, what's her new cable package cost? Jordan and Rachel played 20 games of basketball against each other. Jordan won two-thirds...
def solve() -> int: base_cost = 80 premium_channels = 3 service_calls = 2 premium_cost = base_cost * (1 + 0.06)**premium_channels service_cost = service_calls * 2 total_cost = base_cost + premium_cost + service_cost result = total_cost total_games = 20 j...
Julie has 150 stickers that she wants to share equally among her 5 friends. If she gives 30 stickers to each of her friends, how many stickers will she have left for herself?
def solve() -> int: stickers = 150 num_friends = 5 stickers_per_friend = 30 total_stickers_given = num_friends * stickers_per_friend stickers_left = stickers - total_stickers_given result = stickers_left return result
A building has 4 floors, and there are 20 apartments on each floor. If the rent for each apartment is $500 per month, what is the total yearly rent for the entire building?
def solve() -> int: num_floors = 4 num_apartments = 20 rent_per_month = 500 total_apartments = num_floors * num_apartments total_rent_per_month = total_apartments * rent_per_month total_rent_per_year = total_rent_per_month * 12 result = total_rent_per_year return result
Kevin is cleaning houses for neighbors. He gets paid $30 for every house he cleans. On average, how many hours can he take to clean a house if he wants to earn $100 a day?
def solve() -> int: pay_per_house = 30 total_pay = 100 hours_per_day = 0 houses_per_day = total_pay / pay_per_house hours_per_house = 24 / houses_per_day hours_per_day = hours_per_house result = hours_per_day return result
Dave can paint a wall in 4 hours, while Brian can paint the same wall in 6 hours. How long will it take for both of them to paint the same wall if they work together?
def solve() -> int: dave_rate = 1/4 brian_rate = 1/6 combined_rate = dave_rate + brian_rate time = 1 / combined_rate result = time return result
In a shoe store, a pair of sneakers is priced at $64, a pair of flats is priced at $35, and a pair of boots is priced at $100. If they sell 45 pairs of sneakers, 25 pairs of flats, and 10 pairs of boots in one day, what was their total revenue for the day?
def solve() -> int: price_sneakers = 64 price_flats = 35 price_boots = 100 num_sneakers = 45 num_flats = 25 num_boots = 10 total_rev = (num_sneakers * price_sneakers) + (num_flats * price_flats) + (num_boots * price_boots) result = total_rev return result
A painter works for 6 hours, alternating between painting walls and floor. He spends 1/3 of his time on painting walls and the rest on the floor. He uses 3 hours for painting the walls. How much longer does he take to paint the floor compared to the walls?
def solve() -> int: hours_spent_painting = 6 hours_spent_walls = 1/3 * hours_spent_painting hours_spent_floor = hours_spent_painting - hours_spent_walls hours_spent_walls_actual = 3 hours_spent_floor_actual = hours_spent_floor difference_hours = hours_spent_floor_actual - hours_spent_walls_actua...
Sophie has sold 500 cupcakes in the first 25 days of her business. She has a goal of selling 1500 cupcakes in the first 60 days. How many cupcakes does she need to sell per day to reach her goal?
def solve() -> int: total_cupcakes = 1500 days = 60 sold_cupcakes = 500 days_passed = 25 remaining_cupcakes = total_cupcakes - sold_cupcakes remaining_days = days - days_passed cupcakes_per_day = remaining_cupcakes / remaining_days result = cupcakes_per_day r...
Four jars P, Q, R and S contain different numbers of differently colored balls. Jar P contains 5 blue balls and 3 red balls. Jar Q contains 7 green balls and 2 red balls. Jar R contains 4 blue balls and 6 yellow balls. Jar S contains 8 green balls and 4 yellow balls. What is the difference between the number of each co...
def solve() -> int: jars = {"P": {"blue": 5, "red": 3}, "Q": {"green": 7, "red": 2}, "R": {"blue": 4, "yellow": 6}, "S": {"green": 8, "yellow": 4}} max_balls = 0 jar_name = "" for jar in jars: for color in jars[jar]: if jars[jar][color] > max_balls: max_balls = jars[jar...
Anna and Ben bought a turtle as a pet. They paid $40 for the turtle, $100 for the terrarium and $20 for the substrate and water dish. They also had to buy turtle food, which cost $8 per month, and calcium supplements, which cost $6 per month. Anna bought $40 worth of plants and rocks for the terrarium. How much did Ann...
def solve() -> int: turtle = 40 terrarium = 100 substrate_and_water_dish = 20 food_per_month = 8 calcium_per_month = 6 plants_and_rocks = 40 food_per_year = food_per_month * 12 calcium_per_year = calcium_per_month * 12 anna_total = turtle + terrarium + substrate_and_water_d...
A recipe uses 2/3 cups of sugar to make 10 cookies. How much sugar is needed to make 30 cookies?
def solve() -> int: sugar_per_cookie = 2/3 cookies_needed = 30 sugar_needed = (sugar_per_cookie * cookies_needed) / 10 result = sugar_needed return result
Possible questions and programs are: Leo wants to buy 3 shirts and 2 pants from a store. Each shirt costs $12 and each pant costs $15. He also has a coupon that gives him a 10% discount on his total purchase. How much does he pay after using the coupon?
def solve() -> int: total_cost = 3 * 12 + 2 * 15 discount = 0.1 * total_cost final_amount = total_cost - discount result = final_amount return result
Tina needs to print some copies of her essay. Each copy costs 3 cents, and she has $9. How many copies of her essay can Tina print?
def solve() -> int: cost_per_copy = 0.03 total_money = 9 max_num_copies = total_money/cost_per_copy result = max_num_copies return result
Six athletes were discussing their personal records based on the distance they covered. They found out that Tom ran 50 meters less than Daniel, who ran 100 meters more than Mark. Meanwhile, Jenna ran twice as much as Tom. If Jenna ran 400 meters, how much did Mark run?
def solve() -> int: jenna = 400 x = jenna / 2 + 50 tom = x - 50 y = x - 100 mark = y result = mark return result
Kim has a yard that is 40 feet by 50 feet. She increases the length by 8 feet and the width by 10 feet. She then constructs 4 more yards of the same size and 1 yard of half that size. What is the total area of all the yards?
def solve() -> int: length = 40 width = 50 new_length = length + 8 new_width = width + 10 yard1_area = new_length * new_width yard2_area = new_length * new_width yard3_area = new_length * new_width yard4_area = new_length * new_width yard5_area = (new_length/2) * (new_width...
You want to buy 4 bags of chips that cost $1.25 each and 2 6-packs of soda that cost $2.50 each. If you also have a coupon for 10% off your entire purchase, what is the total cost of your purchase?
def solve() -> int: chips_cost = 1.25 soda_cost = 2.50 num_bags_of_chips = 4 num_6packs_of_soda = 2 total_cost = (chips_cost * num_bags_of_chips) + (soda_cost * num_6packs_of_soda) discounted_cost = total_cost * 0.9 result = discounted_cost return result
James borrowed 35 action figures and 10 stuffed animals from the toy store. He returned 15 action figures. He then gave away half of the stuffed animals to his friends and borrowed 5 more action figures. How many action figures and stuffed animals does James have now?
def solve() -> int: borrowed_action_figures = 35 borrowed_stuffed_animals = 10 returned_action_figures = 15 action_figures_left = borrowed_action_figures - returned_action_figures stuffed_animals_left = borrowed_stuffed_animals / 2 action_figures_now = action_figures_left + 5 stuff...
John bought a pair of shoes for $80. His friend, Alex, wanted the same pair of shoes but it was sold out at the store. He found it online for 50% more than the store price and paid an additional $10 for shipping. How much did Alex pay in total for the shoes?
def solve() -> int: store_price = 80 online_price = store_price * 1.5 shipping_cost = 10 total_price = online_price + shipping_cost result = total_price return result
Amy wants to buy a game console that costs $400. If she saves $5 a day, how long would it take for her to have enough money to buy the game console?
def solve() -> int: cost_of_console = 400 savings_per_day = 5 days_needed = cost_of_console / savings_per_day result = days_needed return result
A science test is scored out of a possible 60 points. If a student can score a B by getting 75% of the total points, what is the smallest number of points a student must earn to get a B?
def solve() -> int: b_min_points = 0.75*60 result = b_min_points return result
Ben collects 5 stamps every week from his friends. He needs 100 stamps to complete his album. How many weeks does it take him to finish his album, if he starts with 20 stamps?
def solve() -> int: stamps_needed = 100 - 20 weeks_needed = stamps_needed / 5 result = weeks_needed return result
A company had a revenue of $150,000 in the first quarter, $180,000 in the second quarter and $200,000 in the third quarter. What was the average quarterly revenue, in dollars, for the company?
def solve() -> int: first_quarter = 150000 second_quarter = 180000 third_quarter = 200000 average_quarterly_revenue = (first_quarter + second_quarter + third_quarter) / 3 result = average_quarterly_revenue return result
Mark started a business with $6000. He made a profit of 25% and then he spent $2175 on a new equipment. How much money does he have remaining?
def solve() -> int: initial_money = 6000 profit = initial_money * 0.25 total_money = initial_money + profit total_money -= 2175 result = total_money return result
From the library, Emily walks 1 mile to the café. From there, she walks 5 miles to the park. From the park, she walks 3 miles straight back to the library. How many additional miles did Emily walk to the park compared to a round trip without the park stop?
def solve() -> int: library_to_cafe = 1 cafe_to_park = 5 park_to_library = 3 round_trip_without_park = 2 * library_to_cafe + 2 * park_to_library emilys_trip_with_park = library_to_cafe + cafe_to_park + park_to_library additional_miles = emilys_trip_with_park - round_trip...
Alexandra drove 120 miles to visit a friend and used 6 gallons of gas. How many miles per gallon did Alexandra get during the trip?
def solve() -> int: distance = 120 gas = 6 mpg = distance / gas result = mpg return result
Student: If a bookstore can purchase 10 books from the publisher for $11.25 each and can sell them to customers for $16.00 each, how much profit does the bookstore make when buy 30 books and sell them all?
def solve() -> int: cost_per_book = 11.25 sell_price_per_book = 16.00 num_books_purchased = 30 total_cost = cost_per_book * num_books_purchased total_sell_price = sell_price_per_book * num_books_purchased profit = total_sell_price - total_cost result = profit return result
A pool of 500 candidates appeared for a competitive exam. To qualify for interview, candidates need to secure 70% marks. If the average of all candidates is 65% and the average of those who qualified is 85%, how many candidates qualified for the interview?
def solve() -> int: total_candidates = 500 passing_marks = 70 average_marks = 65 qualified_marks = 85 qualified_candidates = (qualified_marks - average_marks) * total_candidates / (passing_marks - average_marks) result = qualified_candidates return result
Tyler is 6'2". He shrinks 4 inches. What is his new height in inches? If Aiden is currently half the age of his brother Liam, who is 24, how long until Aiden reaches the minimum age of joining the military, which is 18 in their state?
def solve() -> int: tyler_height = 6*12 + 2 shrink_height = 4 new_height = tyler_height - shrink_height aiden_age = 24 / 2 minimum_age = 18 time_until_minimum_age = minimum_age - aiden_age result = new_height, time_until_minimum_age return result
A train travels 75 miles per hour. If it travels for 3 hours and 45 minutes, how far has it traveled?
def solve() -> int: speed = 75 time_in_hours = 3 + 45/60 distance_traveled = speed * time_in_hours result = distance_traveled return result
A store sells strawberries for $2 per basket. If Sophia bought 15 baskets but gave away 2/5 of them, how much money did she make from selling the remaining baskets?
def solve() -> int: baskets_bought = 15 given_away = 2/5 * baskets_bought baskets_remaining = baskets_bought - given_away money_made = baskets_remaining * 2 result = money_made return result
A pack of pencil crayons contains 24 colors. If Nick took 3 pencils out and then his friend returned 5 more colors, how many colors does Nick have now?
def solve() -> int: colors = 24 colors -= 3 colors += 5 result = colors return result
If Amanda buys 5 shirts for $15 each, and then returns 2 of them, how much did she spend in total?
def solve() -> int: shirt_price = 15 num_shirts_bought = 5 num_shirts_returned = 2 total_spent = (num_shirts_bought - num_shirts_returned) * shirt_price result = total_spent return result
A store sells apples for $0.75 each and bananas for $1.50 each. If Emily bought 2 apples and 3 bananas, what was her total cost?
def solve() -> int: apple_price = 0.75 banana_price = 1.5 num_apples = 2 num_bananas = 3 total_cost = apple_price*num_apples + banana_price*num_bananas result = total_cost return result
John has collected 28 leaves. He puts them into 7 different vases, each vase has the same number of leaves. How many leaves does each vase have?
def solve() -> int: leaves_per_vase = 0 total_leaves = 28 leaves_per_vase = total_leaves / 7 result = leaves_per_vase return result
A catering company has 12 employees. Each employee worked 5 hours on Monday, 7 hours on Tuesday, 3 hours on Wednesday, and 8 hours on Thursday. On Friday, 3 employees didn't come to work and the others worked for 6 hours. How many hours did the catering company pay for in total that week?
def solve() -> int: a = (12*5) + (12*7) + (12*3) + (9*8) result = a + (6*9) return result
Student: Carol drives a car that consumes 1 gallon of gas for every 25 miles. She has a full tank of 15 gallons when she starts her trip. She drives 80 miles and then refills her tank. How many gallons of gas does she buy at the gas station?
def solve() -> int: start_tank = 15 distance = 80 consumption = 1/25 gas_consumed = distance * consumption gas_left = start_tank - gas_consumed gas_bought = start_tank - gas_left result = gas_bought return result
``` If a rectangle has a length of 10 meters and a width of 6 meters, what is its perimeter in centimeters?
def solve() -> int: length = 10 width = 6 perimeter = (length + width) * 2 perimeter_in_cm = perimeter * 100 result = perimeter_in_cm return result
Possible questions and programs: Levi is painting wooden cubes for his art project. He needs 6 cubes of each color: red, blue, and yellow. He has 12 red cubes, 9 blue cubes, and 15 yellow cubes. How many more cubes does he need to paint?
def solve() -> int: total_cubes = 6 * 3 painted_cubes = 12 + 9 + 15 more_cubes = total_cubes - painted_cubes result = more_cubes return result
Ethan is a software developer who codes various projects. Recently, he coded a project and charged $500 less than eight times the amount he charged for his previous project. If he charged $10,500 on his recent project, how much did he charge for his previous project?
def solve() -> int: previous_project_charge = (10500 + 500) / 8 result = previous_project_charge return result
The school cafeteria needs 800 packs of juice for 200 students. If there are 20% more students than expected, how many packs of juice would be needed?
def solve() -> int: students = 200 expected_students = students juice_per_student = 800 / students students = expected_students * 1.2 packs_of_juice = students * juice_per_student result = packs_of_juice return result
Emma makes 30 bracelets. She sells 12 bracelets for 5 dollars each and 8 bracelets for 3 dollars each. How much money does she make from selling bracelets?
def solve() -> int: money_12 = 12 * 5 money_8 = 8 * 3 money_total = money_12 + money_8 result = money_total return result
Laura went to the grocery store and bought 3 bags of apples for $5 each, and 2 cartons of strawberries for $4 each. If she paid a total of $21, how much did she have left?
def solve() -> int: apples_cost = 5*3 strawberries_cost = 2*4 total_cost = apples_cost + strawberries_cost amount_paid = 21 amount_left = amount_paid - total_cost result = amount_left return result
am wants to save $3,000 for a trip to Europe. If he saves $50 each week, how many weeks will it take him to reach his goal?
def solve() -> int: trip_cost = 3000 weekly_savings = 50 weeks_to_save = trip_cost / weekly_savings result = weeks_to_save return result
Student: Connor has 36 books in his bookshelf, of which 12 are fiction and 18 are non-fiction. How many books are neither fiction nor non-fiction?
def solve() -> int: fiction = 12 non_fiction = 18 total_books = 36 neither_fiction_nor_non_fiction = total_books - (fiction + non_fiction) result = neither_fiction_nor_non_fiction return result
Rob has 10 red jellybeans and 20 blue jellybeans. What is the ratio of red jellybeans to blue jellybeans?
def solve() -> int: jellybean_ratio = 10 / 20 result = jellybean_ratio return result
A car travels at an average speed of 60 km/h for the first 4 hours of the trip. If the car travels at an average speed of 90 km/h for the remaining 3 hours, what was the average speed for the whole trip?
def solve() -> int: distance1 = 4 * 60 distance2 = 3 * 90 total_distance = distance1 + distance2 total_time = 4 + 3 average_speed = total_distance / total_time result = average_speed return result
A farmer has 20 chickens and 15 cows. Each chicken lays 6 eggs per week and each cow produces 20 liters of milk per week. How many eggs and liters of milk does the farmer get per week?
def solve() -> int: chickens = 20 cows = 15 eggs_per_chicken = 6 milk_per_cow = 20 eggs = chickens * eggs_per_chicken milk = cows * milk_per_cow result = (eggs, milk) return result
Chris has $200 to buy food. He spent $100 on groceries and $30 on eating out. How much money does he have left?
def solve() -> int: total_money = 200 grocery_cost = 100 eating_out_cost = 30 total_spent = grocery_cost + eating_out_cost money_left = total_money - total_spent result = money_left return result
am spends $80 per day for 10 days. If she brings $400 with her, how much money does she have left at the end of her vacation?
def solve() -> int: sam_init_money = 400 daily_spending = 80 no_of_days = 10 result = sam_init_money - daily_spending * no_of_days print ("Sam has $" + str(result) + " left at the end of the vacation") return result
Student: A man deposited $8000 in a bank account that earns 4% simple interest per year. How much interest will be earned after 3 years?
def solve() -> int: principal = 8000 rate = 0.04 time = 3 interest = principal * rate * time total = principal + interest result = interest return result