question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
On Monday, a store sold 40 bottles of milk. Each of the bottles sold was $2.50. On Tuesday, the store sold half of the number of bottles sold on Monday, but the price had increased to $3.50 per bottle. What was the total sales of the two days?
def solve() -> int: monday_sales = 40 * 2.5 tuesday_sales = (40/2) * 3.5 total_sales = monday_sales + tuesday_sales result = total_sales return result
A company sells a product for $100. If they increase the price by 20%, how much will the new price be?
def solve() -> int: price_increase = 0.2 * 100 new_price = 100 + price_increase result = new_price return result
Maria has a rectangular garden that is 8 meters long and 6 meters wide. She wants to plant flowers along the perimeter of the garden. Each flower needs 20 centimeters of space and costs $0.75. How much will Maria spend on the flowers?
def solve() -> int: perimeter = 8 + 8 + 6 + 6 perimeter = perimeter * 100 number_of_flowers = perimeter / 20 total_cost = number_of_flowers * 0.75 result = total_cost return result
Michael is organizing a charity event and he needs to transport several boxes of books to a remote village. The transport vehicle has a weight limitation. If each box weighs 18 kilograms, and the maximum load capacity of the transport vehicle is 2500 kilograms, how many boxes can Michael transport at a time?
def solve() -> int: box_weight = 18 max_load_capacity = 2500 boxes_transportable = max_load_capacity // box_weight result = boxes_transportable return result
Adam and Jane are gardeners. On average, Adam plants eight less than three times as many flowers per day as Jane, while Jane plants twice as many flowers per day as there are months in a year. How many flowers does Adam plant per year if Jane plants fifty flowers per day?
def solve() -> int: jane_flowers_per_day = 12 adam_flowers_per_day = 3 * jane_flowers_per_day - 8 adam_flowers_per_year = adam_flowers_per_day * 365 result = adam_flowers_per_year return result
A school is organizing a fundraiser where each student will sell $50 worth of cookies. If there are 300 students in the school, how much money will the school raise?
def solve() -> int: students = 300 selling_price = 50*students result = selling_price return result
Lisa makes a bank transfer of $295 and $105 respectively. There is a service charge of 1.9% added to each transaction. What is her account balance now if it was $5100 before she made any of the transfers?
def solve() -> int: amount_trans1 = 295 percent_trans1 = 0.019 amount_trans2 = 105 percent_trans2 = 0.019 total_amount = amount_trans1 + amount_trans2 total_percent = (amount_trans1 * percent_trans1) + (amount_trans2 * percent_trans2) remaining = 5100 - (total_amount + total_percent) ...
Lisa is planning a road trip. She needs to drive 200 miles per day for 5 days. She has already driven 150 miles today. How many more miles does she need to drive to complete her trip?
def solve() -> int: miles_per_day = 200 days = 5 miles_today = 150 total_miles = miles_per_day * days miles_left = total_miles - miles_today result = miles_left return result
Karen wants to run 5 miles, but she can only run 1 mile without stopping. How many more miles does she need to run without stopping to reach her goal?
def solve() -> int: total_distance = 5 distance_without_stopping = 1 remaining_distance = total_distance - distance_without_stopping result = remaining_distance return result
Student: Matthew planted 39 miniature trees, 25 medium-sized trees, and 15 large trees in a nursery. If the miniature trees have a 45% chance of growth, the medium-sized trees have a 65% chance of growth, and the large trees have a 75% chance of growth, how many of Matthew's trees will grow?
def solve() -> int: mini_trees = 39 med_trees = 25 large_trees = 15 mini_growth_chance = 0.45 med_growth_chance = 0.65 large_growth_chance = 0.75 num_mini_trees_grow = mini_trees * mini_growth_chance num_med_trees_grow = med_trees * med_growth_chance num_large_trees_grow = large_tree...
Grace is throwing a party and wants to decorate her backyard with string lights. One string of lights is 20 feet long and can cover a 100 square foot area. Her backyard is 60 feet long and 40 feet wide. How many strings of lights does Grace need to decorate the entire backyard?
def solve() -> int: backyard_length = 60 backyard_width = 40 string_length = 20 string_coverage = 100 backyard_area = backyard_length * backyard_width strings_needed = backyard_area / string_coverage / (string_length / 20) result = strings_needed return result
A florist had 200 flowers in their shop. Every day, 25 flowers were sold. After a week, the florist added 50 more flowers to the shop. A week later, the florist found a worm among the flowers. If there were 300 flowers initially, how many flowers are left when the florist discovered the worm?
def solve() -> int: initial_flowers = 300 flowers_sold_per_day = 25 flowers_added = 50 flowers_left_after_week = initial_flowers - (flowers_sold_per_day * 7) total_flowers = flowers_left_after_week + flowers_added flowers_left = total_flowers - 1 result = flowers_left ...
David loves running and aims to complete 8 miles per day for a week. If he runs at least 56 miles in a week, he gets a 20% bonus on his distance covered. How many miles did David actually run if he aimed to run for 70 miles in a week?
def solve() -> int: weekly_goal = 8 * 7 miles_ran = 70 if miles_ran >= 56: distance_covered = weekly_goal + (weekly_goal * 0.2) else: distance_covered = miles_ran result = distance_covered return result
A triangle has a perimeter of 24 cm. One of its sides is twice the smallest side and the third side has a length of 7 cm. How long is the smallest side?
def solve() -> int: perimeter = 24 side3 = 7 side1 = 2*side3/5 side2 = perimeter - side1 - side3 result = side1 return result
Leo runs 5 kilometers every day. He wants to increase his distance by 10% each week. How far will he run on the seventh day of the fourth week?
def solve() -> int: distance = 5 rate = 1.1 for week in range(1, 5): distance = distance * rate result = distance return result
A pizza restaurant has 10 tables with 4 chairs each. If every table has at least 2 people eating, how many customers can the restaurant serve at once?
def solve() -> int: num_tables = 10 chairs_per_table = 4 min_customers_per_table = 2 total_chairs = num_tables * chairs_per_table total_customers = num_tables * min_customers_per_table result = total_customers return result
Tom always runs 5 kilometers in 30 minutes. Today, he wants to complete 10 kilometers. How long (in minutes) will it take him?
def solve() -> int: time = 30 * 2 result = time return result
If Ryan weighs 30 pounds more than Melissa, and Ryan weighs two-thirds as much as Sean, and Melissa weighs 110 pounds, how many pounds do Ryan and Sean weigh together?
def solve() -> int: melissa_weight = 110 ryan_weight = melissa_weight + 30 sean_weight = (ryan_weight * 3) / 2 total_weight = ryan_weight + sean_weight result = total_weight return result
If there are 120 classes required to earn 240 credits, how many credits does each coursework offers? A hotel has 20 floors and each floor has 30 rooms. If the hotel is fully booked, how many rooms are occupied?
def solve() -> int: classes_required = 120 total_credits = 240 credits_per_coursework = total_credits / classes_required floors = 20 rooms_per_floor = 30 total_rooms = floors * rooms_per_floor occupied_rooms = total_rooms result = occupied_rooms return result...
In a classroom, there are 30 students and each student has 10 pens. How many pens are there in total?
def solve() -> int: students = 30 pens_per_student = 10 total_pens = students*pens_per_student result = total_pens return result
Evan's car has 6 more scratches than Emily's bike. Sarah's truck has 30 more scratches than Evan's and Emily's vehicles combined. If Sarah's truck has 90 scratches, how many scratches are on Evan's car?
def solve() -> int: evans_car_scratches = 0 emilys_bike_scratches = 0 sarahs_truck_scratches = 90 evans_car_scratches = emilys_bike_scratches + 6 sarahs_truck_scratches = evans_car_scratches + emilys_bike_scratches + 30 result = evans_car_scratches return result
A recipe calls for 2 cups of flour and 3 eggs to make 6 muffins. If you want to make 20 muffins, how much flour and how many eggs will you need?
def solve() -> int: recipe_muffins = 6 recipe_flour = 2 recipe_eggs = 3 needed_muffins = 20 needed_flour = recipe_flour * needed_muffins / recipe_muffins needed_eggs = recipe_eggs * needed_muffins / recipe_muffins result = (needed_flour, needed_eggs) return result
A theme park had 1000 visitors on Monday. On Tuesday, it had 50% more visitors than on Monday. On Wednesday, it had 25% less visitors than on Tuesday. On Thursday, it had 1200 visitors, which is 20% more than on Tuesday. On Friday, it had 10% less visitors than on Monday. How many visitors did the theme park have in to...
def solve() -> int: visitors_monday = 1000 visitors_tuesday = 1.5*visitors_monday visitors_wednesday = 0.75*visitors_tuesday visitors_thursday = 1.2*visitors_tuesday visitors_friday = 0.9*visitors_monday total_visitors = visitors_monday + visitors_tuesday + visitors_wednesday + visitors_thursday...
A tank can hold 1500 liters of water. If it is currently 60% full, how many liters of water can be added to fill it completely?
def solve() -> int: max_capacity = 1500 percent_full = 60 current_capacity = max_capacity * percent_full / 100 remaining_capacity = max_capacity - current_capacity result = remaining_capacity return result
A cell phone plan costs $20 per month plus an additional 5 cents per minute of talk time. If the bill for one month was $25, how many minutes of talk time were used?
def solve() -> int: bill = 25 monthly_cost = 20 per_minute_cost = 0.05 minutes = (bill - monthly_cost) / per_minute_cost result = minutes return result
A company sold 150 items last month, which generated $5000 in revenue. If each item was sold for the same price, how much was each item sold for?
def solve() -> int: number_of_items = 150 total_revenue = 5000 price_per_item = total_revenue / number_of_items result = price_per_item return result
Erin has 21 earrings, which is 7 more than twice as many earrings as Elsa has. Evan has half as many earrings as Elsa. How many earrings does Evan have?
def solve() -> int: erin = 21 elsa = (erin - 7) / 2 evan = elsa / 2 result = evan return result
Karen has 100 pieces of candy, she wants to share them among 5 of her friends. If each of her friends wants to have 20 pieces, how many pieces will she have left for herself?
def solve() -> int: pieces_each_friend = 20 total_pieces_needed = 5 * pieces_each_friend pieces_left = 100 - total_pieces_needed result = pieces_left return result
Dylan spends $1,000 a year on concert tickets. Bella spends $50.00 on a concert once a month. How much more does Dylan spend on concerts each year than Bella?
def solve() -> int: dylan_yearly_spending = 1000 bella_monthly_spending = 50 bella_yearly_spending = bella_monthly_spending * 12 difference = dylan_yearly_spending - bella_yearly_spending result = difference return result
Ms. Wilson has 27 pieces of candy. She wants to divide them equally among 9 students. How many pieces of candy will each student receive?
def solve() -> int: candy = 27 students = 9 pieces_per_student = candy / students result = pieces_per_student return result
Carlos wants to make sandwiches for his picnic. He needs to buy bread in loaves of 16 slices and needs a total of 64 slices. Bread costs $3 per loaf. How much will Carlos spend on bread?
def solve() -> int: bread_slices_per_loaf = 16 total_slices_needed = 64 loaves_needed = total_slices_needed // bread_slices_per_loaf cost_per_loaf = 3 total_cost = loaves_needed * cost_per_loaf result = total_cost return result
There are 20 different colors of M&Ms in a jar. Four of them are blue. Half of the rest are red. Three of the remaining are green. Half of the rest are yellow. How many colors of M&Ms are there with only one piece in the jar?
def solve() -> int: total_colors = 20 blue = 4 rest = total_colors - blue red = rest / 2 remaining = rest - red green = 3 remaining = remaining - green yellow = remaining / 2 one_piece = blue + red + green + yellow result = one_piece return result
Jim invested $5000 at an interest rate of 4% per annum. How much will he earn in 2 years?
def solve() -> int: principal = 5000 interest_rate = 4 time = 2 interest_earned = principal * (interest_rate/100) * time result = interest_earned return result
Sarah has 50 marbles. She gives away 10 marbles each to her neighbors, until she only has 20 marbles left. How many neighbors does Sarah have?
def solve() -> int: marbles = 50 give_away = 10 keep = 20 times_give_away = (marbles - keep) / give_away neighbors = times_give_away + 1 result = neighbors return result
A company's employee base increases by 20% every year. If it had 100 employees in the first year, how many employees will it have in the 8th year?
def solve() -> int: years = 8 increase_percent = 20 starting_employees = 100 final_employees = round(starting_employees * (1+(increase_percent/100))**years) result = final_employees return result
Last year, David bought a box of chocolates. Every day he ate one-twelfth of the remaining chocolates. After eating one-twelfth of the remaining chocolates on the 365th day, he now has 4 chocolates left. How many chocolates were in the box when David bought it?
def solve() -> int: remaining_chocolates = 4 days = 365 for day in range(days): remaining_chocolates -= remaining_chocolates / 12 result = remaining_chocolates return result
Student: Tanya is organizing a book drive to fundraise for the local library. She collects a total of 435 books. She decides to keep 10% of the books for herself, and donate the rest to the library. How many books does Tanya keep for herself?
def solve() -> int: total_books = 435 percent = 10 books_to_keep = total_books * percent / 100 books_to_keep = int(books_to_keep) result = books_to_keep return result
If a bird's beak is one-twelfth its body's length, and the bird is 24 inches long, what is the length of the bird's body beyond the beak?
def solve() -> int: beak_length = 24 / 12 body_length = 24 - beak_length result = body_length return result
After his surgery, William lost some of his athletic abilities. He used to swim 2 km within 45 minutes, but now he only swims 75% of the distance. How long does it take for him to swim 2 km now?
def solve() -> int: distance = 2 old_time = 45 new_distance = distance * 0.75 new_time = (old_time / distance) * new_distance result = new_time return result
A rectangle has a perimeter of 36 cm and a width of 6 cm. What is the area of the rectangle?
def solve() -> int: length = (36 - 2 * 6) / 2 area = length * 6 result = area return result
Eight energy drinks cost as much as two bottles of wine. Twelve energy drinks cost $144. If Tina wants to buy one bottle of wine and fourteen energy drinks, how much will be left in her $200?
def solve() -> int: energy_drinks_cost = 144 / 12 wine_cost = 8 * energy_drinks_cost total_cost = wine_cost + 14 * energy_drinks_cost remaining_money = 200 - total_cost result = remaining_money return result
A train moves at a rate of 50 miles per hour while a bus moves at a rate of 30 miles per hour. If they both started travelling at the same time and their destination is 500 miles away, how many hours ahead will the train be when it reaches the destination?
def solve() -> int: train_speed = 50 bus_speed = 30 distance = 500 total_speed = train_speed + bus_speed time = distance / total_speed train_time = distance / train_speed bus_time = distance / bus_speed train_ahead_time = train_time - time result = train_ahead_time ...
Miles needs to travel 240 km. He can travel 40 km with 2 liters of fuel. How many liters of fuel will he need to travel the whole distance of 240 km?
def solve() -> int: distance_travelled = 40 fuel_used = 2 ratio = 240/distance_travelled fuel_needed = ratio*fuel_used result = fuel_needed return result
Ed wants to make 12 chocolate balls. Each ball requires 3 tablespoons of chocolate. How many tablespoons of chocolate does he need?
def solve() -> int: total_balls = 12 tbsp_per_ball = 3 total_tbsp_needed = total_balls*tbsp_per_ball result = total_tbsp_needed return result
If Tom has $45 and spends $9 every week, after how many weeks will he have no money left?
def solve() -> int: tom_money = 45 weekly_spending = 9 num_weeks = tom_money//weekly_spending result = num_weeks return result
ally runs 3 miles each day and increases her distance by half a mile each week. After 4 weeks, how many miles does she run in total?
def solve() -> int: distance_per_week = 0.5 total_distance = 3*4 for i in range(4): total_distance += distance_per_week*(i+1) result = total_distance return result
Student: Chen is the best runner in the track team. He runs an average of 10 kilometers per day, and his teammates run an average of 8 kilometers per day. How many kilometers will their team run in total after 12 days?
def solve() -> int: chen_km = 10 team_km = 8 days = 12 chen_total = chen_km * days team_total = team_km * days team_total = chen_total + team_total result = team_total return result
The artist made 3 paintings and 5 sculptures. Each painting has 20 canvases and each sculpture has 50 clay pieces. If the artist sold all of their artwork, how many canvases and clay pieces did they sell in total?
def solve() -> int: paintings = 3 sculptures = 5 canvases_per_painting = 20 clay_pieces_per_sculpture = 50 total_canvases = paintings * canvases_per_painting total_clay_pieces = sculptures * clay_pieces_per_sculpture result = total_canvases + total_clay_pieces return resul...
Wendi's rabbits can each eat 12 square kilometers of grass per day. If she owns 600 rabbits, how many square kilometers of grass will they need in 8 days?
def solve() -> int: rabbits = 600 sq_km = 12 days = 8 sq_km_total = rabbits * sq_km * days result = sq_km_total return result
A pool is filled by two hoses. If Hose A can fill the pool in 6 hours and Hose B can fill the pool in 8 hours, how long would it take to fill the pool with both hoses on at the same time?
def solve() -> int: hours_to_fill = 1/((1/6)+(1/8)) result = hours_to_fill return result
The price of an item was $12 before tax. After tax, the price rose by 25%. How much is the item now (including tax)?
def solve() -> int: price = 12 tax = 25 total = price * (1 + tax/100) result = total return result
A recipe calls for 2 cups of flour for every 1 cup of sugar. If you need 6 cups of flour, how much sugar do you need?
def solve() -> int: flour_needed = 6 flour_to_sugar_ratio = 2/1 sugar_needed = flour_needed / flour_to_sugar_ratio result = sugar_needed return result
Samantha got 87 and 92 in two math tests. What is the average of her grades?
def solve() -> int: test1_grade = 87 test2_grade = 92 average_grade = (test1_grade + test2_grade)/2 result = average_grade return result
A company has 100 employees on payroll. If 10% of them are managers, and 30% of the remaining employees are supervisors, and the company has a total of 40 managers and supervisors, how many employees are not managers or supervisors?
def solve() -> int: managers = 100 * 0.1 supervisors = (100 - managers) * 0.3 non_managers_or_supervisors = 100 - managers - supervisors - 40 result = non_managers_or_supervisors return result
Possible questions and programs are: Jack earns $15 per hour working at a bookstore. Last week, he worked 20 hours and received a $50 bonus. This week, he works 24 hours and receives a $60 bonus. What is his average hourly income for these two weeks?
def solve() -> int: income1 = 15 * 20 + 50 income2 = 15 * 24 + 60 total_income = income1 + income2 total_hours = 20 + 24 average_income = total_income / total_hours result = average_income return result
A circle has a diameter of 8 inches. What is the circumference of the circle?
def solve() -> int: diameter = 8 circumference = diameter * 3.14159 result = circumference return result
Alex wants to buy a new phone that costs $700. If he has $400 saved up, how much more does he need to save to buy the phone?
def solve() -> int: cost_of_phone = 700 saved_up = 400 amount_needed = cost_of_phone - saved_up result = amount_needed return result
Student: Q5: Gideon collected 150 berries during his hike. He ate 20% of the berries, how many did he have left?
def solve() -> int: total_berries = 150 percent_eaten = 0.2 berries_eaten = total_berries * percent_eaten berries_left = total_berries - berries_eaten result = berries_left return result
Rachel has a pool that is 22 feet long and 13 feet wide. How many square feet is the surface area of the pool?
def solve() -> int: length = 22 width = 13 area = length * width result = area return result
A store sells shirts for $15 each and pants for $25 each. If John buys 2 shirts and 3 pants, how much does he spend in total?
def solve() -> int: total_spent = 2 * 15 + 3 * 25 result = total_spent return result
Rachel buys pens for $10 per box and sells them for $15 per box. Each box contains 20 pens. How much money will Rachel make if she buys 5 boxes and sells all the pens?
def solve() -> int: buy_price = 10 sell_price = 15 pens_per_box = 20 num_boxes = 5 total_pens = pens_per_box * num_boxes profit_per_pen = sell_price - buy_price total_profit = total_pens * profit_per_pen result = total_profit return result
san has a square kitchen that is 10 feet on each side. She increases the area of the kitchen by 30%. She then wants to put a backsplash on 3 of the kitchen walls that goes up to a height of 2 feet. What is the total area of the kitchen and the backsplash in square feet?
def solve() -> int: side = 10 area = side ** 2 percent_increase = 0.3 increased_area = area * (1 + percent_increase) backsplash_height = 2 backsplash_area = 3 * side * backsplash_height total_area = increased_area + backsplash_area result = total_area return result
A bicycle moves a distance of 48 kilometers in 3 hours and 45 minutes. What is the speed of the bicycle in kilometers per hour?
def solve() -> int: distance = 48 hours = 3 + 45/60 speed = distance/hours result = speed return result
Mark is shopping for toys. He sees a store advertising 10 toys for $20 and another one advertising 3 toys for $6. Assuming there's no price discount for buying in bulk, how much would Mark spend in cents if he bought 18 of the cheaper of the two toys?
def solve() -> int: toys1_quantity = 10 toys1_price = 20 toys2_quantity = 3 toys2_price = 6 cheaper_toys_quantity = min(toys1_quantity, toys2_quantity) cheaper_toys_price = min(toys1_price, toys2_price) total_cost = cheaper_toys_quantity * cheaper_toys_price * 100 result =...
Sally tutors students after school and her rate varies. She charged $30 for the first student, $50 for the second, and $20 for the third. What should she charge for the fourth student if she wants to earn an average of $40 per student?
def solve() -> int: first_student = 30 second_student = 50 third_student = 20 average_earning = 40 total_earning = first_student + second_student + third_student num_students = 3 fourth_student = (average_earning * (num_students + 1)) - total_earning result = fourth_studen...
Lucy's mansion has 16 rooms. Nathan's mansion has 2 times as many rooms as Lucy's mansion. Harper's mansion has 1/8 as many rooms as Nathan's mansion. How many rooms does Harper's mansion have?
def solve() -> int: lucys_rooms = 16 nathans_rooms = 2 * lucys_rooms harpers_rooms = nathans_rooms / 8 result = harpers_rooms return result
Student: A soccer team played 20 games and won 12. What percentage of games did they win?
def solve() -> int: games_played = 20 games_won = 12 percentage_won = games_won / games_played * 100 result = percentage_won return result
John has to read 200 pages of a book. If he has read 80 pages, what percentage of the book does he still have to read?
def solve() -> int: total_pages = 200 pages_read = 80 pages_left = total_pages - pages_read percent_left = (pages_left/total_pages)*100 result = percent_left return result
Alice is organizing a charity event. She has 20 volunteers, and each volunteer can pack 8 bags of food in an hour. How many bags of food can be packed in total in 6 hours?
def solve() -> int: volunteers = 20 bags_per_hour = 8 hours = 6 total_bags_packed = volunteers * bags_per_hour * hours result = total_bags_packed return result
John gets 30 guitar lessons. He gets the first 2 lessons free and after the first 20 paid lessons he only needs to pay for every fourth lesson. Each lesson is $7. His grandparents pay for half. How much does John pay?
def solve() -> int: lessons = 30 free_lessons = 2 paid_lessons = lessons - free_lessons discounted_lessons = (paid_lessons - 20) // 4 + 1 total_cost = (paid_lessons - discounted_lessons) * 7 + discounted_lessons * 7 / 2 result = total_cost return result
Rachel has 110 toys. 50% of her toys are stuffed animals. Rachel wants to place a fifth of her stuffed animals on the bed. If each stuffed animal is 12 inches long, how many inches in total are on the bed?
def solve() -> int: toys = 110 stuffed_animals = toys * 0.5 stuffed_animals_on_bed = stuffed_animals * 0.2 inches_on_bed = stuffed_animals_on_bed * 12 result = inches_on_bed return result
In a zoo, there are 300 reptiles. 60% of them are snakes. Among the snakes, 30% are male. If there are 30 female boa constrictors, how many male snakes are there?
def solve() -> int: reptiles = 300 snakes = reptiles * 0.6 male_snakes = snakes * 0.3 female_boa_constrictors = 30 male_snakes = male_snakes - female_boa_constrictors result = male_snakes return result
40% of the cars in a parking lot are blue. 25% are red. If there are 80 cars in the parking lot, how many fewer are red than blue?
def solve() -> int: blue = 0.4 * 80 red = 0.25 * 80 difference = blue - red result = difference return result
Frank can earn $20 per hour when he works in the morning and $17 per hour when he works in the afternoon. If he works 7 hours in the morning and 4 hours in the afternoon, how many dollars will Frank earn?
def solve() -> int: a = 20 b = 17 c = 7 d = 4 result = (a*c) + (b*d) return result
5. Mark has 8 boxes of batteries that will last for 4 hours each. How many hours will the batteries last in total?
def solve() -> int: numBoxes = 8 hoursPerBox = 4 totalHours = numBoxes * hoursPerBox result = totalHours return result
There are 16 ounces in a pound and 2.2 pounds in a kilogram. Tara buys 5 kilograms of apples. In ounces, how much do the apples weigh?
def solve() -> int: weight_pounds = 5 * 2.2 weight_ounces = weight_pounds * 16 result = weight_ounces return result
Carla had $75. She spent $20 on dinner and $35 on clothes. How much money does she have left?
def solve() -> int: starting_money = 75 dinner_cost = 20 clothes_cost = 35 remaining_money = starting_money - dinner_cost - clothes_cost result = remaining_money return result
Stephen is trying to count the cars in the parking lot, but they keep leaving so he double-counts 2 SUVs and forgets to count 5 sedans. If Stephen thinks there are 30 cars, how many are there really?
def solve() -> int: suv_count = 2 sedan_count = 5 stephens_count = 30 total_count = stephens_count - suv_count + sedan_count result = total_count return result
There are 1000 bacteria in a petri dish. Each hour, the number of bacteria increases by 50%, but 200 bacteria are always killed by a chemical. How many hours will it take for the number of bacteria to reach 5000?
def solve() -> int: bacteria = 1000 hours = 0 while bacteria < 5000: bacteria = bacteria * 1.5 bacteria = bacteria - 200 hours = hours + 1 result = hours return result
Student: A rectangle has a length of 15 meters and a width of 8 meters. What is the perimeter of the rectangle?
def solve() -> int: length = 15 width = 8 perimeter = 2 * (length + width) result = perimeter return result
Ms. Wang is a nurse and works 40 hours per week. She earns $28 per hour and receives a bonus of $500 every three months. She spends $1200 per month on rent, $600 per month on food, and $300 per month on other expenses. How much money can she save in a year?
def solve() -> int: hourly_rate = 28 work_hours = 40 weeks = 52 bonus = 500 months = 3 rent = 1200 food = 600 other = 300 income = hourly_rate * work_hours * weeks / 12 bonus_income = bonus * 12 / months total_income = income + bonus_income total_expenses = (rent + fo...
ome possible new questions and programs are: Amir and his brother Nabil love to play video games. On Monday, Amir played 15 minutes more than Nabil, who played for 45 minutes. On Tuesday, Nabil played twice as long as he did on Monday, while Amir played half as long as he did on Monday. On Wednesday, they both played t...
def solve() -> int: amir_monday = 45 + 15 nabil_monday = 45 amir_tuesday = amir_monday / 2 nabil_tuesday = nabil_monday * 2 amir_wednesday = amir_tuesday nabil_wednesday = nabil_tuesday amir_total = amir_monday + amir_tuesday + amir_wednesday nabil_total = nabil_monday + n...
Timmy has three cats and four dogs. Each dog has twice as many legs as a cat. How many legs are there in total?
def solve() -> int: num_cats = 3 num_dogs = 4 legs_per_cat = 4 legs_per_dog = legs_per_cat * 2 total_legs = (num_cats * legs_per_cat) + (num_dogs * legs_per_dog) result = total_legs return result
Result: (2, 3, 1) A rectangular box has a length of 6 meters, a width of 4 meters, and a height of 2 meters. What is the surface area of the box?
def solve() -> int: length = 6 width = 4 height = 2 surface_area = 2 * (length*width + length*height + width*height) result = surface_area return result
Kim and Lee are making bracelets. Kim can make 4 bracelets in an hour, while Lee can make 6 bracelets in an hour. They work together for 3 hours. How many bracelets did they make in total?
def solve() -> int: x = 12 result = x + 1.5*x return result
Catherine has a total of 150 pencils. She wants to put them in boxes of 20 pencils each. How many boxes will she need?
def solve() -> int: boxes = 150 // 20 result = boxes return result
If a car traveled 400 miles in 40 minutes, what was the average speed of the car?
def solve() -> int: distance = 400 time = 40 average_speed = distance/time result = average_speed return result
If a book has a height of 10 inches and contains 300 pages, how many books of the same size would have a total of 1800 pages?
def solve() -> int: book_height = 10 book_pages = 300 total_pages = 1800 books_needed = total_pages / book_pages result = books_needed return result
He gives the cashier a $20 bill and gets back a $5 bill two quarters, three dimes, and a nickel. How many pennies does he get in his change?
def solve() -> int: price_shorts = 7.75 price_peanutbutter = 5.15 price_juice = 3.99 total_price = price_shorts + price_peanutbutter + price_juice change = 20 - total_price five_bill = 1 * 5 quarters = 2 * 0.25 dimes = 3 * 0.10 nickels = 1 * 0.05 total_change = five_bill + quarte...
John had 35 apples which is 10 more than what Maria had. If John gave Maria 18 apples, how many apples does John have now?
def solve() -> int: john_apples = 35 maria_apples = john_apples - 10 john_apples -= 18 result = john_apples return result
A squirrel scurries through a grove and is accompanied by a party of 5 birds. 2 chipmunks follow each bird and 4 mice join each chipmunk. How many animals are scurrying through the grove?
def solve() -> int: birds = 5 chipmunks = birds * 2 mice = chipmunks * 4 total_animals = 1 + birds + chipmunks + mice result = total_animals return result
4. Steve is 15 years old. If his age is tripled in 4 years, how old will he be then?
def solve() -> int: age_now = 15 time_span = 4 age_multiplier = 3 result = age_now * (age_multiplier ** time_span) return result
Student: A family goes out to dinner and the bill comes out to $67.50. If they want to leave a 20% tip, how much will the total bill be?
def solve() -> int: bill = 67.50 tip_percent = 0.20 tip_amount = bill * tip_percent total_bill = bill + tip_amount result = total_bill return result
Amy and her friend Jack want to go on a trip that costs $120. They decided to make and sell their own jewelry. Each bracelet costs $5 to make and they can sell each bracelet for $10. How many bracelets will they need to make and sell for both to be able to afford the trip?
def solve() -> int: bracelet_cost = 5 bracelet_price = 10 total_cost = 120 number_of_bracelets = (total_cost / (bracelet_price - bracelet_cost)) result = round(number_of_bracelets) return result
Emily spends $200 a month on rent. Her lease is 12 months long. She wants to save up for a new car by delivering pizzas for $8 per delivery. How many deliveries does she need to make per month to save up for her new car?
def solve() -> int: rent_per_month = 200 lease_length = 12 total_rent = rent_per_month * lease_length pizza_delivery_fee = 8 car_cost = 10000 total_savings_needed = car_cost - total_rent deliveries_per_month = total_savings_needed / pizza_delivery_fee result = deliveries_p...
Adam bought 27 donuts and shared them with his 4 friends, how many donuts did each of his friends receive?
def solve() -> int: total_donuts = 27 friends = 4 result = total_donuts / friends return result
Mary bought two pairs of sandals for $35.50 each, two dresses for $43.00 each and a hat for $20.00 during her shopping. If she paid using a $100 bill, what is the amount of change she should receive?
def solve() -> int: total_cost = 2*35.50 + 2*43.00 + 20.00 change = 100 - total_cost result = change return result
A bus can hold 40 passengers. On a trip, the bus is 3/4 full. How many passengers are on the bus?
def solve() -> int: occupancy = 3/4 passengers = occupancy * 40 result = passengers return result
Student: - Jasper collects stamps from different countries. He has a total of 420 stamps in his album. He knows that 30% of them are from Asia, 25% are from Europe, 20% are from Africa, 15% are from the Americas, and 10% are from Oceania. He wants to rearrange his album so that the stamps are grouped by continent and t...
def solve() -> int: total_stamps = 420 stamps_asia = total_stamps * 0.3 stamps_europe = total_stamps * 0.25 stamps_africa = total_stamps * 0.2 stamps_americas = total_stamps * 0.15 stamps_oceania = total_stamps * 0.1 stamps_to_move = total_stamps - (stamps_asia + stamps_europe + stamps_afric...
Andrew goes to the gym every morning before work. He runs on the treadmill for 20 minutes, cycles for 15 minutes, and then swims for 30 minutes. How much time does it take him to finish his workout?
def solve() -> int: total_time = 20 + 15 + 30 result = total_time return result