question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Student: Anna wants to burn an average of 500 calories per day over the next four days. On the first day she burned 400 calories. On the second day she burned 600 calories. On the third day she burned 450 calories. How many calories does she need to burn on the fourth day to meet her goal?
def solve() -> int: day1 = 400 day2 = 600 day3 = 450 goal = 500 total_calories = day1 + day2 + day3 remaining_calories = goal * 4 - total_calories result = remaining_calories return result
The ratio of boys to girls in a class is 5 to 4. If there are 36 girls in the class, how many boys are there?
def solve() -> int: girls = 36 boys = 5/4*girls result = f"There are {boys} boys in the class." result = boys return result
There are 19 people in a room. Each person shakes hands with 6 of the other people in the room. How many total handshakes have occurred in the room?
def solve() -> int: num_people = 19 total_handshakes = int((num_people * (num_people-1)) / 2) total_handshakes_in_room = 6 * num_people total_handshakes_not_in_room = total_handshakes - total_handshakes_in_room result = total_handshakes_in_room return result
In a game, there were 8 players and 4 referees. If Tom becomes the 9th player, what percentage of the people in the game will be referees?
def solve() -> int: players = 8 referees = 4 total_people = players + referees percentage_referees = (referees / total_people) * 100 total_people += 1 referees_percentage_with_tom = (referees / total_people) * 100 result = referees_percentage_with_tom return result
A farm grows 1,200 watermelons and distributes them to 6 different grocery stores. The first store receives 200 watermelons, the second store receives double the amount of the first, the third store receives 400 less than the second, the fourth store receives the same amount as the first store, the fifth store receives...
def solve() -> int: watermelons_grown = 1200 grocery_stores = 6 store1 = 200 store2 = store1 * 2 store3 = store2 - 400 store4 = store1 store5 = store3 store6 = store2 * 3 result = store5 return result
A merchant wants to determine the cost of upgrading a store. The investment is planned to add $25,000 income per year for the next 10 years. Determine the cost if the merchant borrows the money at 5% per annum and pays it back with simple interest over the next 5 years.
def solve() -> int: income_per_year = 25000 years = 10 borrowed_years = 5 annual_rate = 0.05 total_income = income_per_year * years simple_interest = total_income * borrowed_years * annual_rate cost_of_upgrading = simple_interest/(1 + borrowed_years * annual_rate) result = cost_of_upgra...
Mia had 100 stickers. She divided them equally into 10 albums. 4 of the albums had animal stickers. 3 of the albums had car stickers. The rest of the albums had food stickers. How many stickers were food?
def solve() -> int: stickers = 100 albums = 10 animal_albums = 4 car_albums = 3 food_albums = albums - (animal_albums + car_albums) food_stickers = (stickers / albums) * food_albums result = food_stickers return result
If there are ten more birds on the tree than the number of birds on the ground, and there are 15 birds on the ground, how many birds are there in total?
def solve() -> int: birds_on_ground = 15 birds_on_tree = birds_on_ground + 10 total_birds = birds_on_ground + birds_on_tree result = total_birds return result
Carrie and David are hosting a charity walkathon and need to cover a total distance of 10 kilometers. Each lap around the track is 250 meters. If each participant has completed 8 laps, how many more laps do they need to reach 10 kilometers?
def solve() -> int: total_distance = 10 * 1000 lap_distance = 250 completed_laps = 8 remaining_distance = total_distance - (completed_laps * lap_distance) remaining_laps = remaining_distance / lap_distance result = remaining_laps return result
Student: A factory produces 500 dresses per day. In a week, how many dresses do they make?
def solve() -> int: dresses_per_day = 500 days_in_week = 7 result = dresses_per_day * days_in_week return result
Three islands are 4 hours apart from one another. Alex travels from the first island to the third, taking a 50-minute break at the second island. What's the total time, in minutes, that Alex takes to travel between the first and third island?
def solve() -> int: island_distance = 3 * 4 * 60 break_time = 50 total_time = island_distance + break_time result = total_time return result
Benjamin is selling blankets for his animal shelter. On Sunday, he sold 10 blankets. On Monday, he sold 20 more than twice that number. And on Tuesday, he sold a third as many as on Monday. How many blankets did he sell over the three days?
def solve() -> int: sunday = 10 monday = 20 + 2 * sunday tuesday = monday / 3 total = sunday + monday + tuesday result = total return result
Alicia can finish a job in 5 hours. If Ben can do the same job in 3 hours, how long will it take them to do the job together?
def solve() -> int: a = 5 b = 3 t = 1/(1/a + 1/b) result = t return result
For her birthday, Rachel receives a gift of $400 from her family and spends 60% of it on buying clothes and accessories. With the remaining money, she starts a savings account which grows by 20% due to monthly interest. Finally, because of an emergency, she takes out $50 from her savings. If Rachel's final savings are ...
def solve() -> int: gift = 400 spent_on_clothes = gift * 0.6 remaining_money = gift - spent_on_clothes savings_with_interest = remaining_money * 1.2 final_savings = savings_with_interest - 50 result = final_savings return result
Samantha has a restaurant and needs to buy 50-pound bags of rice that cost $25 each. If she needs 4 pounds of rice for each dish and makes 20 dishes a week, how much will it cost her to buy enough rice for 90 days?
def solve() -> int: cost_per_bag = 25 pounds_per_bag = 50 pounds_per_dish = 4 dishes_per_week = 20 days_per_week = 7 total_days = 90 total_pounds_needed = pounds_per_dish * dishes_per_week * total_days / days_per_week total_bags_needed = total_pounds_needed / pounds_per_bag ...
A company invests $10,000 in a project. The project yields a return of 15% per year. After how many years will the company have earned a total of $20,000?
def solve() -> int: initial_investment = 10000 target_return = 20000 interest_rate = 0.15 years = 0 while initial_investment < target_return: initial_investment *= (1+interest_rate) years += 1 result = years return result
If Alex can eat 2 pieces of pizza in 5 minutes, how much pizza can he eat in 30 minutes?
def solve() -> int: pieces_in_time = 30/5 pieces_eaten = 2 * pieces_in_time result = pieces_eaten return result
Liam is baking a cake. He needs 2 cups of sugar. If 1 cup of sugar weighs 200 grams, how many grams of sugar does he need for the cake?
def solve() -> int: cups_of_sugar = 2 grams_per_cup = 200 total_grams = cups_of_sugar * grams_per_cup result = total_grams return result
Sarah has a biology book that has 550 pages. On Friday, she read 35 pages in the morning and 25 pages before bed. On Saturday, she read 60% of the total pages she read on Friday. How many pages does she have left to read?
def solve() -> int: book_pages = 550 friday_morning = 35 friday_before_bed = 25 friday_total = friday_morning + friday_before_bed saturday_total = friday_total * 0.6 total_read = friday_total + saturday_total pages_left = book_pages - total_read result = pages_left return result...
Dave bakes 85 pastries and sells 60 of them. How many pastries does he have left?
def solve() -> int: num_of_pastries_baked = 85 num_of_pastries_sold = 60 num_of_pastries_left = num_of_pastries_baked - num_of_pastries_sold result = num_of_pastries_left return result
Jason has eight baskets with six tennis balls in each basket. His coach gave him six baskets with four basketballs. If he gives 76 balls to his teammates, how many balls does he have left?
def solve() -> int: tennis_baskets = 8 tennis_balls_per_basket = 6 basketball_baskets = 6 basketball_balls_per_basket = 4 balls_given_to_teammates = 76 total_tennis_balls = tennis_baskets * tennis_balls_per_basket total_basketball_balls = basketball_baskets * basketball_balls_per_basket...
A hat costs $8, while a pair of gloves is 25% more expensive. Lily bought four hats and two pairs of gloves. How much did she pay for her purchases?
def solve() -> int: hat_price = 8 gloves_price = hat_price * 1.25 total_price = (4 * hat_price) + (2 * gloves_price) result = total_price return result
Omar goes to the movies with four friends every Friday night. Each movie ticket costs $10.50. How much will Omar spend on movie tickets over the next 16 weeks?
def solve() -> int: num_friends = 4 ticket_cost = 10.50 num_weeks = 16 total_cost = num_friends * ticket_cost * num_weeks result = total_cost return result
How many cups of flour are needed if a recipe calls for 4.2 tablespoons of flour?
def solve() -> int: tbsp = 4.2 cups = tbsp / 16.0 result = cups return result
Sophia works in a clothing store and earns $12 per hour. She also receives a commission of 5% on the total sales she makes. If she works for seven hours and makes total sales worth $600, how much money will she earn in total?
def solve() -> int: hourly_rate = 12 commission_rate = 0.05 hours_worked = 7 total_sales = 600 earnings_from_hourly_rate = hourly_rate * hours_worked commission_earned = commission_rate * total_sales total_earnings = earnings_from_hourly_rate + commission_earned result = t...
John runs a lap of 200 meters in 25 seconds. What is his average speed in meters per second?
def solve() -> int: distance = 200 time = 25 speed = distance/time result = speed return result
A delivery driver delivered 30 packages in the last two hours. He delivered the same number of packages to commercial as he did to residential addresses, and he delivered 6 more packages to industrial addresses than to residential addresses. How many packages did he deliver to residential addresses?
def solve() -> int: result = 8 return result
If Lily has 96 stickers and she wants to have 2 more unicorn stickers than heart stickers, how many heart stickers does she have?
def solve() -> int: stickers_total = 96 unicorn_stickers = 2 heart_stickers = (stickers_total - unicorn_stickers) / 2 result = heart_stickers return result
A pizza restaurant charges $12 for a 12-inch pizza and $20 for an 18-inch pizza. What is the cost per square inch for each size of pizza?
def solve() -> int: radius_small = 12 / 2 area_small = 3.14 * radius_small ** 2 price_small = 12 cost_per_sq_in_small = price_small / area_small radius_large = 18 / 2 area_large = 3.14 * radius_large ** 2 price_large = 20 cost_per_sq_in_large = price_large / area_large result = (cost...
A shopkeeper sells an item at a 25% discount. If the cost price of the item is $40, what is the selling price?
def solve() -> int: discount = 0.25 cost = 40 discount_amount = discount*cost selling_price = cost - discount_amount result = selling_price return result
Hannah is a store manager. She needs to order 8 times as many shirts as pants. If she needs to order 324 shirts and pants combined, how many pants does she order?
def solve() -> int: pants = 324 / (8 + 1) result = pants * 1 return result
If a restaurant has a total of 40 tables and each table can seat either 4 or 6 diners, what is the minimum number of tables that need to be designated for 6 diners in order to accommodate a party of 200 diners?
def solve() -> int: total_tables = 40 table1_capacity = 4 table2_capacity = 6 num_of_people = 200 table1_num = (num_of_people//(table1_capacity+table2_capacity))*table1_capacity table2_num = num_of_people//(table1_capacity+table2_capacity) * table2_capacity if num_of_people % (table1_ca...
A company spends $8000 to manufacture 500 shirts. If the company wants to sell the shirts at $35/piece, what is the profit of the company?
def solve() -> int: manufacturing_cost = 8000 number_of_shirts = 500 selling_price = 35 total_revenue = selling_price * number_of_shirts profit = total_revenue - manufacturing_cost result = profit return result
Alex has $500 in his account. He withdraws $50 every week for his expenses. After how many weeks will he run out of money?
def solve() -> int: account_balance = 500 withdrawal_amount = 50 weeks = account_balance // withdrawal_amount result = weeks return result
Student: John read a book that was 600 pages long. He read 10 pages a day. How many days did it take him to finish the book?
def solve() -> int: book_length = 600 pages_per_day = 10 days = book_length / pages_per_day result = days return result
Lucas bought a bike for $300 and spent $50 on accessories. He sold the bike for $400 after using it for a year. He also paid $10 every month for maintenance. How much profit or loss did Lucas make from buying and selling the bike?
def solve() -> int: spent = 300 + 50 + (10 * 12) earned = 400 profit_loss = earned - spent result = profit_loss return result
A delivery truck traveled 200 kilometers at a constant rate of 40 kilometers/hour. Then it traveled for the next 4 hours at a constant rate. For the remaining 2 hours, the truck traveled at a constant rate of 80 kilometers/hour. If the average speed of the truck was 60 kilometers/hour, at what rate did the truck travel...
def solve() -> int: distance1 = 200 rate1 = 40 time1 = distance1 / rate1 average_speed = 60 total_time = time1 + 4 + 2 total_distance = average_speed * total_time distance2 = total_distance - distance1 rate2 = distance2 / 4 result = rate2 return result
Marcus has 20 rubbers in a box. He wants to divide the rubbers into 5 equal groups. How many rubbers should there be in each group?
def solve() -> int: total_rubbers = 20 num_groups = 5 result = total_rubbers/num_groups print (result) return result
If Carly gave Lily three times as many marbles as she gave Ella and ends up with 80 marbles, but Ella only received 20 marbles, how many marbles did Carly have initially?
def solve() -> int: carly_to_ella = 3 ella_marbles = 20 carly_marbles = carly_to_ella * ella_marbles total_marbles = carly_marbles + ella_marbles carly_initial_marbles = total_marbles - 80 result = carly_initial_marbles return result
Student: Sophie wanted to save money by buying cheap calorie-dense food, so she went to the store. She can buy 3 milkshakes for $3.50 that each have 220 calories, or she can buy 5 pizzas for $3.50 that each have 100 calories. How many more calories per dollar does she get from the milkshakes?
def solve() -> int: milkshake_price = 3.50 milkshake_calories = 220 pizza_price = 3.50 pizza_calories = 100 milkshake_calories_per_dollar = milkshake_calories / milkshake_price pizza_calories_per_dollar = pizza_calories / pizza_price difference_in_calories_per_dollar = milkshake_calories_per...
Nora has 12 pieces of gum. She gave 2 pieces to each of her three friends and she had 3 pieces left. How many pieces of gum did Nora give away?
def solve() -> int: total_gum = 12 left = 3 result = total_gum - left return result
Emily wants to buy a new laptop worth $1200. She earns $15 per hour for a 35-hour workweek. How many more hours does she have to work to buy the laptop?
def solve() -> int: hourly_earnings = 15 workweek = 35 laptop_price = 1200 hours_needed = (laptop_price / hourly_earnings) - workweek result = int(hours_needed) return result
-Keep final result as an integer, round up or down the number if necessary Some possible new questions and programs are: Kevin has a bucket that can hold 20 liters of water. He fills it up to 80 percent and then pours out one-fourth of the water in the bucket. How many liters of water are left in the bucket?
def solve() -> int: capacity = 20 initial = 0.8 * capacity poured = 0.25 * initial left = initial - poured result = left return result
A cyclist travels 50 km to a destination at a speed of 20 km/h. The cyclist returns to the start point at a speed of 30 km/h. What is his average speed for the whole journey?
def solve() -> int: distance = 2 * 50 total_time = 50/20 + 50/30 average_speed = distance / total_time result = average_speed return result
Mike drives 60 mph on a freeway. If he drives for 5 hours, how many miles did he drive?
def solve() -> int: speed = 60 time = 5 distance = speed * time result = distance return result
For every five dollars earned, Sarah gives three dollars away. If she wants to save $80, how much money does she need to earn and how much will she give away?
def solve() -> int: earnings = 80 given_away = (3/5) * earnings saved = earnings - given_away result = f'Sarah needs to earn {earnings} dollars and give away {given_away} dollars to save {saved} dollars.' return result
Ryan drove a total of 600 miles in 8 hours with constant speed. What is Ryan’s average speed?
def solve() -> int: total_miles = 600 total_hours = 8 average_speed = total_miles / total_hours result = average_speed return result
Roger has 100 cakes and he was about to give away 30 cakes to his daughter. However, he changed his mind and only gave away 14 cakes. How many cakes did Roger keep?
def solve() -> int: cakes_init = 100 cakes_given = 30 cakes_given_2 = 14 cakes_kept = cakes_init - (cakes_given - cakes_given_2) result = cakes_kept return result
Rico needs to pick up 6 large boxes and 7 small boxes for his online order. If the price for large boxes is $10 and small boxes is $5, how much does he need to pay?
def solve() -> int: cost = 0 cost += 6 * 10 cost += 7 * 5 result = cost return result
At a sports store, Jack bought 2 items: a basketball and a gym bag. The basketball cost half the price of the gym bag. If the gym bag cost $40, how much did the basketball cost? In a park, there are 5 benches with 3 legs each, 2 small stools with 2 legs each and 3 picnic tables with 4 legs each. How many legs are there...
def solve() -> int: gym_bag_cost = 40 basketball_cost = gym_bag_cost / 2 benches = 5 bench_legs = 3 stools = 2 stool_legs = 2 picnic_tables = 3 picnic_table_legs = 4 total_legs = (benches * bench_legs) + (stools * stool_legs) + (picnic_tables * picnic_table_legs) result...
A box contains 10 red balls and 5 blue balls. If 2 balls are randomly selected, what is the probability that both balls will be blue?
def solve() -> int: total_balls = 15 blue_balls = 5 probability_first_blue = blue_balls / total_balls probability_second_blue = (blue_balls - 1) / (total_balls - 1) probability_both_blue = probability_first_blue * probability_second_blue result = probability_both_blue return result
Lily has 6 blue balloons, 3 green balloons and 1 red balloon. How many balloons does she have in total?
def solve() -> int: blue_balloons = 6 green_balloons = 3 red_balloons = 1 total_balloons = blue_balloons + green_balloons + red_balloons result = total_balloons return result
Emily sells apples at a commission rate of 10%. In total, Emily made $48 by selling 2 crates of apples. How much does a crate of apples cost?
def solve() -> int: price_per_crate = 0 total_commission = 48 total_crates = 2 commission_rate = 10 total_selling_price = total_commission / commission_rate * 100 price_per_crate = total_selling_price / total_crates result = price_per_crate return result
A triangle has sides of lengths 8 cm, 10 cm, and 12 cm. Is it a right triangle?
def solve() -> int: a = 8 b = 10 c = 12 if a**2 + b**2 == c**2: answer = "Yes" else: answer = "No" result = answer return result
Student: A restaurant received 120 orders for their new dish in the first week. The next week they received 10% more orders than the previous week. How many orders did they receive the second week?
def solve() -> int: first_week_orders = 120 percent_increase = 0.1 second_week_orders = first_week_orders + (first_week_orders * percent_increase) result = round(second_week_orders) return result
Amelia is preparing for a 10K run. She runs 3 times a week and increases her distance by 10% each week. If she starts with 4K in the first week, how many weeks will it take her to reach 10K?
def solve() -> int: week = 1 distance = 4 while distance < 10: week = week + 1 distance = distance * 1.1 result = week return result
A pizza place sells a large pizza for $12.00 today. When the price of cheese goes up by 20%, the pizza place will increase the price of a large pizza by 15%. How much more will 4 large pizzas cost after the price increase?
def solve() -> int: price = 12.00 cheese = 0.2 pizza = 0.15 new_price = price * (1 + cheese) * (1 + pizza) difference = new_price - price extra_cost = difference * 4 result = extra_cost return result
Q8: A truck driver drove 4 miles the first day, 70% longer the second day and 50% longer the third day. How many miles did the truck driver drive in 3 days?
def solve() -> int: miles_per_day1 = 4 miles_per_day2 = (4*1.7) miles_per_day3 = (miles_per_day2*1.5) total_miles = miles_per_day1 + miles_per_day2 + miles_per_day3 result = total_miles return result
Student: If a truck needs 36 gallons of gas, and 5 trucks need to be filled, how much gas is needed in total?
def solve() -> int: num_trucks = 5 gas_per_truck = 36 total_gas = num_trucks * gas_per_truck result = total_gas return result
Rachel wants to buy a new basketball that costs $40. She has $5 saved up and earns $15 a week from her after-school job. She spends $5 a week on snacks. How long will it take her to save enough for the basketball?
def solve() -> int: weekly_earnings = 15 weekly_expenses = 5 current_savings = 5 basketball_cost = 40 weeks_to_save = (basketball_cost - current_savings) / (weekly_earnings - weekly_expenses) result = weeks_to_save return result
Possible questions and programs: Karen has a small garden where she grows tomatoes and peppers. She harvested 18 tomatoes and 12 peppers this week. She wants to make salsa with 3 tomatoes and 2 peppers per jar. How many jars of salsa can she make and how many tomatoes and peppers will she have left over?
def solve() -> int: tomatoes = 18 peppers = 12 tomatoes_per_jar = 3 peppers_per_jar = 2 jars = min(tomatoes // tomatoes_per_jar, peppers // peppers_per_jar) tomatoes_left = tomatoes % tomatoes_per_jar peppers_left = peppers % peppers_per_jar result = (jars, tomatoes_left, ...
There are 6 students in a class. Threeof them have 8 apples, and the other three have 5 apples. How many apples are in the whole class?
def solve() -> int: number_of_students = 6 number_with_8 = 3 number_with_5 = 3 total_apples = (number_with_8 * 8) + (number_with_5 * 5) result = total_apples return result
A car travels 280 miles on 14 gallons of gas. How many miles per gallon does the car get?
def solve() -> int: distance = 280 gas = 14 mpg = distance / gas result = mpg return result
If each pencil costs $1 and Peter has $30 less than Quinn, and Quinn has 40 pencils, how many pencils can Peter buy? A five-story cake is being made with each layer having twice as many chocolate chips as the layer below it. The bottom layer has 32 chocolate chips. How many chocolate chips are in the cake?
def solve() -> int: quinn_pencils = 40 peter_money = quinn_pencils * 1 - 30 peter_pencils = peter_money // 1 result = peter_pencils return result
At the airport, Miguel was 30 minutes late for his flight. Three other passengers were also late, with two of them being 10 minutes later than Miguel and the other being 20 minutes late. What was the total delay time of the four passengers?
def solve() -> int: miguel_delay = 30 passenger1_delay = miguel_delay + 10 passenger2_delay = miguel_delay + 10 passenger3_delay = miguel_delay + 20 total_delay = miguel_delay + passenger1_delay + passenger2_delay + passenger3_delay result = total_delay return result
Student: A candy store sells boxes of chocolates for $15 each. If the store sold 120 boxes in one day, how much did they make in one day?
def solve() -> int: price = 15 sold = 120 revenue = price * sold result = revenue return result
The average of 3 numbers is 40. If one of the numbers is 60, what are the other two numbers?
def solve() -> int: num3 = 60 num1 = None num2 = None for i in range(1, 60): x = i y = 60 - i if ((x + y + num3)/3) == 40: num1 = x num2 = y result = (num1, num2) return result
A truck uses 20 litres of diesel for every 100km. How much diesel is needed to go 480km?
def solve() -> int: diesel_for_100km = 20 diesel_for_1km = diesel_for_100km/100 diesel_for_480km = diesel_for_1km * 480 result = diesel_for_480km return result
Jorge can mow a lawn in 2 hours. If he hires a helper, together they can do the job in 1 hour. How long will it take the helper to mow the lawn alone?
def solve() -> int: jorge_time = 2 together_time = 1 helper_time_alone = (together_time*jorge_time)/(jorge_time+together_time) result = helper_time_alone return result
John is taking his 12 pet snails for a walk in the garden. Each snail has four legs. How many legs are slithering together?
def solve() -> int: snail_count = 12 legs_per_snail = 4 total_legs = snail_count * legs_per_snail result = total_legs return result
Mike wants to buy balloons for his party. He wants to buy 30 green balloons and 20 yellow balloons. If he spent $36 and green balloons cost $1 each, how much does a yellow balloon cost?
def solve() -> int: green_balloons = 30 yellow_balloons = 20 total_cost = 36 green_balloon_cost = 1 yellow_balloon_cost = (total_cost - (green_balloons * green_balloon_cost)) / yellow_balloons result = yellow_balloon_cost return result
It takes Judy 15 minutes to paint one room in her house. If she paints 10 rooms on both Saturday and Sunday, how many hours does she spend painting?
def solve() -> int: time_for_each_room = 15/1 total_time_for_both_days = (time_for_each_room * 10) * 2 account_for_minutes = (15/1) * 2 total_time_in_hours = (total_time_for_both_days+account_for_minutes)/60 result = total_time_in_hours return result
Student: A mobile phone costs $700. The store owner decided to increase its price by 5% so that he could earn more profit. Few weeks had past but the mobile phone was still not sold. So, the owner decided to lower the price by 15%. By how much was the final price lower than the original price?
def solve() -> int: original_price = 700 increased_price = original_price * 1.05 final_price = increased_price * 0.85 result = original_price - final_price return result
In a geometry class, the teacher gave a total of 60 points for a project. Justin and Ryan got 42 points combined. Olivia and Ethan scored the remaining points equally. How many points did Olivia score?
def solve() -> int: total_points = 60 justin_ryan_points = 42 olivia_ethan_points = (total_points - justin_ryan_points) / 2 result = olivia_ethan_points return result
Tina has 4 boxes of pens. If each box contains 7 pens, how many pens does she have?
def solve() -> int: total = 4 * 7 result = total return result
an had 12 chickens. He bought additional chickens so that the number of chickens he owned reached 7 times its original number. Unfortunately, 5 of his chickens got sick. How many chickens does Sean have now?
def solve() -> int: n = 12 new_chickens = n * 7 total_chickens = new_chickens + n lost_chickens = 5 result = total_chickens - lost_chickens return result
A rectangular box has width 5 cm, height 4 cm, and length 10 cm. What is its volume and surface area?
def solve() -> int: width = 5 height = 4 length = 10 volume = width * height * length surface_area = 2*(width*length) + 2*(height*length) + 2*(width*height) result = (volume, surface_area) return result
A class has 25 students, and each student has 5 pencils. The teacher asked for each student to give 2 pencils to the classroom. How many pencils are left with the students?
def solve() -> int: pencils = 25 * 5 pencils -= 25 * 2 result = pencils return result
A pack of candies contains 20 red, 16 green, and 14 yellow candies. Alice takes a random candy from the pack and eats it. Then Bob takes a random candy from the remaining pack and eats it. What is the probability that both candies are green?
def solve() -> int: result = 16/50 * 15/49 return result
Some possible questions and programs are: Maria sells lemonade for $0.50 a cup. She makes 20 cups a day and spends $5 on ingredients. How much profit does she make in a week?
def solve() -> int: price = 0.5 sales = 20 cost = 5 days = 7 profit_day = price * sales - cost profit_week = profit_day * days result = profit_week return result
In a summer art camp, there are 150 kids. Half of them are going to painting camp. 2/3 of the painting students are attending morning session. If there are 450 students in painting camp, how many of them are in afternoon session?
def solve() -> int: total_students = 150 painting_students = total_students / 2 morning_students = painting_students * (2/3) afternoon_students = painting_students - morning_students result = afternoon_students return result
A diamond ring costs $3,500, including tax. Ms. Carter pays $1,000 and the rest by giving $350 a month. In how many months will the ring be fully paid for?
def solve() -> int: total_cost = 3500 down_payment = 1000 remaining_balance = total_cost - down_payment monthly_payment = 350 months = round(remaining_balance / monthly_payment) result = months return result
Student: A school has 240 girls and 300 boys. If each girl contributes $2 for a charity event and each boy contributes $3, how much more money will the boys contribute than the girls?
def solve() -> int: girls = 240 boys = 300 girl_contribution = 2 boy_contribution = 3 girl_total = girls * girl_contribution boy_total = boys * boy_contribution difference = boy_total - girl_total result = difference return result
Student: A student is studying for an exam. The student has a list of 100 questions to review. The student can answer 4 questions per hour. The student studies for 5 hours a day for 4 days. How many questions, in percentage, did the student answer in total?
def solve() -> int: questions = 100 questions_per_hour = 4 hours_per_day = 5 days = 4 total_questions_answered = questions_per_hour * hours_per_day * days percentage_questions_answered = total_questions_answered / questions * 100 result = percentage_questions_answered return result
``` The price of a cup of coffee is $2.75. If John bought 4 cups of coffee and gave the cashier $15, how much change did he receive?
def solve() -> int: total_cost = 2.75*4 change = 15 - total_cost result = change return result
After 10 hours of teaching 45% of the substitute teachers who showed up at 7 AM left. How many teachers showed up at the start?
def solve() -> int: num_left_after_10hr = 0.45 num_left = num_left_after_10hr * 3 result = num_left / (1 - num_left_after_10hr) return result
A grocery store sells an apple for 50 cents and an orange for 60 cents. If a customer bought 2 apples and 3 oranges, what was their total cost?
def solve() -> int: apple_cost = 0.5 orange_cost = 0.6 num_apples = 2 num_oranges = 3 total_cost = (apple_cost * num_apples) + (orange_cost * num_oranges) result = total_cost return result
If you have 90 apples and give away one third of them, how many apples will you have remaining?
def solve() -> int: no_of_apples = 90 no_of_given_apples = no_of_apples // 3 no_of_remaining_apples = no_of_apples - no_of_given_apples result = no_of_remaining_apples return result
Student: A family has 3 children and each child requires 2 apples a day, all apples cost $2 each. How much money would the family need to spend to last them for 10 days?
def solve() -> int: num_children = 3 num_apples_per_child = 2 cost_per_apple = 2 num_days = 10 total_num_apples = num_children * num_apples_per_child * num_days total_cost = total_num_apples * cost_per_apple result = total_cost return result
A group of 6 kids are each given 3 pieces of candy. Then, 7 more kids join and everyone shares their candy equally. How many pieces of candy does each kid get?
def solve() -> int: kids = 6 candy_per_kid = 3 total_candy = kids * candy_per_kid new_kids = 7 total_kids = kids + new_kids candy_per_kid = total_candy / total_kids result = candy_per_kid return result
A train travels 120 miles at a speed of 60 miles per hour. How long does the train take to make the journey?
def solve() -> int: distance = 120 speed = 60 time = distance/speed result = time return result
Wendy has 700 pieces of art supplies and wants to divide them into groups of five. How many pieces of art supplies will be left over?
def solve() -> int: total_pieces = 700 group_size = 5 total_groups = total_pieces // group_size remaining_pieces = total_pieces % group_size result = remaining_pieces return result
Liam and Emily went to the pancake house and both ordered pancakes for breakfast. Liam also ordered bacon for $2 and a milkshake for $5. Emily ordered a coffee for $2. Liam's bill was one and a half times as much as Emily's bill. What was the total cost of their breakfast?
def solve() -> int: liam_pancakes = 1 liam_bacon = 2 liam_milkshake = 5 emily_pancakes = 1 emily_coffee = 2 liam_bill = liam_pancakes + liam_bacon + liam_milkshake emily_bill = emily_pancakes + emily_coffee liam_bill = liam_bill * 1.5 total_cost = liam_bill + emily_bil...
Bill and Tom are running a 5k race. Bill can run 5k in 24 minutes. Tom can run 5k in 28 minutes. If they start at the same time, how long would it take until Tom catches up to Bill(assuming they both run at a constant pace)?
def solve() -> int: distance = 5 speed_Bill = distance / (24/60) speed_Tom = distance / (28/60) time = distance / (speed_Tom - speed_Bill) result = time return result
A spacecraft is about to embark on its mission to explore a galaxy outside of the Milky Way. The spacecraft is equipped with a fuel tank that can hold up to 300 liters of fuel. How much fuel will be needed to complete a trip that is 900,000 kilometers in length?
def solve() -> int: distance = 900000 liters_per_km = 0.000003 fuel_needed = distance * liters_per_km result = fuel_needed return result
For a college project, Sarah is researching the number of ducks in a local park. She counted 150 ducks, but 10 of them flew away before she could document them. Next year, Sarah wants to research a park that's twice the size of her current park. If she estimates that the same amount of ducks live in the new park, how m...
def solve() -> int: ducks_in_current_park = 150 ducks_flew_away = 10 ducks_in_new_park = ducks_in_current_park * 2 - ducks_flew_away result = ducks_in_new_park return result
Bob has a garden with a perimeter of 60 meters. One side of the garden is 10 meters long. What is the length of the other 3 sides?
def solve() -> int: each_side = (60-10)/3 result = each_side return result
Signs are placed on a highway at regular intervals to help drivers monitor how far they have traveled. If a driver reaches the sixth sign, they have driven 60 miles. How many miles from the starting point is the seventh sign?
def solve() -> int: signs = 6 miles = 60 miles_per_sign = miles / signs seventh_sign_miles = miles_per_sign * 7 result = seventh_sign_miles return result
A grocery store has 60 apples, 35 pears, and 20 oranges. If the store wants to have a total of 75 fruits in stock, how many more fruits does it need?
def solve() -> int: total_fruits = 75 existing_fruits = 60 + 35 + 20 fruits_needed = total_fruits - existing_fruits result = fruits_needed return result
If a car can travel 30 miles per gallon and it has a gas tank that can hold up to 20 gallons of gasoline, how far can the car travel on a full tank of gas?
def solve() -> int: miles_per_gallon = 30 gas_tank_capacity = 20 distance_traveled = miles_per_gallon * gas_tank_capacity result = distance_traveled return result