question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Megan bought a car for $18,000. After 2 years, the value of the car decreased by 20%. What is the value of the car now?
def solve() -> int: initial = 18000 decrease_rate = 0.2 years = 2 final = initial * (1-decrease_rate)**years result = final return result
A grocery store sells apples for 75 cents each and oranges for 50 cents each. If Sarah buys 4 apples and 6 oranges, how much does she owe the grocery store?
def solve() -> int: apple_price = 0.75 orange_price = 0.50 num_apples = 4 num_oranges = 6 total_cost = (apple_price * num_apples) + (orange_price * num_oranges) result = total_cost return result
Student: Kevin likes to play dice games. He has a six-sided die and a twelve-sided die. He rolls both dice and adds up the numbers. He does this 10 times and records the sums. He notices that 2/5 of the sums are even and 1/4 of the sums are divisible by 3. How many sums are both even and divisible by 3?
def solve() -> int: six_sided_die = 6 twelve_sided_die = 12 num_rolls = 10 even_sums = 2/5 * num_rolls divisible_by_3_sums = 1/4 * num_rolls result = even_sums * divisible_by_3_sums return result
A car travels 60 km/h for 2 hours and 80 km/h for 3 hours. How far did it travel in total?
def solve() -> int: distance_at_60km = 60 * 2 distance_at_80km = 80 * 3 total_distance = distance_at_60km + distance_at_80km result = total_distance return result
Mason wants to buy watches that are "buy one get one 30% off" and all cost $150 each. If he buys 4 watches, how much will he save?
def solve() -> int: watches_price = 150 num_watches = 4 total_cost = watches_price * num_watches discounted_cost = total_cost - (watches_price * 0.3 * (num_watches // 2)) savings = total_cost - discounted_cost result = savings return result
A train travels at 60 km/h for 2 hours and then at 40 km/h for another 3 hours. What is the total distance covered by the train?
def solve() -> int: speed_at_first_leg = 60 speed_at_second_leg = 40 time_at_first_leg = 2 time_at_second_leg = 3 distance_at_first_leg = speed_at_first_leg * time_at_first_leg distance_at_second_leg = speed_at_second_leg * time_at_second_leg total_distance = distance_at_first_leg + distance...
Jesse has 20 marbles, Hana has 10 marbles, and Adam has four times the combined number of Jesse and Hana's marbles. If they are playing a marble game and their competitors have a total of 200 marbles, how many marbles are they behind in the game?
def solve() -> int: jesse = 20 hana = 10 adam = 4 * (jesse + hana) competitors = 200 total_marbles = jesse + hana + adam marbles_behind = competitors - total_marbles result = marbles_behind return result
Maria's restaurant uses 50 pounds of potatoes each day. She wants to increase production by 10%. How many pounds of potatoes will she need in a year after increasing production?
def solve() -> int: potatoes_per_day = 50 increase_percentage = 10 days_per_year = 365 increase_per_day = potatoes_per_day * (increase_percentage / 100) new_potatoes_per_day = potatoes_per_day + increase_per_day total_potatoes_per_year = new_potatoes_per_day * days_per_year ...
result = A rectangular prism has a length of 8 cm, a width of 5 cm, and a height of 3 cm. What is the volume of the prism?
def solve() -> int: volume = 8 * 5 * 3 result = volume return result
Kevin read six books in January, and Lucy read four books in February. If they each read one more book every month than they did in the previous month, how many books would they have read in total by the end of April?
def solve() -> int: kevin_books_january = 6 lucy_books_february = 4 kevin_books_march = kevin_books_january + 1 kevin_books_april = kevin_books_march + 1 lucy_books_march = lucy_books_february + 1 lucy_books_april = lucy_books_march + 1 total_books = kevin_books_january + lucy_book...
In 12 years, Alice will be 3 times the age that Bob is currently. If Bob is currently 8 years old, how old is Alice now?
def solve() -> int: bob_current = 8 bob_future = bob_current + 12 alice_future = 3 * bob_current alice_current = alice_future - 12 result = alice_current return result
am is planning a trip to the Caribbean and wants to leave in 2 weeks. He checks the airline website and finds out that a one-way ticket costs $350, while a round-trip ticket costs $600. How much will Sam save by buying a round-trip ticket?
def solve() -> int: cost_oneway = 350 cost_round = 600 result = cost_round - cost_oneway return result
If John takes two 10-minute breaks, a 45-minute lunch break, and a 15-minute walk, how much time does he spend away from his work duties in a day?
def solve() -> int: break1 = 10 break2 = 10 lunch_break = 45 walk = 15 total_time_away = break1 + break2 + lunch_break + walk result = total_time_away return result
For a potluck dinner, Sarah needs to buy groceries for her dish. She needs to buy 2 pounds of chicken that cost $6.99 per pound, 5 cans of tomatoes that cost $2.00 each, and one block of cheese that costs $4.50. What is the total cost of Sarah's potluck dinner ingredients? Sarah and Jake share a backyard that measures ...
def solve() -> int: chicken_cost = 6.99 chicken_weight = 2 tomatoes_cost = 2.00 tomatoes_quantity = 5 cheese_cost = 4.50 total_chicken_cost = chicken_cost * chicken_weight total_tomatoes_cost = tomatoes_cost * tomatoes_quantity total_cost = total_chicken_cost + total_tomatoes_cost +...
John writes a 5-chapter book and sells it to 7 publishers. How many chapters are there in total?
def solve() -> int: num_chapters_per_chapter = 1 num_chapters_per_book = 5 num_publishers = 7 total_num_chapters = num_chapters_per_book * num_publishers result = total_num_chapters return result
Possible questions and programs are: - There are 60 children in a summer camp and the ratio of girls to boys is 4:3. How many fewer boys than girls are there?
def solve() -> int: total_ratio = 4 + 3 one_unit = 60 / total_ratio girls = one_unit * 4 boys = one_unit * 3 difference = girls - boys result = round(difference) return result
Possible questions and programs are: Leo wants to buy 3 shirts and 2 pants from a store. Each shirt costs $12 and each pant costs $15. He also has a coupon that gives him a 10% discount on his total purchase. How much does he pay after using the coupon?
def solve() -> int: total_cost = 3 * 12 + 2 * 15 discount = 0.1 * total_cost final_amount = total_cost - discount result = final_amount return result
Student: Lisa is knitting a scarf for her friend. She has 8 balls of yarn, each with 100 meters of length. The pattern she is following requires 12 stitches per 10 centimeters of width and 18 rows per 10 centimeters of length. She wants the scarf to be 20 centimeters wide and 150 centimeters long. How many balls of yar...
def solve() -> int: num_balls = 8 length_per_ball = 100 stitches_per_10cm = 12 rows_per_10cm = 18 width = 20 length = 150 total_stitches = width * stitches_per_10cm total_rows = length * rows_per_10cm total_length = total_stitches * total_rows num_balls_needed = total_length / le...
ally runs for 30 minutes at a speed of 6 miles per hour. How many miles did Sally run?
def solve() -> int: time = 30 speed = 6 distance = (speed/60)*time result = distance return result
If it takes a computer 10 minutes to install software, and each software installation takes 8 times as much time to download as to install, how long does each installation take to download?
def solve() -> int: install_time = 10 download_time = install_time * 8 result = download_time return result
Alex is selling lemonade at a stand. He spends $12 on ingredients and sells each cup for $0.75. He estimates that he can sell 40 cups a day on weekdays and 80 cups a day on weekends. How much profit does he make in one week?
def solve() -> int: cost = 12 price = 0.75 weekday_sales = 40 weekend_sales = 80 revenue = (weekday_sales * 5 + weekend_sales * 2) * price profit = revenue - cost result = profit return result
If 8 more than twice a number is equal to 20, what is the number?
def solve() -> int: num = (20 - 8) / 2 result = num return result
Jacob likes eating out. The price of a meal is $25. He eats out two times a week for two years but then decides to eat out only once a week. After 3 years, how much did Jacob spend on all his meals?
def solve() -> int: price_per_meal = 25 meals_per_week = 2 weeks_per_year = 52 years_with_two_meals = 2 years_with_one_meal = 3 total_meals_with_two_meals = meals_per_week * weeks_per_year * years_with_two_meals total_meals_with_one_meal = meals_per_week * weeks_per_year * years_with_on...
If the sum of the squares of the two numbers is 89, and one of the numbers is 5, what is the other number?
def solve() -> int: sum_of_squares = 89 one_num = 5 other_num = (sum_of_squares - (one_num**2))**(1/2) result = other_num return result
A group of students buy 10 pizzas with 8 slices each. If each student eats 3 slices, how many students are in the group?
def solve() -> int: pizzas = 10 slices = pizzas * 8 students = slices // 3 result = students return result
A bus travels 120 miles in 2 hours. What is the speed of the bus in miles per hour?
def solve() -> int: distance = 120 time = 2 speed = distance/time result = speed return result
Lisa has 5 red balloons and 2 blue balloons. She gives away 3 red balloons and 1 blue balloon. How many balloons does she have left?
def solve() -> int: red_balloons = 5 blue_balloons = 2 give_away_red_balloons = 3 give_away_blue_balloons = 1 number_of_red_balloons_left = red_balloons - give_away_red_balloons number_of_blue_balloons_left = blue_balloons - give_away_blue_balloons total_balloons_left = number_of_r...
Student: A school has three classes of 30 students each. The first class has 10 boys and 20 girls. The second class has 15 boys and 15 girls. The third class has 12 boys and 18 girls. How many more girls are there than boys in total?
def solve() -> int: class_1 = 30 class_2 = 30 class_3 = 30 boys_1 = 10 girls_1 = 20 boys_2 = 15 girls_2 = 15 boys_3 = 12 girls_3 = 18 total_boys = boys_1 + boys_2 + boys_3 total_girls = girls_1 + girls_2 + girls_3 difference = total_girls - total_boys result = differe...
am wants to rent a car for a weekend trip. The car rental company charges $35 per day plus $0.20 per mile. If Sam drives 300 miles over the weekend, how much will the rental car cost?
def solve() -> int: days_rented = 2 daily_rental_cost = 35 miles_driven = 300 cost_per_mile = 0.20 rental_cost = (days_rented * daily_rental_cost) + (miles_driven * cost_per_mile) result = rental_cost return result
Student: A company produces 1000 products every month, and the production cost per product is 10 dollars. If the company sells the products at 20 dollars per product, what is the monthly profit of the company?
def solve() -> int: products_produced = 1000 production_cost_per_product = 10 selling_price_per_product = 20 total_production_cost = products_produced * production_cost_per_product total_selling_price = products_produced * selling_price_per_product monthly_profit = total_selling_price - total_pr...
Mike purchased 5 packs of pencils, with each pack containing 12 pencils. If the cost per pack is $2.50, how much money did Mike spend?
def solve() -> int: packs = 5 pencils_per_pack = 12 cost_per_pack = 2.5 total_cost = packs * pencils_per_pack * cost_per_pack result = total_cost return result
Each bottle has 20 pills. One pill costs 50 cents. If Isaac needs to buy pills for a month, and he needs 60 pills, how much money does he need to spend?
def solve() -> int: bottle_capacity = 20 pill_cost = 0.50 required_pills = 60 total_cost = pill_cost * required_pills result = total_cost return result
While shopping for a tapestry, Tiffany bought 3 orange pillows and 4 yellow pillows. She paid $198 total for the pillows. If the orange pillows were twice as expensive as the yellow pillows, how much did each pillow cost?
def solve() -> int: total_paid = 198 orange_pillows = 3 yellow_pillows = 4 total_yellow = total_paid / (3 * 2 + 4) total_orange = total_yellow * 2 result = total_orange return result
Student: Ben has 18 pencils, and he lends 3 of them to his friend every week. How many pencils will he have after 4 weeks?
def solve() -> int: pencils = 18 lend = 3 weeks = 4 pencils = pencils - lend * weeks result = pencils return result
A train travels 60 miles per hour. How long would it take to travel 240 miles?
def solve() -> int: distance = 240 speed = 60 time = distance / speed result = time return result
Lisa is a baker and has three types of cakes: vanilla, chocolate, and red velvet. The vanilla cake requires four eggs per cake, the chocolate cake requires five less than the vanilla cake, and the red velvet cake requires three more than the vanilla cake. How many eggs does Lisa need to make in a week to bake her cakes...
def solve() -> int: vanilla_cake = 4 chocolate_cake = vanilla_cake - 5 red_velvet_cake = vanilla_cake + 3 total_eggs = (vanilla_cake + chocolate_cake + red_velvet_cake) * 7 result = total_eggs return result
Nolan drinks 4 cups of water a day and he wants to drink 5 cups of water a day. If a cup of water is 8 oz. How much water does he need to drink in total for a full day?
def solve() -> int: cups_drank = 4 additional_cups = 1 cup_volume = 8 additional_amount = additional_cups * cup_volume total_amount = cups_drank * cup_volume + additional_amount result = total_amount return result
Lisa has $60 in her pocket. She spends $22 of it at the mall and then gives half of the remaining money to her brother. How much money does Lisa's brother get?
def solve() -> int: original_money = 60 money_spent = 22 remaining_money = original_money - money_spent brother_money = remaining_money / 2 result = brother_money return result
Student: A company manufactures 4000 cars each month. The cost to produce each car is $10,000 and they sell for $20,000. However, out of the 4000 cars, 200 cars are defective and would be sold at a discounted price of $10,000 each. What is the profit made each month?
def solve() -> int: cars_manufactured = 4000 cost_per_car = 10000 price_per_car = 20000 defective_cars = 200 discounted_price = 10000 total_cost = cars_manufactured * cost_per_car total_revenue = (cars_manufactured - defective_cars) * price_per_car + defective_cars * discounted_price pro...
In a grocery store, there are 40 different types of fruits. Six of them are apples. Half of the others are bananas. Eight of the remaining fruits are oranges. Half of the remaining ones are pears. How many types of fruits are there with only one fruit in the store?
def solve() -> int: apples = 6 total_fruits = 40 other_fruits = total_fruits - apples bananas = other_fruits / 2 remaining_fruits = other_fruits - bananas oranges = 8 remaining_fruits = remaining_fruits - oranges pears = remaining_fruits / 2 one_fruit = pears ...
John has 5 $10 and 2 $20 bills. Mary has 3 $20 and 7 $5 bills. How much more money does John have than Mary?
def solve() -> int: john_money = (5*10) + (2*20) mary_money = (3*20) + (7*5) difference = john_money - mary_money result = difference return result
Lucas has 3 times as many coins as Emma, who has 4 more coins than Noah. If Noah has 12 coins, what is the total number of coins the three have?
def solve() -> int: noah = 12 emma = noah + 4 lucas = 3 * emma total = noah + emma + lucas result = total return result
To get free shipping, Tom needs to spend a minimum of $75.00 online at his favorite home goods store. In his cart, he has a coffee maker for $40.00, a set of towels for $20.00, a rug for $30.00, 2 pillows for $12.50 each, and 1 blanket for $25.00. How much more does he need to spend to get free shipping?
def solve() -> int: coffee_maker = 40.00 towels = 20.00 rug = 30.00 pillows = 2 * 12.50 blanket = 25.00 total = coffee_maker + towels + rug + pillows + blanket minimum_spend = 75.00 difference = minimum_spend - total result = difference return result
A jar contains 120 marbles. John takes one-third of the marbles and Yasmin takes one-fourth of the remaining marbles. How many marbles are left in the jar?
def solve() -> int: total_marbles = 120 john_marbles = total_marbles / 3 remaining_marbles = total_marbles - john_marbles yasmin_marbles = remaining_marbles / 4 marbles_left = remaining_marbles - yasmin_marbles result = marbles_left return result
A construction team dug a 500-meter trench, but only 2/5 of it was filled with gravel. How many meters of trench were not filled with gravel?
def solve() -> int: total_trench = 500 filled_trench = total_trench * 2/5 unfilled_trench = total_trench - filled_trench result = unfilled_trench return result
A store is having a 20% off sale. If a shirt originally cost $25, how much will it cost during the sale?
def solve() -> int: original_price = 25 discount_percent = 20 discount_amount = original_price * discount_percent/100 sale_price = original_price - discount_amount result = sale_price return result
Student: If Sarah is 3 years older than Tom and Tom is twice as old as Jake, who is 7 years old, how old is Sarah?
def solve() -> int: Sarah = 0 Tom = 0 Jake = 7 Sarah = Tom + 3 Tom = 2 * Jake Sarah = 2 * Jake + 3 Sarah = 2 * 7 + 3 Sarah = 14 + 3 Sarah = 17 result = Sarah return result
Mia weighs 25% more than what Ava weighs and Ava weighs 120 lbs. Lucy weighs 5 lbs more than Ava. What is the combined weight of the three?
def solve() -> int: ava_weight = 120 mia_weight = ava_weight * 1.25 lucy_weight = ava_weight + 5 combined_weight = ava_weight + mia_weight + lucy_weight result = combined_weight return result
A store has 300 products in stock. If 75% of them are sold, how many are left in stock?
def solve() -> int: products_total = 300 sold_percent = 75 sold = products_total * sold_percent / 100 left_in_stock = products_total - sold result = left_in_stock return result
A library contains 98 fiction books. If 6 more fiction books arrive, how many fiction books are there now?
def solve() -> int: initial_fiction = 98 added_fiction = 6 total_fiction = initial_fiction + added_fiction result = total_fiction return result
A class has 35 students. If seven-eighths of the students went on a field trip, how many students stayed in the classrooms?
def solve() -> int: number_of_students = 35 number_of_students_field_trip = 35 * 7/8 result = number_of_students - number_of_students_field_trip return result
Olivia has 300 dollars in her bank account. If she spends 45 dollars per week for groceries, how many weeks can she afford to buy groceries?
def solve() -> int: total_money = 300 spending_per_week = 45 weeks = total_money//spending_per_week result = weeks return result
A rectangle of asphalt is laid on the ground of a school yard and seven trucks are used to cover the area which is 124 feet long and 38 feet wide. How many square feet does each truck cover?
def solve() -> int: numOfTrucks = 7 length = 124 width = 38 totalArea = length * width areaPerTruck = totalArea / numOfTrucks result = areaPerTruck return result
The height of a purple building is four times the height of a white house. The white house is also 2.5 times shorter than the height of a brown townhouse. If the brown townhouse and purple building are standing next to each other, what height of the purple building may the brown townhouse owner see if the purple buildi...
def solve() -> int: purple_building_height = 80 white_house_height = purple_building_height / 4 brown_townhouse_height = white_house_height * 2.5 result = brown_townhouse_height return result
A farm has 100 chickens. Each chicken lays 1 egg every day. They can sell each egg for $0.25. If they spend $10 per day on chicken feed, how much profit do they make each day?
def solve() -> int: num_chickens = 100 eggs_per_chicken_per_day = 1 price_per_egg = 0.25 feed_cost_per_day = 10 num_eggs = num_chickens*eggs_per_chicken_per_day revenue = num_eggs*price_per_egg profit = revenue - feed_cost_per_day result = f'<<<{profit}>>>' result = profit return...
Student: A can of peas costs $2.59 and a can of corn costs $3.45. If Jenna buys 7 cans of peas and 3 cans of corn, how much money will she spend?
def solve() -> int: peas_price = 2.59 corn_price = 3.45 peas_cost = peas_price * 7 corn_cost = corn_price * 3 total_cost = peas_cost + corn_cost result = total_cost return result
Anna bought 12 books for a total of $100. After some time the value of the books increased by 80%. She sold 40% of those books. How much did she make from selling them?
def solve() -> int: num_books = 12 total_cost = 100 cost_per_book = total_cost / num_books new_value = total_cost * 1.8 num_sold = num_books * 0.4 total_sale = num_sold * cost_per_book result = total_sale return result
In a pet store, there were 50 dogs and cats combined, and three-tenths of them were barking or meowing. If 60% of the animals barking or meowing were cats, how many cats were barking or meowing?
def solve() -> int: total_animals = 50 barking_or_meowing = total_animals * 3/10 cats_barking_or_meowing = barking_or_meowing * 60/100 result = cats_barking_or_meowing return result
Student: Merrill has two plots of land; the larger plot produces oats that can yield 3500kg every 4 months and the other produces barley that can yield 25kg every month. How much grain can they harvest altogether after 12 months?
def solve() -> int: oats_yield = 3500 oats_months = 4 barley_yield = 25 barley_months = 12 total_oats_yield = oats_yield * (12 // oats_months) total_barley_yield = barley_yield * barley_months total_yield = total_oats_yield + total_barley_yield result = total_yield return result
A rectangular prism has the dimensions of 3 feet by 4 feet by 7 feet. What is the volume of the rectangular prism in cubic feet?
def solve() -> int: length = 3 width = 4 height = 7 volume = length * width * height result = volume return result
Mark drops a basketball off a 150-foot building. The basketball bounces to one-eighth the height from which it fell on each bounce. How high will it bounce on the second bounce?
def solve() -> int: height = 150 bounce_height = height/8 second_bounce_height = bounce_height**2 result = second_bounce_height return result
A fashion store bought a wholesale lot of dresses at $100 each. By how much percentage should they increase the selling price to make a profit of 25%?
def solve() -> int: wholesale_price = 100 profit_percentage = 0.25 selling_price = wholesale_price + (wholesale_price * profit_percentage) percentage_increase = ((selling_price - wholesale_price) / wholesale_price) * 100 result = percentage_increase return result
If 10 people bought five kilograms of apples each, how many kilograms of apples were bought in total?
def solve() -> int: total = 0 for i in range(10): total += 5 result = total return result
Lina has 200 marbles. She gave away 50 marbles to her cousin and then bought 150 more marbles. Later on, she gave away 25 marbles to her friend. How many marbles does Lina have now?
def solve() -> int: marbles = 200 marbles -= 50 marbles += 150 marbles -= 25 result = marbles return result
A pizza place is having a deal. All pizzas are 20% off. If you buy more than 3 pizzas, you get an additional 10% off the discounted price of the number of pizzas over 3. If you bought 5 pizzas that were normally priced at $15, how much do the pizzas cost in total?
def solve() -> int: discount = 0.2 price = 15 discounted_price = price * (1 - discount) quantity = 5 total_price = discounted_price * quantity extra_discount = 0.1 extra_quantity = quantity - 3 extra_discounted_price = discounted_price * (1 - extra_discount) extra_savings = (discount...
-Each question should be on a new line Possible questions and programs: Ben has a coupon that gives him 25% off any book at the bookstore. He buys two books, one that costs $12.99 and one that costs $8.50, and pays with a $20 bill. How much change does he get back?
def solve() -> int: book1 = 12.99 book2 = 8.50 coupon = 0.25 cash = 20 total = (book1 + book2) * (1 - coupon) change = cash - total change = round(change, 2) result = change return result
The storage room is 5 meters long, 3.5 meters wide, and 2.5 meters tall. If a bag of concrete covers 2 square meters, how many bags of concrete do you need to cover the entire floor of the room?
def solve() -> int: room_floor_area = 5 * 3.5 concrete_coverage = 2 concrete_bags = room_floor_area // concrete_coverage result = concrete_bags return result
In a class of 30 students, 15 are boys and the rest are girls. What percentage of the class are girls?
def solve() -> int: girls = 30 - 15 percent_girls = girls / 30 * 100 result = percent_girls return result
Jack's grandfather tells him that well-cared trees can live 50 years longer than people. On average, people live 2 times as long as dogs live. And dogs live an average of 10 years. How long can a tree live?
def solve() -> int: people_lifespan = 2 * 10 tree_lifespan = people_lifespan + 50 result = tree_lifespan return result
A tennis ball is thrown upwards from a height of 3 meters with an initial speed of 15 meters per second. What is the maximum height the ball will reach and how long will it take to reach that height? Assume that the acceleration due to gravity is 9.8 meters per second squared.
def solve() -> int: v0 = 15 h0 = 3 g = 9.8 t = v0/g hmax = h0 + (v0**2)/(2*g) result = (hmax, t) return result
Anna drives 240 kilometers in 3 hours. The speed limit is 80 km/h. How many km/h below the speed limit was she driving?
def solve() -> int: average_speed = 240 / 3 difference = 80 - average_speed result = difference return result
A crate of oranges weighs 20kg. If a pack of oranges weighs 0.5kg, how many packs of oranges are in the crate?
def solve() -> int: number_of_packs = 20 / 0.5 result = number_of_packs return result
If a box of cereal is 18oz and the suggested serving is 3/4 cups, how many servings are there in the box?
def solve() -> int: weight_of_box = 18 suggested_serving = 0.75 num_servings = weight_of_box/(suggested_serving*8) result = num_servings return result
Jessica can jog for 2.5 miles without water. She needs to drink water every 0.25 mile. If she wants to complete a 9-mile marathon, how many times she needs to drink water?
def solve() -> int: jog_distance_without_water = 2.5 water_distance = 0.25 marathon_distance = 9 water_stops = (marathon_distance - jog_distance_without_water) / water_distance result = water_stops return result
A train travels 240 km in 6 hours. If the train maintains the same speed, how long would it take to travel 320 km?
def solve() -> int: distance = 240 time = 6 new_distance = 320 new_time = (new_distance * time) / distance result = new_time return result
A shopkeeper sells pens for $5 each. If 45 pens are sold, how much money does the shopkeeper gain from selling the pens?
def solve() -> int: price = 5 quantity = 45 sales = price * quantity result = sales return result
Maria is 30 years old and her older sister, Ana, is 38 years old. How old is Ana when Maria is half her age?
def solve() -> int: maria_age = 30 ana_age = 38 age_difference = ana_age - maria_age ana_age_when_maria_half = maria_age + age_difference / 2 result = ana_age_when_maria_half return result
8. Ashley has a budget of $2600 per semester and she spent 20% on accommodation, 10% on transportation, 5% on textbooks and the rest on entertainment. How much money does she spend on entertainment?
def solve() -> int: budget = 2600 accommodation = budget * 0.2 transportation = budget * 0.1 textbooks = budget * 0.05 left = budget - (accommodation + transportation + textbooks) result = left return result
Jake has 30 apples and takes away 5 of them. If he then gives 3 away, how many apples does he have left?
def solve() -> int: start_number_of_apples = 30 taken_away = 5 given_away = 3 remaining_apples = start_number_of_apples - taken_away - given_away result = remaining_apples return result
10. Jenna found an old jar and there were 5 coins in it. She collected 2 more coins from her brother, and then she still had twice the number she originally had. How many coins does Jenna have?
def solve() -> int: total_coins = 0 total_coins = total_coins + 5 total_coins = total_coins + 2 total_coins = total_coins * 2 result = total_coins return result
The school board has 500 textbooks with 5 pages each in them. How many total pages are there?
def solve() -> int: numOfBooks = 500 numOfPages= 5 totalPages = numOfBooks * numOfPages result = totalPages return result
Jack, Ella, Sam and Mia are collecting coins for a charity. Jack collects 25 coins, Ella collects 18 coins, Sam collects 22 coins and Mia collects 15 coins. If each coin is worth 10 cents, how much money do they collect in total?
def solve() -> int: total_coins = 25 + 18 + 22 + 15 total_money = total_coins * 0.1 result = total_money return result
If a shirt is on sale for 25% off its original price of $40, what is the sale price of the shirt?
def solve() -> int: discount = 40 * 0.25 sale_price = 40 - discount result = sale_price return result
Student: A book costs $25 and the store offers a discount of 20%. How much will the customer pay for the book?
def solve() -> int: discount_rate = 0.2 original_price = 25 discounted_price = original_price * (1 - discount_rate) result = discounted_price return result
Alice buys 12 pencils at the store. She pays $0.5 for each pencil. She also buys a notebook that costs $4. She pays with a $10 bill and gets some change back. How much change does she get?
def solve() -> int: pencils = 12 cost_pencil = 0.5 total_pencil = pencils * cost_pencil cost_notebook = 4 total_cost = total_pencil + cost_notebook pay = 10 result = pay - total_cost return result
If the three sides of a triangle measure 7cm, 8cm and 9cm respectively. What is the perimeter of the triangle?
def solve() -> int: side1 = 7 side2 = 8 side3 = 9 perimeter = side1 + side2 + side3 result = perimeter return result
Student: There are 8 volunteers working in the office. Each of them has to have a 2-hour shift. What is the total number of hours the volunteers will work together?
def solve() -> int: volunteers = 8 shift_hours = 2 total_hours = volunteers * shift_hours result = total_hours return result
Student: Max made 54 cakes. He gave half to Sarah and a quarter to Luis. How many cakes does Max have left?
def solve() -> int: cakes = 54 sarah = cakes / 2 luis = cakes / 4 result = cakes - sarah - luis return result
A recipe calls for 2 cups of flour, 1 cup of sugar, and 4 eggs. If Tom wants to double the recipe, how much of each ingredient will he need?
def solve() -> int: flour = 2 sugar = 1 eggs = 4 multiplier = 2 flour_needed = flour * multiplier sugar_needed = sugar * multiplier eggs_needed = eggs * multiplier result = (flour_needed, sugar_needed, eggs_needed) return result
Student: Emma has 50 marbles. She gave away a quarter of her marbles to her friend and then lost 10 of them. She later found twice the number of marbles she lost. How many marbles does Emma have now?
def solve() -> int: marbles = 50 gave_away = marbles // 4 lost = 10 found = 2 * lost marbles = marbles - gave_away - lost marbles = marbles + found result = marbles return result
A sports arena has a seating capacity of 20,000. If 60% of the seats are sold for a game, how many seats are left empty?
def solve() -> int: seating_capacity = 20000 percent_seats_sold = 0.60 seats_sold = seating_capacity * percent_seats_sold seats_left_empty = seating_capacity - seats_sold result = seats_left_empty return result
At the Blueberry Hill Farm, they harvest 2486 blueberries, 942 strawberries, and 678 raspberries. How many more blueberries are harvested than strawberries and raspberries together?
def solve() -> int: blueberries = 2486 strawberries = 942 raspberries = 678 strawberries_and_raspberries = strawberries + raspberries result = blueberries - strawberries_and_raspberries return result
In the morning, a plant had a height of 6 cm. By the evening, it had grown to a height of 8.2 cm. Find the percentage increase in the height of the plant.
def solve() -> int: initial_height = 6 new_height = 8.2 percent_increase = ((new_height - initial_height) / initial_height) * 100 result = f"The percentage increase is {round(percent_increase, 2)}%" result = round(percent_increase, 2) return result
An investment of $2500 has grown to $3000 in 3 years. What was the annual interest rate, to the nearest percent?
def solve() -> int: initial_investment = 2500 final_balance = 3000 years = 3 interest_rate = (final_balance / initial_investment) ** (1/years) - 1 interest_rate_percent = round(interest_rate * 100) result = interest_rate_percent return result
Student: Mary needs 200 ml of water to make lemonade that serves 5 people. How much water will she need to make the same lemonade for 20 people?
def solve() -> int: water_for_5 = 200 ratio = 20 / 5 water_for_20 = ratio * water_for_5 result = water_for_20 return result
Student: Rosa is a farmer. She took 75kg of oranges and after removing the bad oranges and peeling the good ones, she was left with 60kg of peeled oranges. How many kilograms of oranges did she originally have?
def solve() -> int: oranges_total = 75 oranges_peeled = 60 oranges_bad = oranges_total - oranges_peeled oranges_total = oranges_bad + oranges_peeled result = oranges_total return result
During a music concert, Lily and Oliver are on one team. The team's final score is obtained by adding the scores of the musicians of the same team. Out of the 45 songs, Lily played 6 songs incorrectly while Oliver played 20% more than the score of Lily. How many incorrect songs did their team play in total?
def solve() -> int: lily_score = 39 oliver_score = lily_score * 1.2 total_score = lily_score + oliver_score total_incorrect = 6 + (oliver_score - lily_score) * 0.1 result = total_incorrect return result
Student: An airplane flies 240 miles in 3 hours. What is the average speed, in miles per hour, of the airplane?
def solve() -> int: distance = 240 time = 3 average_speed = distance / time result = average_speed return result
Claire went shopping and purchased two cans of soup for $2.50 each, three bottles of juice for $1.75 each, and two bags of chips for $2.25 each. How much did she spend in total?
def solve() -> int: price_soup = 2.50 price_juice = 1.75 price_chips = 2.25 total_soup = price_soup * 2 total_juice = price_juice * 3 total_chips = price_chips * 2 total_cost = total_soup + total_juice + total_chips result = total_cost return result
Sarah goes to the park and picks up 5 flowers and twice as many leaves as flowers. When she gets home, she discovers that she has only 3 flowers and four times the number of leaves she originally picked. How many leaves and flowers are missing?
def solve() -> int: flowers_picked = 5 leaves_picked = 2 * flowers_picked flowers_left = 3 leaves_left = 4 * leaves_picked flowers_missing = flowers_picked - flowers_left leaves_missing = leaves_picked - leaves_left result = (flowers_missing, leaves_missing) return result