question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
The price of a movie ticket is $12.50. Mark and his friends went to watch a movie and spent $87.50 in total. How many people were in their group?
def solve() -> int: ticket_price = 12.50 total_cost = 87.50 num_people = total_cost / ticket_price result = num_people return result
In a farm, 35 chickens lay 20 eggs a day. How many eggs will 50 chickens lay?
def solve() -> int: chickens = 50 eggs_per_chicken = 20/35 total_eggs = chickens * eggs_per_chicken result = total_eggs return result
A runner ran a total distance of 12 kilometers in 75 minutes. She ran the first 5 kilometers in 28 minutes. At the same pace, how long will it take her to run 20 kilometers?
def solve() -> int: total_distance = 12 total_time = 75 distance_covered = 5 time_covered = 28 pace = time_covered / distance_covered remaining_distance = total_distance - distance_covered remaining_time = (remaining_distance / pace) + time_covered time_per_kilometer = remaining_time / r...
A rectangular picture frame measures 16 inches by 12 inches. If each side of the frame is 2 inches wide, what is the area of the picture?
def solve() -> int: picture_width = 16 picture_height = 12 frame_width = 2 picture_width_with_frame = picture_width + (2 * frame_width) picture_height_with_frame = picture_height + (2 * frame_width) picture_area = picture_width * picture_height picture_area_with_frame = picture_wid...
If it takes 8 employees 12 hours to process 200 applications, how many hours will 4 employees take to process 800 applications?
def solve() -> int: employees1 = 8 hours1 = 12 applications1 = 200 employees2 = 4 applications2 = 800 rate1 = applications1 / (employees1 * hours1) hours2 = applications2 / (employees2 * rate1) result = hours2 return result
Michael is known for being a weak swimmer because he can swim only 30 meters without stopping. If strong swimmers can swim at least 100 meters without stopping, how many times farther than Michael can they swim?
def solve() -> int: michael_distance = 30 strong_swimmer_distance = 100 distance_ratio = strong_swimmer_distance / michael_distance result = distance_ratio return result
Peter has 42 toy trucks. He buys 20 more toy trucks for his brother's birthday. After playing with them all day, he shares the new trucks with 4 of his friends. How many trucks does he have now?
def solve() -> int: total_trucks = 42 bought_trucks = 20 trucks_per_friend = 4 total_trucks = total_trucks + bought_trucks final_trucks = total_trucks - trucks_per_friend*4 result = final_trucks return result
Student: In a school with 1000 students, 700 gained various amounts of followers in the first, second and third weeks. 100 gained 11 followers in the first week, 250 gained 9 followers in the second week and 350 gained 8 followers in the third week. How many followers did the student with the least followers have after...
def solve() -> int: total_students = 1000 gained_followers = 700 first_week = 100 second_week = 250 third_week = 350 first_week_followers = first_week * 11 second_week_followers = second_week * 9 third_week_followers = third_week * 8 total_followers = first_week_followers + s...
A machine can produce 200 units per hour. If 20% of the units are defective, and 50% of the defects are due to electrical issues, how many defective units are produced every hour due to electrical issues?
def solve() -> int: units = 200 defective = 0.20 * units electrical_defects = 0.50 * defective result = electrical_defects return result
A charity received 500 donations before the start of its annual fundraiser. In the first week of the fundraiser, 20% of the donations were collected. In the second week, 40% of the remaining donations were collected. In the third week, the charity received 3/5 as many donations as it did in the second week. How many do...
def solve() -> int: donations_received = 500 donations_collected_week1 = donations_received * 0.2 donations_remaining_week1 = donations_received - donations_collected_week1 donations_collected_week2 = donations_remaining_week1 * 0.4 donations_remaining_week2 = donations_remaining_week1 - donati...
If a box of pencils has 24 pencils in it, and there are 30 boxes in a carton, how many pencils are in a carton?
def solve() -> int: pencils_per_box = 24 boxes_per_carton = 30 pencils_per_carton = pencils_per_box * boxes_per_carton result = pencils_per_carton return result
Student: A box of baby carrots has 16 ounces in it. If a dozen boxes are sold for $3 each, how much money will the store make from the sale?
def solve() -> int: ounces_per_box = 16 boxes_sold = 12 price_per_box = 3 total_weight = ounces_per_box * boxes_sold total_revenue = price_per_box * boxes_sold result = total_revenue return result
Student: A company sells a product for $30. The cost of production, packaging and shipping is $17. If the company sells 500 units of the product, how much is their profit?
def solve() -> int: units_sold = 500 price_per_unit = 30 cost_per_unit = 17 revenue = units_sold * price_per_unit cost = units_sold * cost_per_unit profit = revenue - cost result = profit return result
hane drove his car 160 miles and used 8 gallons of gas. If he continues to use gas at this rate, how far can he drive with 25 gallons of gas?
def solve() -> int: miles_per_gallon = 160/8 total_miles = miles_per_gallon*25 result = total_miles return result
David practices guitar for 7 hours a week. He practices on Monday, Wednesday, Friday, and Sunday. He practices for 2 hours on Monday and Friday. If he practices for the same amount of time on Wednesday and Sunday, how many hours is he practicing on Wednesday?
def solve() -> int: hours_per_week = 7 hours_mon_fri = 2 * 2 hours_wed_sun = (hours_per_week - hours_mon_fri) / 2 result = hours_wed_sun return result
A pizza shop offers 3 sizes of pizza with diameters of 10 inches, 12 inches, and 14 inches. If a small pizza has 6 slices, a medium pizza has 8 slices, and a large pizza has 10 slices, how many slices in total can be obtained from a large, a medium, and a small pizza?
def solve() -> int: small_pizza_diameter = 10 medium_pizza_diameter = 12 large_pizza_diameter = 14 small_pizza_slices = 6 medium_pizza_slices = 8 large_pizza_slices = 10 small_pizza_area = 0.25*3.14*small_pizza_diameter**2 medium_pizza_area = 0.25*3.14*medium_pizza_diameter**2 large_...
At the farmer's market, Sarah buys 1 bunch of carrots, 2 pounds of salmon, 1 head of broccoli, and 1 package of brussels sprouts. If a bunch of carrots weighs 12 ounces and a package of brussels sprouts weighs 8 ounces, what's the total weight of the food in ounces?
def solve() -> int: carrots = 12 salmon = 32 broccoli = 16 brussels_sprouts = 8 weight = (carrots+salmon+broccoli+brussels_sprouts) result = weight return result
A rectangular shape has a width of 5 inches and a length of 8 inches. What is the perimeter in inches?
def solve() -> int: width = 5 length = 8 perimeter = 2 * (width + length) result = perimeter return result
A family wants to order pizza for dinner. They plan to order 3 medium pizzas for $9.99 each, plus a delivery fee of $3. If they tip the delivery person 20%, how much will the total cost be?
def solve() -> int: pizza_cost = 9.99 * 3 delivery_fee = 3 tip_amount = (pizza_cost + delivery_fee) * 0.20 total_cost = pizza_cost + delivery_fee + tip_amount result = total_cost return result
There are 12 people on a basketball team and their average height is 6 feet. If a new member joins the team who is 6.5 feet tall, what is the new average height?
def solve() -> int: total_height = 12 * 6 new_total_height = total_height + 6.5 new_average_height = new_total_height / 13 result = new_average_height return result
On a map, two cities are 8 cm apart. The scale of the map is 1 : 5 000 000. What is the actual distance between the two cities in kilometers?
def solve() -> int: distance = 8*5000000/100000 result = distance return result
A restaurant received $15000, which was 50% more than their normal monthly revenue. What is their normal monthly revenue?
def solve() -> int: normal_revenue = 15000/1.5 result = round(normal_revenue, 2) return result
If a train travels 48 km per hour, how long will it take to cover 480 km?
def solve() -> int: train_speed = 48 distance_to_cover = 480 time_to_cover = distance_to_cover / train_speed result = time_to_cover return result
If a book's original price was $60, and it is now 25% off, what is the new price?
def solve() -> int: original_price = 60 discount_percent = 25 new_price = original_price - (original_price * (discount_percent/100)) result = new_price return result
4. Mathew had 240 notebooks and donated 5% of them. Sam had twice as many notebooks as Mathew and gave 2/3 of his notebooks away. How many notebooks are there remaining altogether?
def solve() -> int: total_notebooks = 240 + 2*240 mathews_notebooks_left = total_notebooks * 0.95 sams_notebooks_left = total_notebooks * 0.67 result = sams_notebooks_left + mathews_notebooks_left return result
There were 20 pieces of popcorn, and 6 kids watching a movie. If each kid was given the same amount, how many pieces of popcorn did each kid get?
def solve() -> int: numPopcorn = 20 numKids = 6 popcornPerKid = numPopcorn / numKids result = popcornPerKid return result
Mike purchases a bookshelf that measures 30 inches by 60 inches. His cousin Tim buys a bookshelf that measures 50 inches by 40 inches. If the bookshelves weigh 5 oz per square inch, how much more does Tim's bookshelf weigh in pounds?
def solve() -> int: shelf1_length = 30 shelf1_width = 60 shelf2_length = 50 shelf2_width = 40 weight_per_sq_inch = 5 shelf1_area = shelf1_length * shelf1_width shelf2_area = shelf2_length * shelf2_width total_weight_diff = (shelf2_area - shelf1_area) * weight_per_sq_inch we...
Ben invested $5000 in a savings account with an annual interest rate of 3%. How much money will he have in his account after 5 years?
def solve() -> int: initial_investment = 5000 interest_rate = 0.03 years = 5 amount = initial_investment * (1 + interest_rate) ** years result = amount return result
At a hospital, a patient is admitted every hour with 10 patients being discharged and 15 patients being admitted. How many patients are hospitalized at the end of 6 hours?
def solve() -> int: discharged_per_hour = 10 admitted_per_hour = 15 hours = 6 patients_hospitalized = 0 for i in range(hours): patients_hospitalized += admitted_per_hour - discharged_per_hour result = patients_hospitalized return result
Tom was buying pencils for a school supply drive. He purchased 60 boxes from a store. His teacher, Mrs. Jackson, donated 35 boxes of pencils. His cousin, Chris, gave him one-half the number of boxes that Mrs. Jackson donated. Later in the day, Tom's uncle brought 25 more than four times the number of boxes that he star...
def solve() -> int: tom_purchased = 60 mrs_jackson_donated = 35 chris_gave = mrs_jackson_donated / 2 uncle_brought = 25 + 4 * tom_purchased total_boxes = tom_purchased + mrs_jackson_donated + chris_gave + uncle_brought result = total_boxes return result
At a music festival, ten bands were performing on stage. Then, six less than twice as many more bands joined, before four bands left. How many bands were left performing on stage?
def solve() -> int: bands_on_stage = 10 more_bands = 2 * bands_on_stage + 6 total_bands = bands_on_stage + more_bands bands_left = total_bands - 4 result = bands_left return result
Mira has 72 stickers, Leo has 60 stickers and Kim has 15 stickers. They decide to glue the stickers on a poster equally between the 3 of them. How many stickers will each one use for the poster?
def solve() -> int: total_stickers = 72 + 60 + 15 equal_share = total_stickers / 3 result = equal_share return result
A park has a total of 500 trees and 4 paths. If each path has an equal number of trees, how many trees are along each path?
def solve() -> int: total_trees = 500; paths = 4; result = total_trees // paths; return result
A store is having a sale where everything is 25% off. If a customer buys a shirt that was originally $20, how much will the shirt cost after the discount?
def solve() -> int: original_price = 20 discount_percentage = 25 discount_amount = original_price * discount_percentage / 100 sale_price = original_price - discount_amount result = sale_price return result
Student: Ryan has 3 buckets full of apples. The first bucket has 8 more apples than the second bucket and the second bucket has 11 more apples than the third bucket. How many apples are in each bucket?
def solve() -> int: bucket1 = 0 bucket2 = 0 bucket3 = 0 bucket1 = bucket2 + 8 bucket2 = bucket3 + 11 bucket3 = bucket3 result = bucket1 + bucket2 + bucket3 return result
A train travels 600 miles in 8 hours. If it continues to travel at the same speed, how far will it travel in 1 day?
def solve() -> int: speed = 600 / 8 distance_in_one_day = speed * 24 result = distance_in_one_day return result
Student: If a train is moving at a speed of 50 mph and it covers a distance of 150 miles, how long will it take to reach its destination?
def solve() -> int: speed = 50 distance = 150 time = distance / speed result = time return result
A business deal involves 5 companies, each of which has to contribute $150. What is the total amount of money committed in the deal?
def solve() -> int: numOfCompanies = 5 contribution = 150 totalAmount = numOfCompanies * contribution result = totalAmount return result
Bella can read 12 pages in 10 minutes. At this same rate, how many pages could she read in 2.5 hours?
def solve() -> int: reading_rate = 12 / 10 minutes = 2.5 * 60 pages = reading_rate * minutes result = pages return result
Emily is in a marathon running from the start line to the finish line. The distance between the start line and the finish line is 26.22 miles long. If Emily has run 21 miles, how many miles does she have left to go until she reaches the finish line?
def solve() -> int: total_distance = 26.22 distance_run_so_far = 21 distance_left = total_distance - distance_run_so_far result = distance_left return result
If the sum of the angles in a triangle is 180 degrees and one of the angles is 75 degrees, what are the measures of the other two angles?
def solve() -> int: sum_of_angles = 180 angle1 = 75 angle2 = (sum_of_angles - angle1)/2 angle3 = angle2 result = angle2, angle3 return result
A pair of shoes that costs $60 is on sale with a 20% discount. However, there is an additional 10% discount with a coupon. What would be the final price?
def solve() -> int: shoe_price = 60 discount1_percent = 0.2 discount2_percent = 0.1 subtotal = shoe_price * (1 - discount1_percent) total_discount_percent = discount1_percent + discount2_percent - (discount1_percent * discount2_percent) total_discount_amount = subtotal * total_discount_percent ...
If Rachel has half as many books as Maddie and together they have 15 fewer books than Lily, who has 70 books, how many books does Rachel have?
def solve() -> int: lily_books = 70 maddie_books = (lily_books + 15) / 2 rachel_books = maddie_books / 2 result = rachel_books return result
There are 16 buses with 40 seats each. How many students can the buses hold in total?
def solve() -> int: bus = 16 seats = 40 students = bus * seats result = students return result
A farmer has 36 cows and wants to divide them into equal groups. If he has to make groups of 6, how many groups will he have?
def solve() -> int: num_cows = 36 group_size = 6 num_groups = num_cows // group_size result = num_groups return result
Student: Emily is saving money by buying a bulk of notebooks. She found out that 5 bundles of notebooks costs $45. Each bundle of notebooks consists of 6 notebooks. Calculate the total number of notebooks Emily purchased.
def solve() -> int: bundles = 5 cost = 45 notebooks_per_bundle = 6 total_notebooks = bundles * notebooks_per_bundle cost_per_notebook = cost / total_notebooks total_cost = cost_per_notebook * total_notebooks result = total_notebooks return result
During a basketball game, the home team scores four points for every three points that the opposing team scores. The referee calls a foul on the home team once every fifth basket they make. If the referee called six fouls in total, how many baskets did the opposing team score?
def solve() -> int: home_team_baskets = 6 * 5 opposing_team_baskets = (4/3) * home_team_baskets result = opposing_team_baskets return result
A coffee shop sells small coffees for $3 each and large coffees for $5 each. If a group of 5 people each buy a large coffee, how much does the coffee shop earn?
def solve() -> int: small_cost = 3 large_cost = 5 people = 5 total_cost = large_cost*people result = total_cost return result
John ate 75% of a pizza that had eight slices. He then ate twice the amount of remaining pizza. How much pizza did John eat in total?
def solve() -> int: total_slices = 8 initial_slices = total_slices * 0.75 remaining_slices = total_slices - initial_slices total_eaten = initial_slices + (remaining_slices * 2) result = total_eaten return result
A pizza is divided into 12 equal slices. A person eats 3 slices and then gives away 2 slices to a friend. What fraction of the pizza remains?
def solve() -> int: fraction = 7 / 12 result = fraction return result
5. John bought 4 bags of chips. He split the first and the fourth bags with his sister, and kept the second and the third bags for himself. His sister got 3 times as many chips as John. How many chips did each of them get?
def solve() -> int: total_bags_of_chips = 4 bags_given_to_sister = 2 chips_given_to_sister = bags_given_to_sister * 3 chips_kept_by_john = total_bags_of_chips - bags_given_to_sister total_chips = chips_given_to_sister + chips_kept_by_john chips_given_to_john = chips_kept_by_john chips_...
An apple pie needs 8 apples to be made. How many apples are needed to make X apple pies?
def solve() -> int: num_pies = 7 apples_per_pie = 8 total_apples = num_pies * apples_per_pie result = total_apples return result
Possible questions and programs are: Xin can fly his kite at three times the speed that he can walk. And Xin's sister, Lin, can ride her bike at four times the speed that Xin can fly his kite. If Lin always rides her bike at 48 miles per hour, how many miles can Xin walk in one hour?
def solve() -> int: x = 48 / 12 result = x * 1 return result
Lily has four times as many marbles as Amy. Ben has six less marbles than Amy. How many marbles do these three kids have, if Lily has 28 marbles?
def solve() -> int: lily = 28 amy = lily / 4 ben = amy - 6 total = lily + amy + ben result = total return result
In a store, a pail of apples costs $4.50 and each apple normally costs 50 cents. How many apples can a person buy with a $15 budget?
def solve() -> int: pail_cost = 4.50 apple_cost = 0.50 budget = 15 num_apples = 0 if budget >= pail_cost: num_apples = budget // pail_cost * 6 else: num_apples = budget // apple_cost result = num_apples return result
Mike bought a car for $7500 and sold it for 85% of its original value. How much did he get from selling the car?
def solve() -> int: Original_price = 7500 Selling_percent = 0.85 Selling_price = Original_price * Selling_percent result = Selling_price return result
Student: Kurt had 8 marbles. He gave 1 marble to each of his 2 friends. How many marbles does Kurt have left?
def solve() -> int: marbles = 8 marbles = marbles - 1 * 2 result = marbles return result
A farmer has 300 feet of fencing and wants to enclose a rectangular field. If the length of the field is three times the width, what are the dimensions of the field?
def solve() -> int: fencing = 300 width = fencing / (2 + 3) length = 3 * width result = (length, width) return result
In a new game, Jack scored 4 points on his first round, and then improved his score by 1 point with every round. By what score did he finish off his fifth round?
def solve() -> int: fifth_round_score = 0 for i in range(1, 6): round_score = 4 + (i - 1) if i == 5: fifth_round_score = round_score result = fifth_round_score return result
A car travels at a speed of 60 km/h for the first 4 hours and then at a speed of 90 km/h for the next 3 hours. What is the average speed of the car for the entire journey?
def solve() -> int: distance1 = 60 * 4 distance2 = 90 * 3 total_distance = distance1 + distance2 total_time = 4 + 3 average_speed = total_distance / total_time result = average_speed return result
There are 25 students in a class. 7 students move away and 3 new students join. What is the total number of students in the class now?
def solve() -> int: students = 25 students -= 7 students += 3 result = students return result
Student: - A car traveled at a constant speed of 60 kilometers per hour for 2 hours, then increased its speed by 10 kilometers per hour for the next hour, and then decreased its speed by 20 kilometers per hour for the last hour. How far, in kilometers, did the car travel in total?
def solve() -> int: speed1 = 60 speed2 = 70 speed3 = 50 time1 = 2 time2 = 1 time3 = 1 distance1 = speed1 * time1 distance2 = speed2 * time2 distance3 = speed3 * time3 total_distance = distance1 + distance2 + distance3 result = total_distance return result
A store is selling a bike for $300. If the original price was $450, what is the percentage discount the store is offering?
def solve() -> int: original_price = 450 discounted_price = 300 discount = (original_price - discounted_price) / original_price * 100 result = discount return result
Lina has 27 oranges. She eats 6 oranges every day for a week and wants to have 12 oranges left in the end. How many oranges did Lina eat this week?
def solve() -> int: totalOranges = 27 dailyOranges = 6 leftOranges = 12 oneWeekOranges = dailyOranges * 7 result = totalOranges - leftOranges + oneWeekOranges return result
A tank has a capacity of 75 gallons. If 2/3 of it is filled with water and 1/5 of the remainder is filled with sand, how many gallons of water is in the tank?
def solve() -> int: tank_capacity = 75 water = tank_capacity * 2/3 remaining = tank_capacity - water sand = remaining * 1/5 result = water return result
Lucas and Samuel were given $130 by their father to buy toys and spend the remaining on gadgets. Their father told them to buy a particular type of RC car which costs $57. They bought gadgets which cost twice the cost of the car. They still had $16 left and decided to buy some video games and share equally. The video g...
def solve() -> int: car_cost = 57 total_money = 130 gadget_cost = 2 * car_cost money_left = total_money - car_cost - gadget_cost video_game_cost = money_left / 2 pants_discount = 10 pants_cost = 50 - pants_discount shirt_cost = 20 total_savings = 2 * pants_discount + 3 * shirt_cost -...
Student: Benjamin collects 45 coins, and he has 5 times as many US coins as Euro coins. The rest of his collection consists of Asian coins. If Benjamin has 6 Euro coins, how many Asian coins does he have?
def solve() -> int: euro_coins = 6 us_coins = 5 * euro_coins total_coins = 45 asian_coins = total_coins - euro_coins - us_coins result = asian_coins return result
Student: Jake has 14 green apples. Kelly has 42 red apples. Leo has twice as many green apples as Jake and one half as many red apples as Kelly. How many apples does Leo have?
def solve() -> int: jake_green = 14 kelly_red = 42 leo_green = 2 * jake_green leo_red = kelly_red / 2 leo_total = leo_green + leo_red result = leo_total return result
A teacher wants to divide 26 students into groups of 4. How many groups will there be and how many students will be left over?
def solve() -> int: num_groups = 26 // 4 students_leftover = 26 % 4 result = (num_groups, students_leftover) return result
Student: John has a rectangular yard that is 15 feet long and 10 feet wide. He wants to put a fence around it. If the fence costs $2 per foot, how much will the fence cost?
def solve() -> int: length = 15 width = 10 cost = 2 perimeter = 2 * (length + width) total_cost = perimeter * cost result = total_cost return result
A rectangle has a length of 6 cm and a width of 4 cm. What is the perimeter of the rectangle?
def solve() -> int: length = 6 width = 4 perimeter = 2*length + 2*width result = perimeter return result
Chris is saving to buy a new car worth $10,000. If he saves $2000 each month, how many months will it take him to save enough?
def solve() -> int: car_price = 10000 savings_per_month = 2000 months_needed = car_price // savings_per_month result = months_needed return result
Student: Lisa has an allowance of 200 dollars per month. She spends 60 dollars per month on clothes. For the first month she saves 50 dollars and for the second month she saves 80 dollars. How much money does Lisa have left after two months?
def solve() -> int: allowance = 200 clothes = 60 saving_1 = 50 saving_2 = 80 result = allowance - clothes - saving_1 - saving_2 return result
Jack runs a car wash. He charges $10 for a basic wash and $15 for a premium wash. If he washes five cars with basic wash and three cars with premium wash per day, how much money will he earn in a week?
def solve() -> int: basic_wash_price = 10 premium_wash_price = 15 basic_wash_count = 5 premium_wash_count = 3 daily_earnings = (basic_wash_price * basic_wash_count) + (premium_wash_price * premium_wash_count) weekly_earnings = daily_earnings * 7 result = weekly_earnings return ...
Student: A car rented for a day costs $70. If the car is rented for 5 days or more, there is a 20% discount. How much would it cost to rent the car for a week?
def solve() -> int: day_cost = 70 discount = 0.2 days = 7 cost_5_days = day_cost * 5 discounted_cost_5_days = cost_5_days * (1 - discount) cost_2_days = day_cost * 2 total_cost = discounted_cost_5_days + cost_2_days result = total_cost return result
Bob has 15 identical pencils and he gives 4 of them to his brother Tim. If Tim already has 6 pencils and he gives 3 of them to his friend Amy, how many pencils does Amy have in total?
def solve() -> int: bob_pencils_after = 15 - 4 tim_pencils_after = 6 + 4 - 3 amy_pencils = 0 + 3 result = amy_pencils return result
Jill gives $100 to her daughter Sarah. Sarah wants to save 40% of it and spend the rest, how much money will Sarah save?
def solve() -> int: amount_given = 100 percentage_saved = 40 amount_saved = amount_given * (percentage_saved * 0.01) result = amount_saved return result
A company charges $13.95 for every 15 minutes of consultation. How much will they charge for a 45-minute consultation?
def solve() -> int: time = 45 base_time = 15 base_price = 13.95 time_ratio = time / base_time total_price = base_price * time_ratio result = total_price return result
``` A group decides to go to a restaurant for lunch. If each person orders a $7 meal, and there are 6 people total, how much did they spend in total?
def solve() -> int: total_cost = 7 * 6 result = total_cost return result
A carnival has 24 different games available to play. The carnival features balloon darts on a fifth of its games, basketball hoops on a third of its games, and ring toss on two of its games. Michael hates basketball and won't play those games, except for games with both balloon darts and basketball hoops. How many game...
def solve() -> int: games_total = 24 balloon_darts = games_total / 5 basketball_hoops = games_total / 3 ring_toss = 2 games_both = balloon_darts / 2 games_left = games_total - basketball_hoops - ring_toss - games_both result = games_left return result
Student: A family has 6 people. They buy 4 pizzas with 8 slices each. If each person gets 2 slices, how many slices are left?
def solve() -> int: people = 6 pizzas = 4 slices_per_pizza = 8 slices_per_person = 2 total_slices = pizzas * slices_per_pizza slices_consumed = people * slices_per_person slices_left = total_slices - slices_consumed result = slices_left return result
A swimming pool is 30 feet long, 20 feet wide, and 10 feet deep. If the pool is only filled to a depth of 8 feet, how many cubic feet of water are in the pool?
def solve() -> int: length = 30 width = 20 height = 10 depth = 8 volume = length*width*height partial_volume = length*width*depth water_volume = partial_volume result = water_volume return result
Tracy did yoga for a total of 15 hours last month. If she plans to do yoga for 2 hours a day this month, how much less time will she spend doing yoga compared to last month?
def solve() -> int: total_hours_last_month = 15 hours_per_day_this_month = 2 total_hours_this_month = hours_per_day_this_month * 30 less_time_this_month = total_hours_last_month - total_hours_this_month result = less_time_this_month return result
Oliver has a package that weighs 8.8 lb. He needs to mail it. His local post office charges $5.50 for the first 2 pounds, and then $2.00 for each additional pound. How much will it cost Oliver to mail the package?
def solve() -> int: base_cost = 5.50 extra_cost = (8.8-2)*2 total_cost = base_cost + extra_cost result = total_cost return result
Melissa has a rectangular garden that is 12 meters long and 8 meters wide. She wants to plant roses along the perimeter of the garden, leaving a gap of 1 meter between each rose. How many roses does she need to buy?
def solve() -> int: perimeter = 2 * (12 + 8) gaps = perimeter - 1 roses = gaps // 2 result = roses return result
It takes $\frac{1}{8}$ a gallon of paint to cover a wall. If Sarah wants to paint 4 walls, how many gallons does she need in total?
def solve() -> int: amount_paint_1_wall = 0.125 walls = 4 amount_paint = amount_paint_1_wall * walls result = amount_paint return result
A cinema has a seating capacity of 250 seats. If 20% of the seats are occupied, how many seats are still vacant?
def solve() -> int: total_seats = 250 occupied_percentage = 0.2 occupied_seats = total_seats * occupied_percentage vacant_seats = total_seats - occupied_seats result = vacant_seats return result
A painter mixed 3 liters of red paint and 2 liters of yellow paint to make some orange paint. He then used 1.5 liters of the orange paint to paint a wall. If each liter of red paint cost $6 and each liter of yellow paint cost $4, how much did he spend on the paint he used for the wall?
def solve() -> int: cost_of_red_paint = 3 * 6 cost_of_yellow_paint = 2 * 4 cost_of_mixed_paint = cost_of_red_paint + cost_of_yellow_paint proportion_used = 1.5 / (3 + 2) cost_of_paint_used = proportion_used * cost_of_mixed_paint result = cost_of_paint_used return result
Daniel has $30 in his wallet. He spends $5 every day at the coffee shop. After how many days will he have no money left?
def solve() -> int: wallet = 30 daily_spending = 5 days = wallet // daily_spending result = days return result
Alexa brought 5 bags of chips and 2 cartons of orange juice to a party. Each bag of chips contained 12 chips while each carton of orange juice had 8 glasses. How many pieces were there in total?
def solve() -> int: bags_of_chips = 5 cartons_of_juice = 2 chips_per_bag = 12 juice_per_carton = 8 total_pieces = (bags_of_chips * chips_per_bag) + (cartons_of_juice * juice_per_carton) result = total_pieces return result
Student: Terrence went grocery shopping and bought three cartons of eggnog. He bought one carton for $2.65 and the other two cartons at $2 each. How much money did he spend?
def solve() -> int: price1 = 2.65 price2 = 2 quantity1 = 1 quantity2 = 2 total_cost = price1 * quantity1 + price2 * quantity2 result = total_cost return result
Student: - The art teacher needed to buy paint for a mural project. She bought 24 cans of red paint for $3.50 each, 18 cans of blue paint for $4 each, 12 cans of yellow paint for $3.75 each, and 6 cans of white paint for $5 each. She also used a coupon that gave her a 15% discount on the total purchase. How much did sh...
def solve() -> int: red_cans = 24 red_price = 3.50 blue_cans = 18 blue_price = 4 yellow_cans = 12 yellow_price = 3.75 white_cans = 6 white_price = 5 subtotal = red_cans * red_price + blue_cans * blue_price + yellow_cans * yellow_price + white_cans * white_price discount_rate = 0....
Student: Tom bought a car for $10,000. He then sells the car for 20% more than what he paid for. How much did Tom sell the car for?
def solve() -> int: price_bought = 10000 price_sold = price_bought * 1.2 result = price_sold return result
Grace and Olivia decide to combine their money equally. If Grace has $80 and Olivia has $60, how much money does each get when they share it equally? Nina is baking muffins for a party. For every 15 muffins she bakes, she needs to replace her baking sheet. It costs her $2 to buy a new baking sheet. If she spends $30 on...
def solve() -> int: grace_money = 80 olivia_money = 60 total_money = grace_money + olivia_money each_gets = total_money / 2 cost_per_sheet = 2 total_cost = 30 num_sheets = total_cost / cost_per_sheet num_muffins = num_sheets * 15 result = each_gets, num_muffi...
Student: Andrea has 50 pencils and twice as many pens as pencils. If she has 30 fewer erasers than pens, and 20 more markers than pens, how many total writing utensils does she have combined?
def solve() -> int: pencils = 50 pens = pencils * 2 erasers = pens - 30 markers = pens + 20 result = pencils + pens + erasers + markers return result
Student: Heinz bought 150 rolls of tickets for the charity gate. Each roll contains 200 tickets. The 6th grade students bought 40% of the tickets, while the 7th grade students bought 50% of the remaining tickets. How many tickets were left unsold?
def solve() -> int: rolls = 150 tickets_per_roll = 200 sixth_grade = 0.4 seventh_grade = 0.5 total_tickets = rolls * tickets_per_roll sixth_grade_tickets = total_tickets * sixth_grade remaining_tickets = total_tickets - sixth_grade_tickets seventh_grade_tickets = remaining_tickets * ...
A farmer has 16 cows and 24 chickens. He sells half of his cows and a quarter of his chickens. How many animals does he have left on his farm?
def solve() -> int: cows_sold = 16 / 2 chickens_sold = 24 / 4 cows_left = 16 - cows_sold chickens_left = 24 - chickens_sold total_left = cows_left + chickens_left result = total_left return result
Mia wants to decorate a room with a wallpaper border. She has to buy 3 rolls of border but only has 2 rolls available. Each roll is 6 meters long. If the border requires a length of 16 meters in total, how many more meters of border does Mia need?
def solve() -> int: rolls_owned = 2 rolls_needed = 3 length_per_roll = 6 length_needed = 16 length_missing = (rolls_needed - rolls_owned) * length_per_roll - length_needed result = length_missing return result
Mike bought a TV at 20% discount off its $400 price. How much did he pay for the TV?
def solve() -> int: price_tv = 400 discount_percentage = 0.2 discount_price = price_tv * (1-discount_percentage) result = discount_price return result
Student: A customer bought four sweaters costing $20 each from a store. She also received $20 off the total. How much money did she save in total?
def solve() -> int: num_sweaters = 4 cost_per_sweater = 20 discount = 20 total_cost = num_sweaters * cost_per_sweater total_saved = discount total_paid = total_cost - total_saved result = total_saved return result