question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Student: - Jay has 5 times as many cards as Ray, and Ray has 4 times as many cards as Kay. If Kay has 3 cards, how many cards does Jay have?
def solve() -> int: jay_cards = 0 ray_cards = 0 kay_cards = 3 ray_cards = kay_cards * 4 jay_cards = ray_cards * 5 result = jay_cards return result
Emily has a washing machine that uses 40 liters of water per wash cycle and she washes 3 loads of clothes per week. If she switches to a more efficient washing machine that uses 25% less water, how much water will she save in a week?
def solve() -> int: water_per_cycle = 40 loads_per_week = 3 water_saved_per_cycle = water_per_cycle * 0.25 water_saved_per_week = water_saved_per_cycle * loads_per_week result = water_saved_per_week return result
Student: Dan took $80 with him on a shopping trip. He used half of his money on clothes and had $14 left. He spent the remaining money on food and only had half of the money remaining after the purchase. How much did he spend on food?
def solve() -> int: money_taken = 80 money_left_after_clothes = 14 money_spent_on_clothes = money_taken - money_left_after_clothes money_left_after_food = money_left_after_clothes / 2 money_spent_on_food = money_left_after_clothes - money_left_after_food result = money_spent_on_food return ...
Student: Lucie biked for 6 hours at an average speed of 12 miles per hour. Nadia biked for 4 hours at 15 miles per hour. How many more miles did Nadia bike than Lucie?
def solve() -> int: lucie_time = 6 lucie_speed = 12 nadia_time = 4 nadia_speed = 15 lucie_distance = lucie_time * lucie_speed nadia_distance = nadia_time * nadia_speed result = nadia_distance - lucie_distance return result
A rectangular room has dimensions of 12 ft by 20 ft. If the room is completely tiled with 1 ft by 1 ft tiles, how many tiles will be needed?
def solve() -> int: length = 12 width = 20 area_of_room = length * width num_tiles_needed = area_of_room result = num_tiles_needed return result
Sarah has 30 marbles, 1/3 of which are red. If she gives away 40% of the marbles and keeps only the red ones, how many marbles will she have left?
def solve() -> int: marbles = 30 red_marbles = marbles * (1/3) given_away = marbles * (40/100) remaining_marbles = marbles - given_away remaining_red_marbles = remaining_marbles * (1/3) result = remaining_red_marbles return result
Lily is cycling. She covers 10 miles in the first hour, 7 miles in the second hour, and 12 miles in the third hour. What is her average speed in miles per hour (mph)?
def solve() -> int: distance_hour_one = 10 distance_hour_two = 7 distance_hour_three = 12 total_time = 3 total_distance = distance_hour_one + distance_hour_two + distance_hour_three average_speed = total_distance / total_time result = average_speed return result
ven went to the store and bought a box of markers for $21, a box of pencils for $12, and a ruler for $4. If the ruler was half the price of a box of markers, how much was a box of pencils?
def solve() -> int: price_markers = 21 price_ruler = 4 price_ruler_half_markers = price_markers / 2 total_price = price_markers + price_ruler total_price_markers = price_markers + price_ruler_half_markers price_pencils = total_price - total_price_markers result = price_pencils return re...
Student: A triangle has a base of 12 inches and a height of 5 inches. What is the area of the triangle?
def solve() -> int: base = 12 height = 5 area = (base * height) / 2 result = area return result
In seven years, Tom will be one third as old as Kate. If Tom's age is currently one-fifth of his father's age, who is 60, how old is Kate now?
def solve() -> int: father_age = 60 tom_age = father_age / 5 kate_age_in_seven_years = tom_age * 3 kate_age_now = kate_age_in_seven_years - 7 result = kate_age_now return result
If a box of cereals costs $3.50 and contains 12 servings, what is the cost per serving of cereal?
def solve() -> int: cost = 3.50 servings = 12 cost_per_serving = cost / servings result = cost_per_serving return result
Brian has a piece of fabric that is 15 meters long. He needs to cut the fabric into pieces that are 2.5 meters long. How many pieces of fabric can he get?
def solve() -> int: fabric_length = 15 piece_length = 2.5 pieces = fabric_length // piece_length result = pieces return result
A rectangle has a length of 10 cm and a width of 6 cm. What is the area of the rectangle?
def solve() -> int: length = 10 width = 6 area = length * width result = area return result
In a math competition, Alice got a total score of 450 points. She got 50 points less than twice the score of Bob. Bob got 100 points more than half the score of Cindy. How many points did Cindy get in the competition?
def solve() -> int: score_bob = (450 + 50) / 2 score_cindy = (score_bob - 100) * 2 result = score_cindy return result
A group of friends went to the movies. If the total cost of the tickets was $56 and each ticket cost $8, how many friends went to the movies?
def solve() -> int: num_friends = 56 / 8 result = num_friends return result
If a company has 20 employees, 40% of whom are managers, how many employees are not managers?
def solve() -> int: total_employees = 20 manager_percentage = 0.40 managers = total_employees * manager_percentage not_managers = total_employees - managers result = not_managers return result
Jessica spends 1/4 of her day swimming and 1/2 of the remaining time on studying. If she spent 120 minutes studying, how many minutes did she spend swimming?
def solve() -> int: total_time = 24 * 60 swimming_time = total_time * (1/4) remaining_time = total_time - swimming_time studying_time = remaining_time * (1/2) swimming_time = total_time - studying_time - remaining_time result = swimming_time return result
A company produces 3000 units of a product. If the production rate increases by 40%, how many units will they produce?
def solve() -> int: units = 3000 units *= 1.4 result = units return result
John has a total of $5000 in his bank account. If he wants to spend no more than 25% of his total money on a new laptop, how much can he spend on the laptop?
def solve() -> int: total_money = 5000 max_laptop_cost = total_money * 0.25 result = max_laptop_cost return result
Student: 7) In a survey of 300 people, 80% responded “yes” to a new policy. How many people said “yes”?
def solve() -> int: people = 300 percentage = 80 yes_people = people * (percentage/100) result = int(yes_people) return result
Alex can type 100 words in 10 minutes. Sarah can type 120 words within that same time. How many more words can Sarah type in 20 minutes than Alex?
def solve() -> int: alex_words_per_minute = 100 / 10 sarah_words_per_minute = 120 / 10 alex_words_in_20_minutes = alex_words_per_minute * 20 sarah_words_in_20_minutes = sarah_words_per_minute * 20 more_words_sarah_can_type = sarah_words_in_20_minutes - alex_words_in_20_minutes res...
Shawn completed 15 less-than 20 illustrations per day for 5 days. But every other day his little brother crumpled one of his illustrations. How many illustrations does Shawn have at the end of the 5 days?
def solve() -> int: illustrations_per_day = 20 days = 5 crumpled_illustrations = 0 for day in range(1, days+1): if day % 2 == 0: crumpled_illustrations += 1 illustrations_per_day -= 15 total_illustrations = illustrations_per_day * days - crumpled_illustrations ...
Abby's dad gave her 5 $10 bills to spend at the ice cream shop. Abby wants to buy 2 milkshakes, 4 sundaes, and 1 ice cream cake. Each milkshake costs $6, each sundae costs $4, and the ice cream cake costs $18. How much money, in dollars, will Abby have left over after the purchase?
def solve() -> int: num_bills = 5 cost_milkshake = 6 num_milkshakes = 2 cost_sundae = 4 num_sundaes = 4 cost_cake = 18 num_cakes = 1 total_cost = (cost_milkshake * num_milkshakes) + (cost_sundae * num_sundaes) + (cost_cake * num_cakes) money_left = (num_bills * 10) - total_...
Tom wanted to buy three books that cost $15 each. How much money will he need?
def solve() -> int: book_cost = 15 num_books = 3 total_cost = book_cost * num_books result = total_cost return result
A factory has 2500 workers. If 20% of them are on leave, how many workers are still working in the factory?
def solve() -> int: total_workers = 2500 leave_percent = 20 workers_on_leave = (leave_percent / 100) * total_workers workers_working = total_workers - workers_on_leave result = workers_working return result
In a jewelry store, 50 bracelets were sold on Thursday. On Friday, the number of bracelets sold was six times the amount sold on Thursday. How many bracelets were sold during these two days?
def solve() -> int: bracelets_thursday = 50 bracelets_friday = 6 * bracelets_thursday total_bracelets_sold = bracelets_thursday + bracelets_friday result = total_bracelets_sold return result
On Friday, John sold six of his magazines. On Tuesday, he sold two more than what he sold on Monday. How many magazines did John sell in total on Monday and Tuesday?
def solve() -> int: magazines_Friday = 6 magazines_Monday = 2 magazines_Tuesday = magazines_Monday + 2 sold_on_Monday_and_Tuesday = magazines_Monday + magazines_Tuesday result = sold_on_Monday_and_Tuesday return result
A pizza has 8 slices. If 3 people want to share the pizza equally, how many slices does each person get?
def solve() -> int: slices_per_pizza = 8 people_sharing = 3 slices_per_person = slices_per_pizza // people_sharing result = slices_per_person return result
If a rectangle has a width of 5 cm and an area of 45 cm², what is the length of the rectangle?
def solve() -> int: area_rectangle = 45 width = 5 length = area_rectangle / width result = length return result
In Mrs. Kim's class of 28 students, 2/7 of the students like basketball, 3/5 of the remaining students like soccer, and the rest of the students like volleyball. Calculate the combined total number of students who like volleyball and those who like soccer.
def solve() -> int: num_students = 28 basketball = 2/7 * num_students remaining_students = num_students - basketball soccer = 3/5 * remaining_students volleyball = remaining_students - soccer total = soccer + volleyball result = total return result
Vanessa, Victoria, and Valentina went on a vacation on Tuesday. In total, Victoria spent $86. If Valentina spent four times as much as Victoria, and Vanessa spent half as much as Valentina, how much money did they spend in total?
def solve() -> int: victoria_spent = 86 valentina_spent = 4 * victoria_spent vanessa_spent = valentina_spent / 2 total_spent = victoria_spent + valentina_spent + vanessa_spent result = total_spent return result
If a swimming pool loses 500 gallons of water in 7 days, how many gallons of water will it lose in 14 days?
def solve() -> int: water_loss_1 = 500 days_1 = 7 days_2 = 14 water_loss_2 = water_loss_1 * (days_2/days_1) result = water_loss_2 return result
A watermelon was cut into 40 slices. Seven kids bought 5 watermelons. If they all eat all 5 watermelons equally, how many slices of watermelon did each of them eat?
def solve() -> int: watermelon_slices = 40 number_of_watermelons = 5 number_of_kids = 7 total_slices_eaten = watermelon_slices * number_of_watermelons slices_eaten_per_kid = total_slices_eaten / number_of_kids result = slices_eaten_per_kid return result
A box contains 15 apples and 10 oranges. What is the probability of picking an apple at random?
def solve() -> int: num_apples = 15 num_fruits = 25 probability_of_apple = num_apples / num_fruits result = probability_of_apple return result
During a holiday party, a group of friends indulged in festive treats. Jamie ate a slice of apple pie and gained 5 pounds. Riley ate a gingerbread cookie and gained 2 pounds less than Jamie. Jordan ate a chocolate truffle and gained 3 pounds more than double what Riley gained. How much weight, in pounds, did the three ...
def solve() -> int: jamie_weight_gain = 5 riley_weight_gain = jamie_weight_gain - 2 jordan_weight_gain = (2*riley_weight_gain) + 3 total_weight_gain = jamie_weight_gain + riley_weight_gain + jordan_weight_gain result = total_weight_gain return result
A store has 200 shirts. If they sell 50% of the shirts, how many shirts do they have left?
def solve() -> int: total_shirts = 200 percent_sold = 50 shirts_sold = total_shirts * percent_sold / 100 shirts_left = total_shirts - shirts_sold result = shirts_left return result
A gallon of paint can cover approximately 350 square feet. If a wall is 12 feet tall by 20 feet wide, how many gallons of paint does it take to completely cover the wall?
def solve() -> int: wall_area = 12 * 20 gallons_needed = wall_area / 350 result = gallons_needed return result
An amusement park ticket costs $45. If a group of 4 friends each buy a ticket and 3 of them also buy a $6 meal, what is the total cost?
def solve() -> int: ticket_price = 45 meal_price = 6 number_of_friends = 4 number_of_friends_with_meal = 3 total_cost = (ticket_price * number_of_friends) + (meal_price * number_of_friends_with_meal) result = total_cost return result
ix students took part in a charity run and completed it in different lengths of time. Dylan completed the run in 38 minutes, John ran for half the time that Dylan did, Will ran for twice the time of John, and Emma, Mike, and Yoshi ran for a combined total of 20 minutes. How long did it take for all six students to comp...
def solve() -> int: total_time = 0 dylan_time = 38 john_time = dylan_time/2 will_time = john_time*2 emma_mike_yoshi_time = 20 total_time = dylan_time + john_time + will_time + emma_mike_yoshi_time result = total_time return result
Carlos drove 6 miles from his house and stopped to refuel. He drove for another 11 miles before he stopped for lunch. After lunch he continued his drive, which was 13 miles away, before he stopped to refuel again. On the last leg of his drive, he drove 16 miles until he arrived at his destination. If he now has exactly...
def solve() -> int: total_miles = 6 + 11 + 13 + 16 total_gallons = 4 result = total_miles/total_gallons return result
Joe is running an errand and he needs to buy some building material. He needs to buy 8 pieces of wood that are each 2 meters long. How long will it be altogether in meters?
def solve() -> int: piece_length = 2 num_pieces = 8 total_length = piece_length * num_pieces result = total_length return result
Marco runs 4 km every morning. This week, he missed running for two days due to a cold. How many kilometers will he run in total for the week?
def solve() -> int: daily_distance = 4 days_in_week = 7 days_missed = 2 distance_run = (days_in_week - days_missed) * daily_distance result = distance_run return result
Q5: For a school project, Nia needs to have 4 sections in a rectangular net. If the area of the net is 36 square centimeters, what should the dimensions of each section be?
def solve() -> int: area = 36 sections = 4 length = (area / sections)**(1/2) width = length result = (length, width) return result
Ryan has 9 bags filled with 18 baseballs each. How many total baseballs does Ryan have?
def solve() -> int: x = 9 y = 18 z = x*y result = z return result
Bob has read 40 books this year and rated 80% of them as good. If he reads 20 more books and rates 12 of them as good, what is his new rating percentage?
def solve() -> int: total_read = 40 + 20 total_good = 40 * 0.8 + 12 new_rating_percentage = total_good / total_read result = round(new_rating_percentage, 2) return result
Mark wants to buy a new bicycle. Bicycle A costs $575, while bicycle B costs $799. The sales tax rate in his state is 8.25%. Find the total cost of the two bicycles.
def solve() -> int: total_cost = 0 cost_after_tax_A = 575 * (1 + 0.0825) cost_after_tax_B = 799 * (1 + 0.0825) total_cost = cost_after_tax_A + cost_after_tax_B result = total_cost return result
Zoe makes 12 muffins with 2 cups of flour. She buys the bag of flour that costs $2.40 and has 10 cups of flour. There is currently a buy one get one free offer on this item. How much will the flour for each muffin cost, in cents, after the offer is applied?
def solve() -> int: effective_price = 2.4 / 2 flour_per_muffin = 2 / 12 cost_of_flour = effective_price / 10 * flour_per_muffin cost_of_flour_in_cents = cost_of_flour * 100 result = cost_of_flour_in_cents return result
A math class has 34 students and 2 teachers. If 5 students leave the class, what is the new student to teacher ratio?
def solve() -> int: students = 34 teachers = 2 students_leave = 5 students -= students_leave new_ratio = students / teachers result = new_ratio return result
John starts at point A and walks 5 blocks north and 3 blocks east. He then walks south the same distance as he did before and then walks west the same distance as he did before. If John can walk 4 blocks/minute, how long will it take him to get back to point A?
def solve() -> int: start_point = "A" north_distance = 5 east_distance = 3 total_distance = north_distance * 2 + east_distance * 2 walking_speed = 4 time_taken = total_distance / walking_speed result = time_taken return result
Danny ate a pizza cut into 10 slices. He gave 2/5 of the pizza to his sister and 1/4 of the pizza to his friend. How many pizza slices were left with Danny?
def solve() -> int: total_slices = 10 sister_slices = (2/5) * total_slices friend_slices = (1/4) * total_slices left_slices = total_slices - sister_slices - friend_slices result = left_slices return result
A flower shop sells bouquets of roses for $35, bouquets of lilies for $45, and bouquets of mixed flowers for $50. If the shop sold 8 roses bouquets, 5 lilies bouquets, and 3 mixed flower bouquets, how much money did they make?
def solve() -> int: rose_bouquets = 8 lily_bouquets = 5 mixed_bouquets = 3 rose_price = 35 lily_price = 45 mixed_price = 50 total_sales = rose_bouquets * rose_price + lily_bouquets * lily_price + mixed_bouquets * mixed_price result = f"The flower shop made ${total_sales} selling 8 roses ...
Jamal pays $20 for 3GB data, unlimited texting and calling on his phone each month. An alternative phone plan would charge $5 per GB of data, $0.10 per text, and $0.05 per minute of call. Jamal uses 5GB data, sends 200 texts, and talks for 400 minutes on his phone each month. How many dollars less would he pay on the a...
def solve() -> int: data_cost = 5 * (5 - 3) text_cost = 0.10 * 200 call_cost = 0.05 * 400 alternative_cost = data_cost + text_cost + call_cost savings = 20 - alternative_cost result = savings return result
Student: In a pet store, there are 30 animals. 15 are cats, 13 are dogs and the rest are rabbits. How many rabbits are there?
def solve() -> int: num_animals = 30 num_cats = 15 num_dogs = 13 num_rabbits = num_animals - num_cats - num_dogs result = num_rabbits return result
Sarah can make 1 jar of jam with 5 cups of berries. If it costs $8.00 to buy 6 cups of berries, and she makes a jar of jam once every two weeks for 10 weeks, how much does she spend on berries?
def solve() -> int: cups_of_berries_per_jar = 5 cost_of_berries_per_cup = 8.00 / 6 jars_of_jam_per_week = 1 / 2 weeks = 10 cups_of_berries = cups_of_berries_per_jar * jars_of_jam_per_week * weeks total_cost = cups_of_berries * cost_of_berries_per_cup result = total_cost return ...
There are 900 students in a school and each classroom has 30 students. How many classrooms are in the school?
def solve() -> int: num_students = 900 students_per_classroom = 30 num_classrooms = num_students // students_per_classroom result = f'<<<There are {num_classrooms} classrooms in the school.>>>' result = num_classrooms return result
Sam is painting a fence that is 100 feet long and 6 feet high. He can paint 10 square feet of fence per hour. He also needs to paint both sides of the fence. How many hours does it take him to paint the whole fence?
def solve() -> int: area_one_side = 100 * 6 area_both_sides = 2 * area_one_side hours = area_both_sides / 10 result = hours return result
Liam can read 5 books with 1 library card. If each card costs $10.00, and he borrows books twice a month for 6 months, how much does he spend on library cards?
def solve() -> int: books_per_card = 5 card_cost = 10.00 books_per_month = books_per_card / 2 months = 6 total_books = books_per_month * months total_cards = total_books / books_per_card total_cost = total_cards * card_cost result = total_cost return result
A store is selling DVDs for $15 each. If John buys 4 DVDs, how much will he spend?
def solve() -> int: price_per_dvd = 15 dvds = 4 total_cost = price_per_dvd * dvds result = total_cost return result
A recipe for chocolate cake calls for 2 cups of flour and 1 cup of sugar. How many cups of sugar are needed if there are 4 cups of flour?
def solve() -> int: flour_needed = 2 sugar_needed = 1 flour_used = 4 sugar_used = (sugar_needed/flour_needed)*flour_used result = sugar_used return result
Student: A car drives 48 miles on Monday and 68 miles on Tuesday. If the car averages 45 miles per hour, how long did it take the car to drive those two days?
def solve() -> int: distance_monday = 48 distance_tuesday = 68 speed = 45 total_distance = distance_monday + distance_tuesday total_time = total_distance / speed hours = int(total_time) minutes = round((total_time - hours) * 60) result = (hours, minutes) return result
Student: In a compound, the number of horses is 10% greater than the number of cows. There are also four times as many chickens than the number of cows in the compound. Calculate the total number of animals present in the compound if there are 72 chickens.
def solve() -> int: num_horses = 0 num_cows = 0 num_chickens = 72 num_horses = num_cows * 1.1 num_cows = num_chickens / 4 total_animals = num_horses + num_cows + num_chickens result = total_animals return result
Ethan spent 2 hours doing 800 work tasks at $0.25 each. Then Ethan spent 1.5 hours doing 10 work tasks at $2.50 each. How much more did Ethan make doing the good work compared to the lower-paid work?
def solve() -> int: hours1 = 2 tasks1 = 800 rate1 = 0.25 hours2 = 1.5 tasks2 = 10 rate2 = 2.5 earnings1 = hours1 * tasks1 * rate1 earnings2 = hours2 * tasks2 * rate2 difference = earnings2 - earnings1 result = difference return result
In a race, Julia finished 5 seconds before David. Chris finished 10 seconds after David. If Julia finished the race in 50 seconds, how many seconds did Chris take to finish?
def solve() -> int: julia_time = 50 david_time = julia_time + 5 chris_time = david_time + 10 result = chris_time return result
A new sports centre has 8 racquetball courts. To construct one court you need 288 square metres of flooring. How many square metres of flooring are needed for the entire sports centre?
def solve() -> int: num_courts = 8 area_court = 288 total_area = num_courts * area_court result = total_area return result
At a school fair, the ratio of the number of students to the number of teachers was 7:2. After 6 students and 2 teachers left the fair, the ratio changed to 4:1. How many students were there in total?
def solve() -> int: initial_ratio_students = 7 initial_ratio_teachers = 2 students_left = 6 teachers_left = 2 new_ratio_students = 4 new_ratio_teachers = 1 students_initial = initial_ratio_students * (new_ratio_teachers + initial_ratio_teachers) students_final = students_initial - ...
Sam is climbing up a ladder and notices that for every 2 rungs he climbs, his height increases by 50 centimeters. He wants to climb at least 10 rungs. He has already climbed 4 rungs, how much more does he need to climb to reach his goal?
def solve() -> int: rungs_climbed = 4 height_increase_per_rung = 50 rungs_goal = 10 rungs_remaining = rungs_goal - rungs_climbed height_increase_needed = rungs_remaining * height_increase_per_rung result = height_increase_needed return result
James needs 125 gallons of paint to paint his house. If each bucket of paint holds 5 gallons and costs $20, how much will it cost him to buy all the paint he needs?
def solve() -> int: gallons_needed = 125 buckets_needed = gallons_needed / 5 cost = buckets_needed * 20 result = cost return result
Liam wants to purchase a cell phone for $500. If he can only afford to pay $100 per month, how many months will it take Liam to save up for the cell phone?
def solve() -> int: total_cost = 500 amount_saved_per_month = 100 number_of_months = 0 number_of_months = total_cost/amount_saved_per_month result = "Number of months to save: " + str(number_of_months) return result
There are three numbers in the ratio of 2:3:5. If the sum of these numbers is 350, what is the largest number in this sequence?
def solve() -> int: num1 = 2 num2 = 3 num3 = 5 total_sum = num1 + num2 + num3 num3_value = (num3/total_sum)*350 result = num3_value return result
If Alice walks to work at a speed of 5 km/h and walks home at a speed of 4 km/h, taking the same route both ways and the total distance is 10 km, what is her average speed for the overall trip?
def solve() -> int: total_distance = 10 distance_per_trip = total_distance / 2 speed_to_work = 5 speed_to_home = 4 total_time = distance_per_trip / speed_to_work + distance_per_trip / speed_to_home overall_speed = total_distance / total_time result = overall_speed * 1.0 return result
Alex is buying candy bars that cost $0.75 each. He wants to buy 10 candy bars. How much total will his candy bars cost?
def solve() -> int: candy_bar_cost = 0.75 quantity = 10 total_cost = candy_bar_cost * quantity result = total_cost return result
The number of pet cats in a park is three times the number of pet dogs in the same park. There are 12 pet cats. If the dogs are 2 in number, calculate the ratio of the number of cats to the number of dogs in the park.
def solve() -> int: cats = 12 dogs = 2 cats = 3 * dogs ratio = cats / dogs result = ratio return result
John burned 400 calories during his morning jog. He then consumed 800 calories for breakfast and burned another 300 in the next hour. If he burned 50% of the calories he consumed, determine John’s net calorie intake.
def solve() -> int: morning_jog_calories = 400 breakfast_calories = 800 calories_burned_after_breakfast = 300 calories_consumed = breakfast_calories - (0.5 * breakfast_calories) total_calories_burned = morning_jog_calories + calories_burned_after_breakfast net_calorie_intake = calories_consumed ...
The probability of catching a fish in a pond start at 20% if you spend an hour fishing, increasing by 10% for every additional hour spent. If Jon spends 3 hours fishing, what is his probability of catching a fish?
def solve() -> int: hours_fishing = 3 initial_probability = 0.2 additional_probability = 0.1 probability = initial_probability + (additional_probability * (hours_fishing - 1)) result = probability return result
In 9 years, Jack's age will be twice as old as his youngest sister Emma. If Jack is 24 years old today, how old is Emma today?
def solve() -> int: jack_age_today = 24 years_in_future = 9 emma_age_in_future = (jack_age_today + years_in_future) / 2 emma_age_today = emma_age_in_future - years_in_future result = emma_age_today return result
A school needs to paint a rectangular playground with dimensions 20m by 30m. If one can of paint can cover 4 square meters and costs $25, how many cans of paint will they need in total and what will it cost?
def solve() -> int: total_area = 20 * 30 cans_needed = total_area / 4 total_cost = cans_needed * 25 result = (cans_needed, total_cost) return result
Mike has 10 boxes, each box contains 25 candy bars. He wants to give each of his 4 kids 20 candy bars. How many boxes of candy bars does he need?
def solve() -> int: candies_per_box = 25 num_boxes = 10 num_kids = 4 candies_per_kid = 20 total_candies = num_kids * candies_per_kid total_candies_per_box = candies_per_box * num_boxes total_boxes = total_candies / candies_per_box if total_candies % candies_per_box!= 0: total_box...
It takes 25 minutes to cook rice and 5 minutes per serving to steam it fully. How long does it take to cook 4 servings of rice?
def solve() -> int: cook_time = 25 serving_time = 5 num_servings = 4 total_time = cook_time + (serving_time * num_servings) result = total_time return result
A school has 5 classrooms. Each classroom has 25 chairs. If the school needs to buy new chairs so that each classroom has 30 chairs, how many chairs do they need to buy? The program should: 1. Multiply the number of classrooms by the difference in chairs needed (30-25) result =?
def solve() -> int: num_classrooms = 5 chairs_needed = 30 - 25 total_chairs = num_classrooms * chairs_needed result = total_chairs return result
John went to a grocery store and bought a 10-dollar pack of beer. Later, he added a 7-dollar bag of chips to his order. Finally, he picked up a 5-dollar pack of pretzels. What was the total cost of John's order?
def solve() -> int: beer = 10 chips = 7 pretzels = 5 total_cost = beer + chips + pretzels result = total_cost return result
Juan went to the hardware store and bought 3 meters of steel that costs $5 per meter; 1/2 meter of copper wire that costs $2 per meter; two bags of nails that costs $3 per bag. Juan also wants to buy a $8 drillbit for his project. How much money should Juan need to buy everything?
def solve() -> int: steel_length = 3 steel_cost_per_meter = 5 steel_cost = steel_length * steel_cost_per_meter copper_length = 0.5 copper_cost_per_meter = 2 copper_cost = copper_length * copper_cost_per_meter nails_cost_per_bag = 3 num_bags_of_nails = 2 nails_cost = nails_c...
A store had a 15% increase in sales compared to last year. If last year the store had sales of $900,000, what is the store's sales this year?
def solve() -> int: last_year = 900000 percentage = 0.15 this_year = last_year + last_year * percentage result = this_year return result
There are 36 roses in a bouquet, and a third of them are white. There are 4 more pink roses than white roses. There are 8 less than triple the number of red roses as pink roses. How many red roses are in the bouquet?
def solve() -> int: white_roses = 36 // 3 pink_roses = white_roses + 4 red_roses = (pink_roses * 3) - 8 result = red_roses return result
Emma is making bracelets for her friends. She has 36 beads of different colors and she wants to use 6 beads for each bracelet. She also has 12 inches of elastic string for each bracelet and she needs to leave 2 inches of string for tying the ends. How many bracelets can she make if she uses the same pattern of beads fo...
def solve() -> int: bead_bracelets = 36 // 6 string_length = 6 * 0.5 + 2 string_bracelets = 12 // string_length bracelets = min(bead_bracelets, string_bracelets) result = bracelets return result
A pack of 8 pencils costs $6.40, while a pack of 6 erasers costs $4.80. How much will it cost to buy 5 packs of pencils and 4 packs of erasers?
def solve() -> int: pencil_pack = 6.40 / 8 eraser_pack = 4.80 / 6 pencils_cost = 5 * pencil_pack erasers_cost = 4 * eraser_pack total_cost = pencils_cost + erasers_cost result = total_cost return result
Alex bought a new laptop for $900 and paid an additional $120 for a warranty. He gets charged an hourly fee of $25 when he goes to the technician for any assistance. How many hours can he get help for with the remaining $200 from his original budget, assuming the fee remains the same?
def solve() -> int: laptop_cost = 900 warranty_cost = 120 total_cost = laptop_cost + warranty_cost remaining_budget = 200 hourly_fee = 25 total_spent = total_cost - remaining_budget hours_of_assistance = total_spent / hourly_fee result = hours_of_assistance return...
Rachel has three tubs with a capacity of 30 gallons, 50 gallons, and 70 gallons, respectively. If she fills the first tub up to 40% full, the second tub with water up to 60% of its capacity, and the third tub up to 80% of its capacity, how many gallons in total are in the tubs?
def solve() -> int: tub1_capacity = 30 tub2_capacity = 50 tub3_capacity = 70 tub1_water = tub1_capacity * 0.4 tub2_water = tub2_capacity * 0.6 tub3_water = tub3_capacity * 0.8 total_water = tub1_water + tub2_water + tub3_water result = total_water return result
Pamela has 78 cards, which she splits into two piles. If she puts the same number of cards in each pile, how many cards are in each pile?
def solve() -> int: total_cards = 78 num_piles = 2 cards_per_pile = total_cards // num_piles result = cards_per_pile return result
There are 156 students in a school. If 75% of them attend class today, how many students are present?
def solve() -> int: total_students = 156 attendance_rate = 0.75 num_present = total_students * attendance_rate result = num_present return result
A water tank can hold 500 liters of water. If each bucket can carry 10 liters of water, how many buckets will it take to fill the tank?
def solve() -> int: tank_capacity = 500 bucket_capacity = 10 buckets_needed = tank_capacity // bucket_capacity result = buckets_needed return result
Emily, Ethan, and Logan went apple picking. Emily picked 10 more apples than Ethan. Ethan picked 4 less than Logan. Logan picked 28 apples. How many apples did they pick in total?
def solve() -> int: ethan = 28 - 4 emily = ethan + 10 total_apples = ethan + emily + 28 result = total_apples return result
Leah won a scholarship of $1000. She decided to give 3/4 of it to her best friend for her college fees. How much money did Leah keep for herself?
def solve() -> int: scholarship_amount = 1000 friend_share = (3/4) * scholarship_amount leah_share = scholarship_amount - friend_share result = leah_share return result
A grocery store sells 350 pounds of fruits every day. They currently have 180 pounds of fruits for the day. How many pounds of fruits per hour does the store need to sell to meet their daily sales target within 8 hours? Mark and John are two brothers. The difference between their heights is 20cm. If their heights add u...
def solve() -> int: fruits_sold_per_day = 350 fruits_on_hand = 180 hours_to_sell = 8 fruits_needed = fruits_sold_per_day - fruits_on_hand fruits_per_hour = fruits_needed / hours_to_sell result = fruits_per_hour height_difference = 20 total_height = 3 * 100 john_h...
Henry purchased five packs of pens for $7 each and three notebooks for $5 each. The store gave him a discount and he only had to pay $38 in total. How much discount did they give him in dollars?
def solve() -> int: packs_of_pens = 5 price_per_pack_of_pens = 7 notebooks = 3 price_per_notebook = 5 total_price = 38 total_pens_price = packs_of_pens * price_per_pack_of_pens total_notebooks_price = notebooks * price_per_notebook discount = total_pens_price + total_notebooks_...
Bob poured 6 cups of water into a large bottle. He added 3 more cups of water to the bottle. How many cups of water are in the bottle?
def solve() -> int: cups = 6 morecups = 3 result = cups + morecups return result
David has $35. He spends 25% on lunch and then 50% of the remaining on a book. How much money does he have left?
def solve() -> int: money = 35 money_spent_on_lunch = money * 0.25 money -= money_spent_on_lunch money_spent_on_book = money * 0.5 money -= money_spent_on_book result = money return result
The perimeter of a square is 40. What is the length of one side of the square?
def solve() -> int: perimeter = 40 side_length = perimeter / 4 result = side_length return result
A pizza has been cut into 10 slices. If 3 slices have been eaten, what percentage of the pizza is left?
def solve() -> int: total_slices = 10 slices_eaten = 3 slices_left = total_slices - slices_eaten percentage_left = (slices_left / total_slices) * 100 result = percentage_left return result
Student: If a box of crayons has 12 colors and each color has 4 crayons, how many crayons are in the box?
def solve() -> int: colors = 12 crayons_per_color = 4 crayons = colors * crayons_per_color result = crayons return result
A rectangular field measures 120 meters by 80 meters. What is the area of the field in square meters?
def solve() -> int: length = 120 width = 80 area = length * width result = area return result