question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Tom has 2 trucks full of cargo. The first truck can hold 20 boxes at a maximum weight of 200 pounds and the second truck can hold 12 boxes with a maximum weight of 160 pounds. Each box weighs an equal amount and that amount is determined by how much can fit in the trucks. How much will each box weigh?
def solve() -> int: weight_1 = 200 // 20 weight_2 = 160 // 12 result = (weight_1 + weight_2) / 2 return result
-The numbers in the questions should be changed, and **should be integers (no decimals)**. Try to avoid using numbers that are too big or too small, or that would result in fractions or negative numbers in the solution. -You can use any meaningful names for the variables in the program, but try to avoid using names tha...
def solve() -> int: groups = 320 // 8 teachers = groups result = teachers return result
In a class, 30% of the students are girls and the rest are boys. If there are 40 boys in the class, how many students are there in total?
def solve() -> int: boys = 40 girls = boys / 0.7 - boys total_students = boys + girls result = total_students return result
A 500 cm long rope is cut into 100 pieces. 95 of the pieces are of equal size and the remaining pieces are 25mm each. Find the length of each of the equal pieces in millimeters.
def solve() -> int: rope_length_cm = 500 num_pieces = 100 length_of_remaining_pieces_mm = 25 length_of_equal_pieces_cm = (rope_length_cm - (length_of_remaining_pieces_mm * (num_pieces - 95))) / 95 length_of_equal_pieces_mm = length_of_equal_pieces_cm * 10 result = length_of_equal_piece...
A bike travels a distance of 50 km in 2 hours. At what speed did it travel?
def solve() -> int: distance = 50 time = 2 speed = distance/time result = speed return result
Sarah agreed to be paid ten cents for every piece of trash she picked up at the park. She picked up twenty-five pieces of trash on the playground, thirty-six in the picnic area, and forty-two near the pond. After picking up half of the trash, she spent 80 cents on a bottle of water. How many cents did Sarah have left?
def solve() -> int: trash_playground = 25 trash_picnic = 36 trash_pond = 42 total_trash = trash_playground + trash_picnic + trash_pond payment_per_trash = 10 total_payment = total_trash * payment_per_trash half_trash = total_trash / 2 remaining_trash = half_trash ...
Possible questions and programs: Diana shoots arrows at the moon every night. She has a quiver that can hold 20 arrows, but every time she shoots an arrow, it loses 10% of its length. She can only reuse an arrow if it is more than half of its original length. She buys new arrows from Hermes, who charges one silver coin...
def solve() -> int: arrows = 0 length = 1 capacity = 20 price = 1 cost = 0 for month in range(1,13): if month > 4: price = 2 for night in range(1,31): if arrows == 0: arrows = capacity cost += price * arrows arrows -= 1 length...
Yasin and Ayo are selling different types of hats. Yasin sells 10 beanies and 12 baseball caps, and Ayo sells 12 beanies and 14 baseball caps. If a beanie costs $10 and a baseball cap costs $15, how much money do Yasin and Ayo together make?
def solve() -> int: price_beanie = 10 price_cap = 15 num_beanies_Yasin = 10 num_caps_Yasin = 12 num_beanies_Ayo = 12 num_caps_Ayo = 14 amt_Yasin = (price_beanie * num_beanies_Yasin) + (price_cap * num_caps_Yasin) amt_Ayo = (price_beanie * num_beanies_Ayo) + (price_cap * nu...
Ryan earned 60 dollars in a week. He earned 10 dollars more than Lucy every day. How many dollars did Lucy earn in 4 weeks?
def solve() -> int: ryan_daily = 60 / 7 lucy_daily = ryan_daily - 10 lucy_weekly = lucy_daily * 7 lucy_total = lucy_weekly * 4 result = lucy_total return result
A bag of apples contains 6 red apples, 3 green apples, and 2 yellow apples. If someone selects an apple at random, what is the probability that it is not red?
def solve() -> int: num_not_red = 3 + 2 total_apples = 11 prob_not_red = num_not_red / total_apples result = prob_not_red return result
A pizza place has 128 pizzas in stock. If the first day the place sells 16 pizzas, the second day the place sells 12 pizzas, and then 8 pizzas every day from then on. How many days will it take the pizza place to sell all the pizzas in stock?
def solve() -> int: stock = 128 first_day_sales = 16 second_day_sales = 12 daily_sales = 8 remaining_stock = stock - first_day_sales - second_day_sales days = remaining_stock // daily_sales result = days return result
Chloe bought a pack of marker pens at $2.50 each. She bought seven of them. How much money did she spend in total?
def solve() -> int: price = 2.5 qty = 7 total_cost = price * qty result = total_cost return result
During a sale, a shirt that originally cost 30 dollars was discounted by 20 percent. What was its sale price?
def solve() -> int: original_price = 30 discount = 0.20 sale_price = original_price - (original_price * discount) result = sale_price return result
Student: Olivia baked 60 cupcakes. She sold 1/6 of them and gave away 2/5 of the rest. How many cupcakes did she keep for herself?
def solve() -> int: total_cupcakes = 60 sold_cupcakes = total_cupcakes / 6 remaining_cupcakes = total_cupcakes - sold_cupcakes given_cupcakes = remaining_cupcakes * 2 / 5 kept_cupcakes = remaining_cupcakes - given_cupcakes result = kept_cupcakes return result
Haley wants to buy 3 shirts that cost $15 each. The store has a sale for 20% off if you buy 3 or more shirts. What is the final cost of the shirts if Haley buys them during the sale?
def solve() -> int: shirt_price = 15 num_shirts = 3 subtotal = shirt_price * num_shirts discount = 0.20 * subtotal total_cost = subtotal - discount result = total_cost return result
There are three numbers with a sum of 48. The first number is five more than the second. The third number is 12 less than the second. What are the three numbers?
def solve() -> int: second = (48 - 5 - 12) / 3 first = second + 5 third = second - 12 result = (first, second, third) return result
A store offers a "Buy one, get one free" offer on all items. A customer buys 4 items for $10 each. What will be the total cost of the items after the discount?
def solve() -> int: num_items = 4 cost_per_item = 10 total_cost = num_items * cost_per_item num_discounted_items = num_items // 2 total_cost_after_discount = num_discounted_items * cost_per_item result = total_cost_after_discount return result
David bought a car for $18,000. He made a down payment of 10% and took a loan for the rest. He pays $360 each month for 48 months to repay the loan with an interest rate of 8% per year. How much interest does he pay in total?
def solve() -> int: loan = 18000 * (1 - 0.1) monthly_interest = 0.08 / 12 monthly_payment = loan * (monthly_interest * (1 + monthly_interest) ** 48) / ((1 + monthly_interest) ** 48 - 1) total_payment = monthly_payment * 48 interest = total_payment - loan result = interest return result
If a car travels at a speed of 50 miles per hour for 6 hours, how far will it travel?
def solve() -> int: speed = 50 time = 6 distance = speed * time result = distance return result
There were 125 students in a school. On a field trip, 57% of the students went. Then, 20 more students joined the trip. How many students are on the field trip now?
def solve() -> int: start_students = 125 went_students = int(start_students * 0.57) joined_students = 20 result = went_students + joined_students return result
A pizza parlor sells a large pizza for $15 and a small pizza for $10. If they sold 20 large pizzas and 35 small pizzas, what was their total revenue?
def solve() -> int: revenue_large = 15 * 20 revenue_small = 10 * 35 total_revenue = revenue_large + revenue_small result = total_revenue return result
Andy and Ben are collecting stamps. Andy has 75 stamps and Ben has 45 stamps. Every week, Andy buys 8 stamps and Ben buys 6 stamps. After how many weeks will they have the same number of stamps?
def solve() -> int: andy = 75 ben = 45 andy_per_week = 8 ben_per_week = 6 result = (andy - ben) // (ben_per_week - andy_per_week) return result
Dana is baking some cookies for a party. She has a recipe that makes 24 cookies with 2 cups of flour, 1 cup of sugar and 0.5 cup of butter. She wants to make 60 cookies for the party. How much of each ingredient does she need?
def solve() -> int: flour_24 = 2 sugar_24 = 1 butter_24 = 0.5 cookies = 60 scale = cookies / 24 flour_60 = flour_24 * scale sugar_60 = sugar_24 * scale butter_60 = butter_24 * scale result = (flour_60, sugar_60, butter_60) return result
Student: Kate planted 16 tulips and 24 roses in her garden. She then gave away a quarter of her tulips and a sixth of her roses to her neighbor. How many flowers did she have left in her garden?
def solve() -> int: tulips = 16 roses = 24 tulips_given = tulips / 4 roses_given = roses / 6 tulips_left = tulips - tulips_given roses_left = roses - roses_given total_flowers_left = tulips_left + roses_left result = total_flowers_left return result
A florist ordered 150 more than five times as many roses as it did lilies at $4 each. If the cost of a lily was $3.5, and the florist ordered 8 bunches, each having 15 lilies, calculate the total amount of money they paid for the flowers.
def solve() -> int: lily_cost = 3.5 lily_bunch = 15 bunches = 8 rose_cost = 4 extra = 150 lilies = lily_bunch * bunches roses = 5 * lilies + extra lily_total = lilies * lily_cost rose_total = roses * rose_cost total = lily_total + rose_total resu...
For every 1 lap that Sarah swims in the pool, she spends an additional 10 seconds drying herself and 20 seconds changing clothes. If she swims for 10 laps, what is the total combined amount of time, in seconds, that she spends drying herself, changing clothes, and swimming?
def solve() -> int: laps = 10 swim_time = laps * 60 dry_time = laps * 10 change_time = laps * 20 total_time = swim_time + dry_time + change_time result = total_time return result
A soccer team won 10 games, which is 4 more than twice the number of games they lost. How many games did they lose?
def solve() -> int: games_won = 10 games_lost = (games_won - 4) / 2 result = games_lost return result
Leo works as a waiter at a restaurant. He earns $12 per hour plus 15% of the total bill as tips. On a Saturday night, he works for 6 hours and serves 20 customers. The average bill per customer is $40. How much money does he make that night?
def solve() -> int: total_bill = 20 * 40 total_tips = total_bill * 0.15 hourly_wage = 12 * 6 total_money = hourly_wage + total_tips result = total_money return result
Ali read 21 pages of a book for 15 minutes each day for 12 days. Zara also read the same book. Together they read the book for 6300 minutes. How many pages did Zara read?
def solve() -> int: ali_pages = 21 ali_minutes = 15 ali_days = 12 total_minutes = 6300 ali_total = ali_pages * ali_minutes * ali_days zara_total = total_minutes - ali_total zara_pages = zara_total / (ali_pages * ali_minutes) result = zara_pages return result
Student: A recipe for 6 cupcakes requires 1/3 cup of flour. How much flour is required to make 30 cupcakes using the same recipe?
def solve() -> int: cupcakes = 30 flour_per_6 = 1/3 flour_per_1 = flour_per_6 / 6 flour_per_30 = flour_per_1 * cupcakes result = flour_per_30 return result
Leo and Mia are twins. Their birthday is on February 29th of a leap year. This year, they celebrated their 5th birthday. In what year were they born?
def solve() -> int: current_year = 2020 times = 5 years_per_time = 4 year_born = current_year - times * years_per_time result = year_born return result
Mike buys 2 slices of pizza from his local pizzeria for $4.75 each. He uses a $20 bill to pay. How much change will he get back?
def solve() -> int: pizza_slice_cost = 4.75 slices_bought = 2 total_cost = pizza_slice_cost * slices_bought change_received = 20 - total_cost result = change_received result return result
Joe and Susan volunteered to pack 500 bags of school supplies. A local store donated 75 more bags. If they have already packed and distributed 312 bags, how many bags are left to distribute?
def solve() -> int: volunteered_bags = 500 donated_bags = 75 packed_bags = 312 total_bags = volunteered_bags + donated_bags left_bags = total_bags - packed_bags result = left_bags return result
Leo makes 25 bracelets using beads and strings. He buys 150 beads for $15 and 10 meters of string for $8. He uses 6 beads and 20 centimeters of string for each bracelet. He sells each bracelet for $3. How much profit did he make?
def solve() -> int: revenue = 25 * 3 unit_cost_beads = 15 / 150 unit_cost_string = 8 / 10 cost = 25 * (6 * unit_cost_beads + 0.2 * unit_cost_string) profit = revenue - cost result = profit return result
Student: Wilfred has 56 peaches and gave 18 away. What percentage of the peaches has Wilfred kept?
def solve() -> int: total_peaches = 56 given_away = 18 kept_peaches = total_peaches - given_away percentage_kept = (kept_peaches / total_peaches) * 100 rounded_percentage = round(percentage_kept, 2) result = rounded_percentage return result
The cost of 2 books is $25. If the cost of one book is $5 more than the other, what is the cost of each book?
def solve() -> int: total_cost = 25 difference = 5 book2_cost = (total_cost - difference)/2 book1_cost = book2_cost + difference result = (book1_cost, book2_cost) return result
A train traveled from Los Angeles to Chicago, a distance of 2019 miles. If the train traveled at an average speed of 60 miles per hour, how long did it take to get to Chicago, in hours?
def solve() -> int: travel_time = 2019 / 60 result = travel_time return result
Lily is a personal trainer and charges $50 per hour. During her training session, she trained 5 different clients and they all paid her an additional $20 each as a bonus. How much money did Lily make in that hour?
def solve() -> int: hourly_rate = 50 bonus_per_client = 20 num_clients = 5 total_bonus = bonus_per_client * num_clients total_earning = hourly_rate + total_bonus result = total_earning return result
Karen is saving money for a trip. She starts with $1000 and saves an additional $500 every month. After 3 months, how much money has she saved?
def solve() -> int: starting_amount = 1000 monthly_savings = 500 months = 3 result = starting_amount + (monthly_savings * months) return result
Student: Ruth can run all-around two arenas in 10 days. If it takes Brian four times as long to run his course, what's the total time it takes both of them to run all around the two arenas?
def solve() -> int: ruth_time = 10 brian_factor = 4 arenas = 2 brian_time = brian_factor * ruth_time total_time = ruth_time + brian_time result = total_time return result
Result: A movie theater has 300 seats. If the theater is full and the revenue from the tickets was $4500, how much was the cost per ticket if the adults paid $15 per ticket and the kids got a discount paying only $8 per ticket?
def solve() -> int: num_seats = 300 adult_ticket = 15 child_ticket = 8 total_revenue = 4500 num_adults = (total_revenue - child_ticket * num_seats) / (adult_ticket - child_ticket) cost_per_ticket = total_revenue / num_seats result = cost_per_ticket return result
Student: Bob has twice as many marbles as Sarah. Sarah has 12 marbles. How many marbles does Bob have?
def solve() -> int: sarah_marbles = 12 bob_marbles = sarah_marbles * 2 result = bob_marbles return result
Possible questions and programs: Lily and her friends want to buy cupcakes for a party. Each cupcake costs $1.50 and comes with a choice of vanilla or chocolate frosting. There is an extra charge of $0.25 for sprinkles or $0.50 for a cherry on top. If Lily buys 12 cupcakes, 6 with vanilla frosting and 6 with chocolate ...
def solve() -> int: cupcake_price = 1.50 sprinkles_price = 0.25 cherry_price = 0.50 vanilla_cost = 6 * cupcake_price + 2 * sprinkles_price + 1 * cherry_price chocolate_cost = 6 * cupcake_price + 2 * sprinkles_price + 2 * cherry_price total_cost = vanilla_cost + chocolate_cost result = total_...
Meenakshi bought 64 packs of cookies. Each pack has 8 cookies. How many cookies does Meenakshi have?
def solve() -> int: num_of_packs = 64 cookies_in_each_pack = 8 total_cookies = num_of_packs * cookies_in_each_pack result = total_cookies return result
Possible new questions and programs: Ariana is making cupcakes for a bake sale. She has enough ingredients to make 36 cupcakes, but she only has 24 paper liners. She already made 15 cupcakes and put them in the liners. How many more cupcakes can she make with the remaining liners?
def solve() -> int: total_cupcakes = 36 cupcakes_made = 15 cupcakes_needed = total_cupcakes - cupcakes_made total_liners = 24 liners_used = 15 liners_left = total_liners - liners_used more_cupcakes = min(cupcakes_needed, liners_left) result = more_cupcakes return result
Nancy found 7 quarters, 5 dimes, and 2 nickels. How much money did she find in dollars?
def solve() -> int: pennies = 0 quarters = 7 dimes = 5 nickels = 2 dollars = quarters * 0.25 + dimes * 0.10 + nickels * 0.05 + pennies * 0.01 answer = round(dollars,2) result = answer return result
A restaurant has a total of 180 seats. If a section has 30 seats, how many sections are there in the restaurant?
def solve() -> int: num_of_seats = 180 seats_per_section = 30 result = num_of_seats // seats_per_section return result
Emily wants to sew a pillow for her sister. She needs half a yard of fabric, a zipper, and some stuffing. She already has a zipper and some stuffing at home. She goes to the fabric store and chooses a fabric that costs $12 per yard. She also buys a spool of thread that costs $3. She uses the entire spool of thread to s...
def solve() -> int: fabric_bought = 0.5 fabric_cost = fabric_bought * 12 thread_cost = 3 total_cost = fabric_cost + thread_cost length = 15 width = 10 area = length * width cost_per_square_inch = total_cost / area result = cost_per_square_inch return result
Sarah wants to increase her daily fruit intake by 30% in the next two weeks. She currently eats 2 pieces of fruit per day. How many more pieces of fruit should she eat per day to reach her goal?
def solve() -> int: current_fruit_intake = 2 increase_percentage = 30 days = 14 increase_amount = current_fruit_intake * increase_percentage / 100 total_increase = increase_amount * days result = total_increase return result
Bob drives a car that consumes 8 liters of gas per 100 km. He fills up his tank with 40 liters of gas and drives for 3 hours at an average speed of 60 km/h. How much gas does he have left in his tank in liters?
def solve() -> int: distance = 60 * 3 consumption = distance / 100 * 8 remaining = 40 - consumption result = remaining return result
Julia had 100 notebooks on Thursday and 75 notebooks on Sunday. If each notebook has 50 pages, and she used 600 pages in total, how many notebooks are left for Julia?
def solve() -> int: notebooks_on_thursday = 100 notebooks_on_sunday = 75 pages_per_notebook = 50 total_pages_used = 600 total_notebooks = notebooks_on_thursday + notebooks_on_sunday total_pages = total_notebooks * pages_per_notebook pages_left = total_pages - total_pages_used n...
A phone company offers a data plan for $40 a month with an additional cost of $. 10 per MB. If John used 500 MB of data in a month, what was his bill?
def solve() -> int: plan_cost = 40 data_used = 500 additional_cost = data_used * 0.1 total_cost = plan_cost + additional_cost result = total_cost return result
In a hotel, the chef prepared 800 dishes for dinner. One-fifth of the dishes were served during the first hour, and another one-sixth were served before midnight. How many dishes were served after midnight?
def solve() -> int: dishes_prepared = 800 dishes_served_first_hour = dishes_prepared / 5 dishes_served_before_midnight = dishes_prepared / 6 dishes_served_after_midnight = dishes_prepared - dishes_served_first_hour - dishes_served_before_midnight result = dishes_served_after_midnight return...
Jessica buys 5 shirts that each cost $10. How much did she spend in total? In a science fair, three students won a total of 330 points. The first student got one-fourth of the points the second student achieved, and the third student scored 30 points less than the sum of the first two students. How many points did the ...
def solve() -> int: shirt_cost = 10 num_shirts = 5 total_cost = shirt_cost * num_shirts total_points = 330 second_student_points = total_points / (1 + 1/4 + 1) first_student_points = second_student_points / 4 third_student_points = first_student_points + second_student_points ...
Lily sells lemonade at a stand for $0.50 per cup. She spends $2.00 on lemons, $1.50 on sugar, and $0.75 on cups. She sells 30 cups of lemonade in one day. How much profit does she make?
def solve() -> int: price_per_cup = 0.50 cost_of_lemons = 2.00 cost_of_sugar = 1.50 cost_of_cups = 0.75 cups_sold = 30 total_revenue = price_per_cup * cups_sold total_cost = cost_of_lemons + cost_of_sugar + cost_of_cups profit = total_revenue - total_cost result =...
Student: The library has a collection of 296 books. How many books does it have if 32 more books are added?
def solve() -> int: num_books = 296 num_books += 32 result = num_books return result
Dan is buying tiles for his bathroom, which is a rectangle with a length of 8 feet and a width of 6 feet. He needs to buy one tile for every 4 inches by 4 inches of floor. If one tile costs $0.75, how much does Dan spend on tiles?
def solve() -> int: area = 8 * 12 * 6 * 12 tiles = area / (4 * 4) cost = tiles * 0.75 result = cost return result
A store manager is paid $20 per hour for a 50-hour workweek. She pays 1/4 of her money on rent, $400 on food, and $1500 on taxes per month. Calculate the total amount of money the store manager has after paying her monthly expenses.
def solve() -> int: hrs_worked = 50 rate = 20 weekly_pay = hrs_worked * rate monthly_pay = weekly_pay * 4 rent = monthly_pay * 0.25 food = 400 taxes = 1500 total_expenses = rent + food + taxes total_money = monthly_pay - total_expenses result = total_money return result
In a mall, there are 120 stores. 60% of them sell shoes, and 20% of the shoe stores sell both sneakers and sandals. 6 stores sell only sneakers and 10 stores sell only sandals. How many stores sell both sneakers and sandals and shoes?
def solve() -> int: shoe_stores = 120 * 0.6 sneakers_and_sandals = shoe_stores * 0.2 sneakers_only = 6 sandals_only = 10 shoes_only = shoe_stores - (sneakers_and_sandals + sneakers_only + sandals_only) both_sneakers_sandals_shoes = sneakers_and_sandals - (shoes_only) result = round(both_snea...
Question6: You have an oak tree in your backyard that is 17 feet tall and it grows 7 inches per year for 8 years. What is the height of the oak tree in inches at the end of 8 years?
def solve() -> int: height = 17 growth = 7 time = 8 total_growth = growth * 12 * time total_height = height * 12 + total_growth result = total_height return result
A shopkeeper gives a discount of 10% on the marked price of an item. If the marked price of a TV is $500, then what is the selling price?
def solve() -> int: marked_price = 500 discount = 0.1 selling_price = marked_price * (1 - discount) result = selling_price return result
-You can use any variable names as long as they are different from each other within the same question. Possible new questions are: Leila has 24 stickers and Ali has 15 stickers. They both want to share their stickers equally with their two other friends, Sara and Omar. How many stickers will each person have after sha...
def solve() -> int: leila_share = 24 // 4 ali_share = 15 // 4 leila_final = leila_share + 6 ali_final = ali_share + 3 sara_final = leila_share + ali_share omar_final = sara_final result = leila_final return result
If a box can hold 50 apples and each apple has a diameter of 3 inches, what is the minimum diameter the box needs to fit all the apples?
def solve() -> int: apple_diameter = 3 box_capacity = 50 minimum_box_diameter = apple_diameter + (2*(box_capacity**(1/3))) result = minimum_box_diameter return result
Craig has a stock of 500 apples. If he sells 40% of them, how many apples does he have left?
def solve() -> int: initial_stock = 500 percentage_sold = 0.4 apples_sold = initial_stock * percentage_sold apples_left = initial_stock - apples_sold result = apples_left return result
If Anna buys 3 potatoes each weighing 2.5 pounds, calculate her total purchase in kilograms.
def solve() -> int: total_purchase_in_pounds = 7.5 total_purchase_in_kilograms = total_purchase_in_pounds * 0.45359237 result = total_purchase_in_kilograms return result
Jack has a rectangular garden that measures 12 meters by 8 meters. He wants to plant some flowers along the perimeter of the garden. He has enough seeds to plant one flower every 0.5 meters. How many flowers can he plant in total?
def solve() -> int: length = 12 width = 8 seed_distance = 0.5 perimeter = 2 * (length + width) flowers = perimeter / seed_distance result = flowers return result
The area of a square is 81 square meters. What is the perimeter of the square?
def solve() -> int: square_area = 81 side_length = (square_area)**(1/2) square_perimeter = 4 * side_length result = square_perimeter return result
Alex and Rachel have ten snakes, each with the same birthday. They bought their first snake exactly 11 years ago. They bought their second snake exactly 18 months after buying their first snake. They bought their third snake on the second birthday of their second snake. One year after buying their third snake, they bou...
def solve() -> int: snakes = 10 first_snake_age = 11 second_snake_age = first_snake_age + 1.5 third_snake_age = second_snake_age + 2 fourth_snake_age = third_snake_age + 1 total_weekdays = 5 * 4 total_weekend_days = 2 * 4 total_weekend_sessions = total_weekend_days * 6 total_wee...
If five exercise sessions cost 5 times as much as one exercise outfit, and each exercise outfit is sold at $40, calculate the total amount of money Joey will pay if he buys five exercise sessions and ten exercise outfits.
def solve() -> int: exercise_outfit_cost = 40 exercise_session_cost = exercise_outfit_cost * 5 total_cost = (exercise_session_cost * 5) + (exercise_outfit_cost * 10) result = total_cost return result
Ted bought 18 books. Each book cost $7.15. How much money did Ted spend?
def solve() -> int: num_books = 18 book_cost = 7.15 total_cost = num_books * book_cost result = total_cost return result
Student: Justin received an 82 on his first assignment. After submitting his second assignment, his average rose to an 88. What grade did he get on his second assignment?
def solve() -> int: first_assignment = 82 average = 88 second_assignment = (average * 2) - first_assignment result = second_assignment return result
At a restaurant, the entree portion and the side portion of a meal are each $6. If James ordered two entrees and two sides, how much will it cost before taxes?
def solve() -> int: entree_cost = 6 side_cost = 6 num_entrees = 2 num_sides = 2 total_cost = (entree_cost * num_entrees) + (side_cost * num_sides) result = total_cost return result
The perimeter of a rectangle is 30 cm and its length is 9 cm. What is the width of the rectangle?
def solve() -> int: perimeter = 30 length = 9 width = (perimeter - (2*length))/2 result = width return result
Student: Kelly had 42 dolls. She sold 1/7 of her dolls at a garage sale. Then she received 18 more dolls as a Christmas gift. How many dolls does Kelly have now?
def solve() -> int: dolls_original = 42 dolls_sold = dolls_original * 1/7 dolls_gift = 18 dolls_now = dolls_original - dolls_sold + dolls_gift result = dolls_now return result
A company's expenses for a month were $10,000. However, the company earned 20% more than that in revenue. What was the revenue for the month?
def solve() -> int: expenses = 10000 revenue_percent = 1.20 revenue = expenses * revenue_percent result = revenue return result
``` If Ms. Estrella is aiming for a profit margin of 30%, how much would be the operational costs and taxes together?
def solve() -> int: revenue = 400000 profit_margin = 0.3 remaining_amount = revenue * (1 - profit_margin) operational_and_taxes = remaining_amount / (1 + 0.15 + 0.05) result = operational_and_taxes return result
Student: Ryan is the head of the baking club, and he bought 140 cookies. Twenty-five were chocolate chip cookies. There were fifteen more oatmeal cookies than the chocolate chip cookies. One-fifth the number of chocolate chip cookies were peanut butter cookies. There were ten more sugar cookies than the chocolate chip ...
def solve() -> int: cookies_total = 140 chocolate_chip = 25 oatmeal = chocolate_chip + 15 peanut_butter = chocolate_chip // 5 sugar = chocolate_chip + 10 snickerdoodles = cookies_total - (chocolate_chip + oatmeal + peanut_butter + sugar) result = snickerdoodles return result
Q8: Stephanie received 15 pieces of candy. She gave half of them away to her friends. How many pieces of candy did Stephanie keep?
def solve() -> int: pieces_kept = 15 / 2 result = pieces_kept return result
Ethan is going on a bike ride for his birthday. He rides for 16 miles and can bike at a speed of 8 miles per hour. How long will Ethan be riding for?
def solve() -> int: miles = 16 speed_mph = 8 time_hr = miles/speed_mph result = time_hr return result
Jane has 50 marbles and she gave 10% to her little sister. How many marbles does she have left?
def solve() -> int: marbles_giveaway = 0.1 remaining_marbles = 50 * (1 - marbles_giveaway) result = remaining_marbles return result
Amy is preparing a party for 30 people. If each person is expected to eat 2 hotdogs and 3 hamburgers, how many hotdogs and hamburgers should she purchase?
def solve() -> int: num_people = 30 hotdogs_per_person = 2 hamburgers_per_person = 3 total_hotdogs = num_people * hotdogs_per_person total_hamburgers = num_people * hamburgers_per_person result = (total_hotdogs, total_hamburgers) return result
Student: A grocery store has a 10% discount on all items for senior citizens. If a senior citizen buys $60 worth of groceries, how much do they pay after the discount?
def solve() -> int: price = 60 discount = 0.1 discounted_price = price * (1 - discount) result = discounted_price return result
Student: Daniel is planning a trip to the zoo. He buys a ticket for $12, and spends $8 on food and drinks. He also wants to buy a souvenir for $10 and a map for $2, but he only has $5 left. How much money, in dollars, did he have at first?
def solve() -> int: ticket_price = 12 food_price = 8 souvenir_price = 10 map_price = 2 remaining_money = 5 total_money = ticket_price + food_price + souvenir_price + map_price + remaining_money result = total_money return result
Ted is half as old as Ruby. In three years, Ted will be one and a quarter times as old as Ruby. How old is Ted now?
def solve() -> int: ted_age = 0 ruby_age = 0 ted_age_in_three_years = 0 ruby_age = 8 ted_age_in_three_years = ruby_age + (3 * 2) ted_age = ted_age_in_three_years - 4 result = ted_age return result
In a shelf, there are some books. If you take away 4 books, the remaining amount will be half of what it would be if 12 books were added. How many books are in the shelf?
def solve() -> int: books_in_shelf = 0 remaining_books = books_in_shelf - 4 added_books = books_in_shelf + 12 remaining_books = added_books / 2 books_in_shelf = remaining_books + 4 result = books_in_shelf return result
A cocktail recipe needs 2 oz of vodka and 1 oz of orange juice to be mixed together. If you want to make a pitcher with 24 oz of vodka, how many oz of orange juice do you need?
def solve() -> int: oz_of_orange_juice_per_oz_of_vodka = 1 / 2 total_oz_of_orange_juice = oz_of_orange_juice_per_oz_of_vodka * 24 result = total_oz_of_orange_juice return result
A recipe for a cake requires 3 cups of flour, 2 cups of sugar, 4 eggs and 1 cup of milk. How many cups of flour are needed to make 6 cakes?
def solve() -> int: flour_to_cake = 3 / 1 flour_needed = flour_to_cake * 6 result = flour_needed return result
There are 10 times as many green apples as red apples in a basket. If there are 15 red apples, how many green apples are there in the basket?
def solve() -> int: number_of_green_apples = 0 number_of_red_apples = 0 number_of_red_apples = 15 number_of_green_apples = number_of_red_apples * 10 result = number_of_green_apples return result
Ben and his friend are at a theme park. A crate can hold 50 apples. At the beginning of the apple season, the crate is 4/5 filled with apples. On the first day of the season, the crate received 10 apples. On the second day, 6 more apples were received than on the first day. On the third day, the crate was already fille...
def solve() -> int: crate_capacity = 50 initial_fill = crate_capacity * 4/5 apples_received_first_day = 10 apples_received_second_day = apples_received_first_day + 6 apples_received_third_day = crate_capacity - (initial_fill + apples_received_first_day + apples_received_second_day) result =...
Student: Nellie, Neal, and Nate are each buying shoes for a party. Nellie bought 4 more shoes than Nate, and Neal bought 6 times as many shoes as Nate. If Nate bought 12 shoes, how many shoes did they all buy together?
def solve() -> int: nate_shoes = 12 nellie_shoes = nate_shoes + 4 neal_shoes = nate_shoes * 6 total_shoes = nate_shoes + nellie_shoes + neal_shoes result = total_shoes return result
Jacob bought a house for $400k. He paid a $100k deposit on the house, and pays the rest using a mortgage that is spread out over 20 years. Jacob makes equal payments every month and at the end of the 20 years, the entire balance will be paid off. How much, in thousands of dollars, does Jacob pay each month?
def solve() -> int: house_price = 400 deposit = 100 mortgage = house_price - deposit years = 20 months = years * 12 monthly_payment = mortgage / months result = monthly_payment return result
10 apples cost $20. If each apple would be sold separately, how much would 5 apples cost?
def solve() -> int: price_per_apple = 20/10 num_apples_required = 5 cost = price_per_apple * num_apples_required result = cost return result
A school is organizing a trip to the zoo. There are 30 students and 5 teachers who will go. The price of each student ticket is $10, and each teacher ticket costs double the student ticket price. What is the total ticket cost?
def solve() -> int: students = 30 teachers = 5 student_ticket_price = 10 teacher_ticket_price = student_ticket_price * 2 total_student_cost = students * student_ticket_price total_teacher_cost = teachers * teacher_ticket_price total_ticket_cost = total_student_cost + total_teacher_...
Student: If a printer can print up to 20 pages per minute in black and white, or 10 pages per minute in color, how many minutes would it take to print a 120-page document that has 40 pages in color and 80 pages in black and white?
def solve() -> int: pages_per_minute_bw = 20 pages_per_minute_color = 10 total_pages = 120 color_pages = 40 bw_pages = 80 time_color = color_pages / pages_per_minute_color time_bw = bw_pages / pages_per_minute_bw time_total = time_color + time_bw result = time_total retu...
Student: A computer repair shop charges $60 for a diagnostic test and $80 per hour for labor. A customer's bill comes out to be $380, including tax. If the repair took 2.5 hours, what was the tax amount?
def solve() -> int: diagnostic_test = 60 labor_per_hour = 80 total_bill = 380 hours = 2.5 subtotal = diagnostic_test + (labor_per_hour * hours) tax_amount = total_bill - subtotal result = tax_amount return result
A restaurant serves 500 meals on its first day. Each day, the number of meals served increases by 5%. How many meals will be served on the sixth day rounded to the nearest meal?
def solve() -> int: meals = 500 for day in range(1, 6): meals *= 1.05 result = round(meals) return result
Peter is designing a new garden in his backyard. If he has a rectangular area that is 12 feet long and 8 feet wide, how many square feet does he have to work with?
def solve() -> int: width = 8 length = 12 square_feet = width * length result = square_feet return result
A movie ticket costs $12. If a group of 5 friends goes to the movies, how much do they have to pay in total after the theater charges a 15% service fee?
def solve() -> int: tickets_needed = 5 ticket_cost = 12 service_fee = 0.15 total_cost = (tickets_needed * ticket_cost) + ((tickets_needed * ticket_cost) * service_fee) result = f'<<<{total_cost}>>>' result = total_cost return result
A rectangular garden is 15 meters wide and 20 meters long. If John wants to fence the garden with wire that costs $5 per meter, how much will it cost him to buy the wire?
def solve() -> int: garden_width = 15 garden_length = 20 wire_cost = 5 perimeter = 2 * (garden_width + garden_length) total_cost = perimeter * wire_cost result = total_cost return result
Thomas has a bag of only marbles - 100 red marbles, 80 blue marbles and 180 green marbles. What proportion of the marbles in the bag are red?
def solve() -> int: num_red = 100 num_blue = 80 num_green = 180 total_marbles = num_red + num_blue + num_green proportion_red = num_red / total_marbles result = proportion_red return result