question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A phone plan charges $20 for the first 5GB of data and $7 for each additional GB. If a customer uses 10GB of data, how much do they owe?
def solve() -> int: data_used = 10 base_cost = 20 additional_gb_cost = 7 if data_used <= 5: total_cost = base_cost else: total_cost = base_cost + (data_used - 5) * additional_gb_cost result = total_cost return result
A bike rental company charges $10 per hour for a bike rental. A family rented bikes for 3 hours. How much do they owe the bike rental company?
def solve() -> int: price_per_hour = 10 hours_rented = 3 total_cost = price_per_hour * hours_rented result = total_cost return result
There are 100 students in a class and 60% of them are girls. If a student is chosen at random, what is the probability that it will be a girl student?
def solve() -> int: totalCount = 100 girlCount = int(totalCount * 0.6) girlProbability = girlCount / totalCount result = girlProbability return result
A class has 30 students. If 60% of the class passed the test, how many students failed?
def solve() -> int: num_students = 30 passing_percentage = 0.6 num_passed = num_students * passing_percentage num_failed = num_students - num_passed result = num_failed return result
Maya has a farm with 560 animals. 80 of them are pigs, and the rest are cows. 25 of her cows are currently pregnant and unable to give milk. Each cow produces 7 liters of milk per day. How many liters of milk does Maya get from her cows each day?
def solve() -> int: animals = 560 pigs = 80 cows = animals - pigs pregnant_cows = 25 milk_per_cow = 7 milk_from_cows = (cows - pregnant_cows) * milk_per_cow result = milk_from_cows return result
Luke injured his shoulder while swimming. The pain disappeared after 4 days, but he knew it would take 4 times as long to fully recuperate. After that, he wanted to wait another week before he swam again. If he plans to wait 3 months before swimming competitively, how long until he can begin swimming again? Samantha is...
def solve() -> int: pain_disappeared_after = 4 recuperation_time = pain_disappeared_after * 4 wait_before_swimming_again = 7 total_recovery_time = recuperation_time + wait_before_swimming_again time_until_competitive_swimming = 3 * 30 time_until_swimming_again = time_until_competitive_swimming -...
Beth has 3 baskets of apples, one with 12 small apples, one with 8 medium apples, and one with 6 large apples. It takes her 2 minutes to wash one small apple, 3 minutes for one medium apple, and 4 minutes for one large apple. If she receives assistance, how long will it take them to wash all the apples?
def solve() -> int: small_apples = 12 medium_apples = 8 large_apples = 6 small_apple_wash_time = 2 medium_apple_wash_time = 3 large_apple_wash_time = 4 total_small_apple_wash_time = small_apples * small_apple_wash_time total_medium_apple_wash_time = medium_apples * medium_apple...
If a bottle of water costs $1.50, and John buys 3 bottles a day for a week, how much money did he spend on water?
def solve() -> int: cost_per_bottle = 1.50 bottles_per_day = 3 days_in_week = 7 total_bottles = bottles_per_day * days_in_week total_cost = cost_per_bottle * total_bottles result = total_cost return result
A clothing store sells shirts for $20, pants for $30, and jackets for $50. If the store sold 10 shirts, 5 pants, and 2 jackets. How much money did they earn?
def solve() -> int: numberOfShirtsSold = 10 numberOfPantsSold = 5 numberOfJacketsSold = 2 shirtPrice = 20 pantPrice = 30 jacketPrice = 50 totalEarning = (numberOfShirtsSold * shirtPrice) + (numberOfPantsSold * pantPrice) + (numberOfJacketsSold * jacketPrice) result = totalEarni...
A store has 150 pens. They sell them in packs of 5. How many packs of pens do they have?
def solve() -> int: total_packs = 150 / 5 result = total_packs return result
A family is painting their living room and bought 4 cans of paint. They thought it would be enough, but they run out of paint halfway through. One can got knocked over and another can spilled in the car on the way home. They go back to the store and get 12 more cans, which allows them to finish the whole room. How many...
def solve() -> int: total_cans = 16 lost_cans = 2 remaining_cans = total_cans - lost_cans room_coverage = remaining_cans * 0.5 total_paint_used = room_coverage * 2 original_paint_per_can = total_paint_used / total_cans result = original_paint_per_can return result
If a recipe requires 2 cups of flour to make 12 cupcakes, how many cups of flour are needed to make 30 cupcakes?
def solve() -> int: cups_per_cupcake = 2/12 cups = cups_per_cupcake * 30 result = cups return result
Alex is 36 years old presently. 6 years back, he was three times as old as his daughter will be in 9 years. If his daughter is twice as old as his son who is 3 years old, how old is his son?
def solve() -> int: alex_age = 36 daughter_age = (alex_age - 6) / 3 - 9 son_age = daughter_age / 2 result = son_age return result
A theater has 275 seats in total. During a performance, 90% of the seats were filled. Later, the theater hosted a play for children and reserved 56 seats for parents and accompanying adults. After these changes, the theater was at full capacity. How many seats were left vacant during the first performance?
def solve() -> int: total_seats = 275 filled_seats = int(total_seats * 0.9) reserved_seats = 56 remaining_seats = total_seats - filled_seats - reserved_seats result = remaining_seats return result
A rectangular swimming pool is 5 meters wide and has a diagonal of length 13 meters. What is the length of the pool?
def solve() -> int: width = 5 diagonal = 13 length = ((diagonal**2) - (width**2))**0.5 result = length return result
If the sum of two consecutive even numbers is 86, what is the smaller number?
def solve() -> int: x = 84 / 2 result = x return result
Jackson has $250. He spent 30% of his money on a new video game. He later sold the video game for $100. How much money does he have now?
def solve() -> int: money_spent = 250 * 0.3 money_left = 250 - money_spent + 100 result = money_left return result
In a library, 40 books were borrowed, each with a fine of $10 for any late returns. However, 6 books were returned late and their borrowers had to pay only $5 each. How much fine was collected by the library?
def solve() -> int: books_borrowed = 40 fine_per_book = 10 late_books = 6 fine_per_late_book = 5 total_fine = (books_borrowed - late_books) * fine_per_book + late_books * fine_per_late_book result = total_fine return result
Student: Mary bought 4 items at a store. The items cost $8, $11, $18 and $40. How much did she spend in total?
def solve() -> int: item1 = 8 item2 = 11 item3 = 18 item4 = 40 total_cost = item1 + item2 + item3 + item4 result = total_cost return result
Liam does laundry twice a week, using 64 ounces of detergent each time. To reduce plastic waste, he buys a refillable container that holds 100 ounces of detergent. How many times will he need to refill the container per month?
def solve() -> int: laundry_per_week = 2 detergent_per_laundry = 64 container_capacity = 100 detergent_per_month = laundry_per_week * 4 * detergent_per_laundry refills_per_month = detergent_per_month // container_capacity result = refills_per_month return result
A car rental company has 80 cars available, and each car can hold up to 5 passengers. If there are currently 380 passengers, how many more cars are needed?
def solve() -> int: cars_avail = 80 passengers = 380 passengers_per_car = 5 max_passengers = cars_avail * passengers_per_car remaining_cars = (passengers - max_passengers) // passengers_per_car + 1 result = remaining_cars return result
A car uses 8 liters of gas per 100 km. How many liters of gas will it use for a 500 km trip?
def solve() -> int: gasUsagePer100km = 8 distance = 500 gasUsage = (gasUsagePer100km / 100) * distance result = gasUsage return result
A book and two pencils cost $32. If the book costs $20, how much does each pencil cost?
def solve() -> int: book_cost = 20 total_cost = 32 number_of_pencils = 2 pencil_cost = (total_cost - book_cost) / number_of_pencils result = pencil_cost return result
Two equal fractions have a sum equal to 3/4. What is the value of each fraction?
def solve() -> int: sum = 3/4 first_fraction = sum/2 second_fraction = sum/2 result = first_fraction, second_fraction return result
A bookshelf has 5 shelves, each with a height of 2 feet. If a book is 0.75 feet tall, how many books can be placed on each shelf?
def solve() -> int: total_shelves = 5 shelf_height = 2 book_height = 0.75 max_books_per_shelf = shelf_height // book_height result = max_books_per_shelf return result
Jessica is planning to bake cupcakes for her friend's birthday party. If she needs 2/3 cup of flour for each dozen cupcakes, and she wants to bake 4 dozen cupcakes, how many cups of flour does she need?
def solve() -> int: flour_needed = 2/3 * 4 result = flour_needed return result
John has a credit monitoring service for $20 per month. If he adds the identity theft protection, it will cost an additional $15 per month. The credit score monitoring costs $10 less per month than the identity theft protection. If John adds the identity theft protection and the credit score monitoring, what will his t...
def solve() -> int: credit_monitoring = 20 identity_theft_protection = 15 credit_score_monitoring = identity_theft_protection - 10 total_monthly_payment = credit_monitoring + identity_theft_protection + credit_score_monitoring hours_per_day = 1 hours_monday_wednesday = 2 days_per_w...
On May 1st, a runner is able to run a mile in 6 minutes. Every week, the runner increases their speed by 5 seconds per mile. It is now October 10th and the runner has only been able to train for 25 weeks. What is the runner's mile time in seconds?
def solve() -> int: mile_time = 6 * 60 num_weeks = 25 speed_increase = 5 total_speed_increase = (num_weeks - 1) * speed_increase current_mile_time = mile_time - total_speed_increase result = current_mile_time return result
A farmer has a field of 200 acres. Of this, he wants to spread fertilizer evenly. If he wants to spread 4 lb of fertiliser per acre how much fertilizer will he need in total?
def solve() -> int: field = 200 fertilizer_per_acre = 4 total_fertilizer = field*fertilizer_per_acre result = total_fertilizer return result
Student: Seth bought a camera lens that was 60% more expensive than his original one which is $150. How much did the new lens cost?
def solve() -> int: original_cost = 150 percent_increase = 0.6 new_cost = original_cost + (original_cost * percent_increase) result = new_cost return result
Ethan, Owen, and Claire collected seashells at the beach. Ethan collected 82 seashells, Owen collected 6 more than Ethan, and Claire collected half as many as Ethan. If they sold their seashells for $4 per dozen and divided their earnings equally, how much money did each person make?
def solve() -> int: ethan = 82 owen = ethan + 6 claire = ethan / 2 total_seashells = ethan + owen + claire dozens = total_seashells / 12 earnings = dozens * 4 each_person = earnings / 3 result = each_person return result
A restaurant gives a 15% student discount on meals over $10. If a student's meal cost $25, how much will they pay after the discount?
def solve() -> int: meal_cost = 25 discount_percent = 0.15 if meal_cost > 10: discount_amount = meal_cost * discount_percent discounted_total = meal_cost - discount_amount else: discounted_total = meal_cost result = discounted_total return result
Ethan is baking muffins with blueberries, chocolate chips, and raisins. There are three times as many chocolate chip muffins as blueberry muffins and twice as many raisin muffins as chocolate chip muffins. If there are 4 blueberry muffins, how many muffins are there total?
def solve() -> int: blueberry_muffins = 4 chocolate_chip_muffins = 3 * blueberry_muffins raisin_muffins = 2 * chocolate_chip_muffins total_muffins = blueberry_muffins + chocolate_chip_muffins + raisin_muffins result = total_muffins return result
A triangle has a base of length 10 feet and a height of length 8 feet. What is the area of the triangle?
def solve() -> int: base = 10 height = 8 area = 0.5*base*height result = area return result
A train covers 300 miles in 5 hours. At the same rate, how many miles would it cover in 8 hours?
def solve() -> int: rate = 300 / 5 distance = rate * 8 result = distance return result
A pizza has 8 slices and each slice costs $1.25. How much does a pizza with 6 slices and 4 toppings cost? Each topping costs $0.75 extra per slice.
def solve() -> int: slice_cost = 1.25 + 4 * 0.75 pizza_cost = 6 * slice_cost result = pizza_cost return result
Anna has 12 cookies and 8 candies. She gives away half of her cookies and a quarter of her candies to her friends. Ben has 3 more cookies and 2 less candies than Anna after she gives some away. How many cookies and candies does Ben have in total?
def solve() -> int: cookies_anna = 12 candies_anna = 8 cookies_give = cookies_anna / 2 candies_give = candies_anna / 4 cookies_left = cookies_anna - cookies_give candies_left = candies_anna - candies_give cookies_ben = cookies_left + 3 candies_ben = candies_left - 2 ...
A car rental agency charges $50 per day for cars and $80 per day for SUVs. Mia rented a car for 5 days and an SUV for 3 days. If the agency charges a 5% per day surcharge for all rentals, how much did Mia have to pay in total (including tax)?
def solve() -> int: priceCar = 50 daysCar = 5 priceSUV = 80 daysSUV = 3 subtotal = priceCar * daysCar + priceSUV * daysSUV surcharge = 0.05 * subtotal total = subtotal + surcharge tax = 0.10 * total total = total + tax result = total return result
Hannah has 8 stickers and 4 envelopes. She wants to put the same number of stickers in each envelope. How many stickers will be left over?
def solve() -> int: number_of_stickers = 8 number_of_envelopes = 4 stickers_left_over = number_of_stickers % number_of_envelopes result = stickers_left_over return result
Student: A store has 200 books, 25 are fiction, 32 are non-fiction, and 15 are biographies. How many books are not in any of these categories?
def solve() -> int: total_books = 200 fiction_books = 25 non_fiction_books = 32 biography_books = 15 other_books = total_books - (fiction_books + non_fiction_books + biography_books) result = other_books return result
A landowner wishes to buy fencing to enclose a 5-acre parcel. Fence panels cost $30 per panel, and each panel is 40 yards long. How much will the landowner need to spend on the fencing?
def solve() -> int: panel_cost = 30 panel_length = 40 num_acres = 5 yards_per_acre = 4840 total_yards = yards_per_acre * num_acres panels_needed = total_yards / panel_length total_panel_cost = panel_cost * panels_needed result = total_panel_cost return result
John has half as many basketballs as Lucy. If Lucy has 20 basketballs, how many basketballs do they have altogether?
def solve() -> int: lucy_basketballs = 20 john_basketballs = lucy_basketballs / 2 total_basketballs = john_basketballs + lucy_basketballs result = total_basketballs return result
In 6 years, Sarah will be 4 times younger than her mother Susan. If Susan is 42 years old, how old is Sarah now?
def solve() -> int: susan_age = 42 sarah_age_in_6_years = 4 * (susan_age + 6) sarah_age_now = sarah_age_in_6_years - 6 result = sarah_age_now return result
James and Sarah are organizing a fundraising event. Each ticket costs $7 and they expect to sell 200 tickets. How much money will they raise?
def solve() -> int: tickets_cost = 7 number_of_tickets = 200 total_money_raised = tickets_cost * number_of_tickets result = total_money_raised return result
If John bought a pizza with 120 slices at a pizzeria and then decided to share it with his friends in the ratio of 1:2, with John's ratio being 1, how many slices of pizza did each friend receive?
def solve() -> int: total_slices = 120 john_ratio = 1 friend_ratio = 2 total_ratio = john_ratio + friend_ratio john_slices = total_slices * (john_ratio / total_ratio) friend_slices = total_slices * (friend_ratio / total_ratio) result = friend_slices return result
A rectangle has a length of 15 cm and a width of 10 cm. What is the perimeter and area of the rectangle?
def solve() -> int: length = 15 width = 10 perimeter = 2 * (length + width) area = length * width result = perimeter, area return result
A hotdog stand offers a combo meal of a hotdog, a soda, and a bag of chips for $7.50. Individually, the hotdog costs $2.50, the soda costs $1, and the chips cost $1.50. How much does the combo meal save a customer?
def solve() -> int: combo_price = 7.5 hotdog_price = 2.5 soda_price = 1 chips_price = 1.5 indiv_price = hotdog_price+soda_price+chips_price saving = indiv_price - combo_price result = saving return result
A shop sells chocolate bars in packs of 10. If a customer wants to buy 35 chocolate bars, how many packs of chocolates should they buy?
def solve() -> int: chocolates_per_pack = 10 chocolates_needed = 35 packs_of_chocolates_needed = chocolates_needed // chocolates_per_pack + 1 result = packs_of_chocolates_needed return result
At the start of the school year, Daniel had $89. He bought stationary supplies and new clothes for school costing $25 and $15 respectively. His mom saw that he had saved money and gave him an additional $19. He spent the remainder of his money on snacks from the canteen. How much money does Daniel have left?
def solve() -> int: start_balance = 89 stationary_supplies_cost = 25 clothes_cost = 15 mom_addition_19 = 19 total_spent = stationary_supplies_cost + clothes_cost balance_left = start_balance + mom_addition_19 - total_spent result = balance_left return result
There are 50 marbles in a jar. Tom takes 6 marbles out. Then he gives one marble to each of his friends: Emma, Peter and Sofia. How many marbles are left in the jar?
def solve() -> int: total_marbles = 50 marbles_taken_by_Tom = 6 marbles_given_to_friends = 3 remaining_marbles = total_marbles - marbles_taken_by_Tom - marbles_given_to_friends result = remaining_marbles return result
On Monday, Maria jogged 4 miles, on Tuesday she jogged 3 miles, and on Wednesday she jogged 5 miles. What was the average distance Maria jogged each day?
def solve() -> int: monday = 4 tuesday = 3 wednesday = 5 days = 3 result = (monday+tuesday+wednesday)/days return result
Tim has 9 green apples. He has 1 more than green red and half as many yellow than red apples. How many apples does Tim have in all?
def solve() -> int: green = 9 red = green + 1 yellow = red / 2 total = green + red + yellow result = total return result
Jack paid $55 for 4 1/2 pound packages of granola. If he had bought 7 1/2 pound packages instead, how much, in dollars, would he have paid for the same amount of granola?
def solve() -> int: amount1 = 4.5 * 55 amount2 = 7.5 * 55 difference = amount2 - amount1 total = difference*2 result = total return result
A cake recipe calls for 2 eggs and 1/2 cup of sugar. If you want to make half the recipe, how many eggs and how much sugar would you need?
def solve() -> int: eggs = 2 sugar = 0.5 half_eggs = eggs/2 half_sugar = sugar/2 result = (half_eggs, half_sugar) return result
Every morning, Lisa picks up litter in the park. On Monday, she picked up 25 pieces. Over the next three days, she picked up a total of 40 pieces. On Thursday, she found 15 pieces of litter and gave 5 of them to her friend. How many pieces of litter did she have on Friday?
def solve() -> int: monday = 25 next_three_days = 40 thursday = 15 thursday_friend = 5 friday = monday + next_three_days + thursday - thursday_friend result = friday return result
In every 25 minutes, Aaron can read 20 pages of a book. How many pages on average can Aaron read if he reads for 3 hours and 15 minutes?
def solve() -> int: minutes_per_hour = 60 hours = 3 minutes = 15 total_minutes = (hours * minutes_per_hour) + minutes pages_per_minute = 20 / 25 total_pages = total_minutes * pages_per_minute result = total_pages return result
Student: Q1: Due to the restrictions of Coronavirus, the local government has set a profit limit of 20% on all products. If buying 20 apples pre-restriction was $600, calculate the new total cost of buying 60 apples post-restriction.
def solve() -> int: pre_restriction_apples = 20 pre_restriction_cost = 600 post_restriction_apples = 60 new_cost_per_apple = pre_restriction_cost / pre_restriction_apples * 1.2 post_restriction_cost = new_cost_per_apple * post_restriction_apples result = post_restriction_cost return result
Daniel has four siblings, each of which he wants to give $20. How much money does Daniel need to give out in total?
def solve() -> int: number_of_siblings = 4 money_given = 20 total_money_given = number_of_siblings * money_given result = total_money_given return result
A recipe calls for 3/4 cup of sugar, but you only have a 1/4 cup measuring cup. How many times do you need to fill the measuring cup to get the required amount of sugar?
def solve() -> int: required_amount = 3/4 measuring_cup = 1/4 fill_times = required_amount / measuring_cup result = fill_times return result
A basketball arena can hold 20,000 fans. If each seat is sold for $50, how much money will the arena make if it sells out?
def solve() -> int: total_income = 20000 * 50 result = total_income return result
In 15 years, David will be three times the age that Kate is currently. If Kate is currently 12 years old, how old is David now?
def solve() -> int: k = 12 d_15 = 3 * k d = d_15 - 15 result = d return result
Miss Good is a teacher and she has collected 88 books throughout the year. If she donates 10 books to the school library, how many books does she have left?
def solve() -> int: total_books = 0 books_given_away = 0 remaining_books = 0 total_books = 88 books_given_away = 10 remaining_books = total_books - books_given_away result = 78 return result
In a dice game, Bradley loses 5 points for every turn he plays. If his final total score is -25 points, how many turns did he take?
def solve() -> int: final_score = -25 points_lost = 5 result = final_score // points_lost return result
al earns $160 per day as a driver and an extra $5 per hour for overtime pay. How much will Sal receive for working 4 days with 14 hours overtime?
def solve() -> int: overtime_pay = 5 sal_earning = 160 no_overtime_days = 4 overtime_hours = 14 total_regular_pay = no_overtime_days * sal_earning total_overtime_pay = overtime_hours * overtime_pay total_pay = total_regular_pay + total_overtime_pay result = total_pay ...
Alice bought 8 stationary items. Each costs $4, but she got a discount of 15%. How much did she pay in the end?
def solve() -> int: num_items = 8 price_per_item = 4 discount_percentage = 15 total_price = num_items*price_per_item discount_amount = total_price*(discount_percentage/100) final_price = total_price - discount_amount result = final_price return result
Rachel purchased 5 cups and 4 plates for a total of $18. If each cup costs $2, how much does one plate cost?
def solve() -> int: cups = 5 plates = 4 total_cost = 18 cup_cost = 2 cups_cost = cups * cup_cost plate_cost = total_cost - cups_cost one_plate_cost = plate_cost / plates result = one_plate_cost return result
A bag of chips costs $2 and a bottle of soda costs $1.50. If Karen buys three bags of chips and two bottles of soda, how much did she spend?
def solve() -> int: chip_price = 2 soda_price = 1.5 chip_quantity = 3 soda_quantity = 2 total_cost = (chip_price * chip_quantity) + (soda_price * soda_quantity) result = total_cost return result
Molly and Madison went to the jewelry store to buy some rings and necklaces. Molly bought twice as many rings and 4 times as many necklaces than Madison. If Madison bought 3 rings and 6 necklaces, how many rings and necklaces did Molly buy in total?
def solve() -> int: madison_rings = 3 madison_necklaces = 6 molly_rings = 2 * madison_rings molly_necklaces = 4 * madison_necklaces total_rings = madison_rings + molly_rings total_necklaces = madison_necklaces + molly_necklaces result = total_rings + total_necklaces return result
Student: In a city, there are 5 hostels. Each hostel has 4 floors and on each floor, there is one large dormitory and one small dormitory. If the large dormitory can accommodate 12 students and the small dormitory can accommodate 8 students, what is the maximum number of students that can live in these hostels?
def solve() -> int: hostels = 5 floors = 4 large_dorm = 12 small_dorm = 8 total_dorms = hostels * floors * 2 total_capacity = total_dorms * (large_dorm + small_dorm) / 2 result = total_capacity return result
Dan has a jar with 24 candies. He eats 3 candies every day and gets 6 new candies every Sunday. How many candies will he have in the jar after 3 weeks (assume he starts on a Monday)?
def solve() -> int: candies = 24 for day in range(1, 22): candies -= 3 if day % 7 == 0: candies += 6 result = candies return result
At an amusement park, a ticket costs $30 per person. If you bring a group of 5 people, what will be the total cost?
def solve() -> int: ticket_cost = 30 total_people = 5 total_cost = ticket_cost * total_people result = total_cost return result
Some possible questions and programs are: Bobby collected some stickers from his friends. He got 8 stickers from Alice, 12 stickers from Ben, and twice as many stickers from Charlie as from Ben. How many stickers did Bobby collect in total?
def solve() -> int: charlie_stickers = 2 * 12 total_stickers = 8 + 12 + charlie_stickers result = total_stickers return result
Student: A recipe for chocolate cake requires 250 grams of flour, 200 grams of sugar, 150 grams of butter and 100 grams of cocoa powder. How many grams of each ingredient are needed to make half a cake?
def solve() -> int: flour_one_cake = 250 sugar_one_cake = 200 butter_one_cake = 150 cocoa_one_cake = 100 flour_half_cake = flour_one_cake / 2 sugar_half_cake = sugar_one_cake / 2 butter_half_cake = butter_one_cake / 2 cocoa_half_cake = cocoa_one_cake / 2 result = flour_half_cake + su...
Jacob's hamster eats 10 pellets of food every hour. How many pellets of food will it eat in a day?
def solve() -> int: pellets_per_hour = 10 hours_per_day = 24 pellets_per_day = pellets_per_hour * hours_per_day result = pellets_per_day return result
5. How many wings are on the Popton school bus, if each Hoopit has 3 wings and each Neglart has 4 wings?
def solve() -> int: Hoopits = 7 Neglarts = 8 wings_per_Hoopit = 3 wings_per_Neglart = 4 total_wings_Hoopits = Hoopits * wings_per_Hoopit total_wings_Neglarts = Neglarts * wings_per_Neglart result = total_wings_Hoopits + total_wings_Neglarts return result
Sophie is polishing her car and has already cleaned 2/5 of the car's surface area. However, she realizes that she needs to completely clean the car's surface area to make it shine. How much more work does she need to do to completely clean the car?
def solve() -> int: surface_area = 1 cleaned_area = 2/5 remaining_area = surface_area - cleaned_area result = remaining_area return result
Student: A bookshelf has 8 shelves, and each shelf holds 20 books. If 40 more books are added to the shelf, how many books can the bookshelf hold in total?
def solve() -> int: shelves = 8 books_per_shelf = 20 additional_books = 40 total_books = shelves * books_per_shelf + additional_books result = total_books return result
ally has an array of 20 numbers, each of which is larger than 100. She randomly picks two numbers from the array and finds that the difference between the two numbers is 80. What is the largest value the two numbers could have?
def solve() -> int: min_value = 100 difference = 80 max_value = min_value + difference result = max_value return result
If Jackson will be seven times older than he was when he turned one on his next birthday, and his parents give him $5 for every year old he is, how much money will they give him?
def solve() -> int: age_when_turned_one = 1 current_age = age_when_turned_one + 1 age_on_next_birthday = current_age + 1 age_difference = age_on_next_birthday - age_when_turned_one money_per_year = 5 money_given = age_difference * money_per_year result = money_given ...
A car travels at an average speed of 60 kilometers per hour. It takes 4 hours to reach its destination. How far did the car travel in total?
def solve() -> int: distance = 60 * 4 result = distance return result
Mary invests $2500 every month into her retirement plan. She gets a 7% annual return on her investments. How much money will she have after 18 months?
def solve() -> int: balance = 0 investment = 2500 annual_return = 0.07 for i in range(18): balance += investment balance= balance*(1 + annual_return/12) result = balance return result
A football team has 24 players. If 70% of the players are boys, how many boys are there on the team?
def solve() -> int: total_players = 24 boy_players = total_players * 0.7 result = boy_players return result
Max has eighteen marbles and Mia has twenty marbles. If they put all the marbles together and then each takes away 1/8th of the marbles, how many will be left in total?
def solve() -> int: max_marbles = 18 mia_marbles = 20 total_marbles = max_marbles + mia_marbles each_takes_away = total_marbles / 8 remaining_marbles = total_marbles - each_takes_away result = remaining_marbles return result
If a car travels 60 miles in 1 hour and 30 minutes, what is the car's average speed in miles per hour?
def solve() -> int: distance = 60 time_hours = 1.5 speed = distance/time_hours result = speed return result
A teacher divided her class of 24 students into 4 groups. Each group had an equal number of students. How many students were in each group?
def solve() -> int: num_students = 24 num_groups = 4 students_per_group = num_students / num_groups result = students_per_group return result
Student: 4. John saved up $800 dollars over the course of a year in his piggy bank. If he spent $150 on a new laptop, how much money does he have left?
def solve() -> int: saved_money = 800 spent_money = 150 remaining_money = saved_money - spent_money result = remaining_money return result
Frank needs to buy 20 pens for school. They cost $2 each, but he has a coupon for 30% off. How much money will he save with the coupon?
def solve() -> int: pens = 20 cost_per_pen = 2 discount = 0.3 total_cost = pens * cost_per_pen discount_amount = total_cost * discount result = discount_amount return result
Ethan is running a lemonade stand over the summer. He bought a box of 30 lemons and wants to make 3 pitchers of lemonade. He needs 5 lemons per pitcher. How many lemons will he have left after making the lemonade?
def solve() -> int: lemons_in_box = 30 pitchers_of_lemonade = 3 lemons_per_pitcher = 5 total_lemons_used = pitchers_of_lemonade * lemons_per_pitcher lemons_left = lemons_in_box - total_lemons_used result = lemons_left return result
Max, who weighs 80 pounds, wants to share the see-saw with his friend Mia, who weighs 50 pounds. How many 5-pound bags of sand does Mia need to place on her side to make their weights equal?
def solve() -> int: difference = 80 - 50 bags = difference / 5 result = bags return result
Ethan walks dogs for 3 hours a day at the rate of $9 per hour. He spent 1/3 of his earnings on a new skateboard. He then spent 1/6 of the remaining money on a new book. How much money is left from his earnings, in dollars?
def solve() -> int: hours_per_day = 3 rate_per_hour = 9 earnings = hours_per_day * rate_per_hour skateboard_cost = earnings / 3 remaining_money = earnings - skateboard_cost book_cost = remaining_money / 6 remaining_money -= book_cost result = remaining_money retur...
Eric had 40 pencils. He broke 1/8 of his pencils while sharpening them. Then he bought 6 more pencils from the supermarket. How many pencils does Eric have now?
def solve() -> int: pencils_broken = 40 / 8 pencils_left = 40 - pencils_broken pencils_total = pencils_left + 6 result = pencils_total return result
8. John started the month with $108. On Sunday he spent 1/5 of the money, on Monday he spent 5/8ths of the amount left from Sunday, and on Tuesday he spent $48. How much does he have left now?
def solve() -> int: money = 108 money = money - (money * 1/5) money = money - (money * 5/8) money = money - 48 result = money return result
Jacob is making lunch for his friends. He needs to make 3 sandwiches per person, 2 salads per person and 1 soup per person. If his party consists of 8 people, how many sandwiches, salads, and soups does he need to make?
def solve() -> int: N_people = 8 N_sandwiches = 3 * N_people N_salads = 2 * N_people N_soups = 1 * N_people result = (N_sandwiches, N_salads, N_soups) return result
Emily takes a train to visit her family in another state. It takes her 6 hours to travel and she spends 4 times as long with her family as her total travel time. How much time does Emily's trip take?
def solve() -> int: travel_time = 6 family_time = 4 * travel_time total_time = travel_time + family_time result = total_time return result
A math contest has 50 multiple-choice questions. Each question is worth 2 points for a correct answer and -1 point for a wrong answer. If a student answered 35 questions correctly and 10 questions incorrectly, what is their final score?
def solve() -> int: num_corr = 35 num_incorr = 10 points_per_corr = 2 points_per_incorr = -1 total_points = num_corr * points_per_corr + num_incorr * points_per_incorr result = total_points return result
A company made $500,000 in revenue and spent $350,000 on expenses. 20% of the remaining amount was spent on bonuses for employees. How much was left?
def solve() -> int: revenue = 500000 expenses = 350000 remaining = revenue - expenses bonuses = 0.2 * remaining leftover = remaining - bonuses result = leftover return result
Amy has to pay for her phone bill, car payment, and insurance this month. Her phone bill is $100, her car payment is $300, and her insurance bill is $150. She has already paid $50 towards her phone bill and $150 towards her car payment. How much does she still need to pay for her car insurance?
def solve() -> int: phone_bill = 100 car_payment = 300 insurance_bill = 150 paid_phone = 50 paid_car = 150 remaining_phone = phone_bill - paid_phone remaining_car = car_payment - paid_car remaining_insurance = insurance_bill total_remaining = remaining_phone + remaining_car...
Alex is deciding whether to use public transportation or his own car to get to work. Public transportation might have traffic but it has a set schedule while his car has no traffic but can be unpredictable. Public transportation also has a 10 minute break every hour but his car has no such stop. If Alex's work is 20 mi...
def solve() -> int: distance = 20 speed = 25 traffic = True schedule = True break_time = 10 if traffic and schedule: time = distance / speed elif traffic and not schedule: time = distance / speed else: time = distance / speed + break_time / 60 result...
Student: Christine took out $33 from the bank while Rob took out $25. If Christine gave Rob $6 from her money, how much money does Christine have now?
def solve() -> int: christine_money = 33 rob_money = 25 christine_money = christine_money - 6 result = christine_money return result
Mia collects 72 pennies, 48 nickels, 36 dimes, and 12 quarters in a jar. She decides to take out half of each type of coin and donate them to a charity. How much money in dollars does she donate in total?
def solve() -> int: penny = 1 nickel = 5 dime = 10 quarter = 25 pennies_out = 72 // 2 nickels_out = 48 // 2 dimes_out = 36 // 2 quarters_out = 12 // 2 value_out = pennies_out * penny + nickels_out * nickel + dimes_out * dime + quarters_out * quarter value_out = val...