question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
The cost of filling a car fuel tank is $50 and this can take you 450 miles before refilling. Loan wants to drive from his hometown to the beach which is 2000 miles away. If he spends twice as much he spent on fuel for lodging accommodation, calculate the total amount of money he will use.
def solve() -> int: fuel_cost = 50 fuel_distance = 450 total_distance = 2000 lodging_cost = fuel_cost * 2 fuel_trips = total_distance // fuel_distance remaining_distance = total_distance % fuel_distance if remaining_distance > 0: fuel_trips += 1 total_fuel_cost = fuel_trips * fue...
Sophie works as a chef at a restaurant and earns $500 per week. She spends 20% of her earnings on her hobby. In the first week of July, she spent $100 on her hobby. How much money will Sophie have left after a month of work in total?
def solve() -> int: earnings_per_week = 500 percentage_spent_on_hobby = 0.2 hobby_spending_first_week = 100 hobby_spending_per_week = earnings_per_week * percentage_spent_on_hobby total_spending_in_july = hobby_spending_first_week + 3 * hobby_spending_per_week total_earnings_in_july = 4 * e...
If Sally runs 2 miles on Monday, 3 miles on Wednesday, 1 mile on Friday, and 4 miles on Sunday, how many miles does she run in a week?
def solve() -> int: distance = 2+3+1+4 result = distance return result
arah wants to buy a new shirt that costs $15 and a pair of shoes that costs $25. She has $30 in her wallet. How much money will she have left after buying the shirt and shoes?
def solve() -> int: shirt_cost = 15 shoes_cost = 25 wallet_money = 30 total_cost = shirt_cost + shoes_cost remaining_money = wallet_money - total_cost result = remaining_money return result
David wants to rent a car for a week. The rental company charges $20.00 per day plus $0.10 per mile. David estimates that he will drive about 200 miles during the week. He also has to pay a 15% sales tax on the rental fee and a $50.00 deposit that will be refunded if the car is returned without damage. How much money w...
def solve() -> int: rental_fee = 20.00 * 7 + 0.10 * 200 sales_tax = 0.15 * rental_fee total_cost = rental_fee + sales_tax + 50.00 amount_refunded = 50.00 net_amount_spent = total_cost - amount_refunded result = round(net_amount_spent, 2) return result
================================================================== Possible questions and programs: Sam has 10 coins in his piggy bank. Every week, he adds 3 more coins to his piggy bank. After 12 weeks, he decides to spend half of his coins on a toy. How many coins does he have left in his piggy bank?
def solve() -> int: coins = 10 for week in range(12): coins = coins + 3 coins = coins / 2 coins = round(coins) result = coins return result
If John and Sarah each have 9 more pencils than David, but only 6 less than Jennifer, and Jennifer has 42 pencils, how many pencils do they all have together?
def solve() -> int: david_pencils = 42 - 6 john_pencils = david_pencils + 9 sarah_pencils = david_pencils + 9 total_pencils = david_pencils + john_pencils + sarah_pencils result = total_pencils return result
The population of a city is 250,000. If 40% of the population is male, how many females are in the city?
def solve() -> int: total_population = 250000 percent_male = 40 male_population = total_population * percent_male/100 female_population = total_population - male_population result = female_population return result
Student: Jamal has 18 apples and 8 grapefruits. If he packages each in boxes of 4, how many boxes in total will he need?
def solve() -> int: apples = 18 grapefruits = 8 total_fruits = apples + grapefruits total_boxes = total_fruits // 4 result = total_boxes return result
Sophia's cat catches 5 rats and 2 mice. Michael's cat catches 2 less than four times as many animals as Sophia's cat. How many animals does Michael's cat catch?
def solve() -> int: sophia_rats = 5 sophia_mice = 2 sophia_total = sophia_rats + sophia_mice michael_total = 4 * sophia_total - 2 result = michael_total return result
Nathaniel wants to split $80 between himself and his 2 friends. If he gives one of his friends twice as much money as the other, how much will each of them receive?
def solve() -> int: total_amount = 80 friend_a_amount = total_amount/3 friend_b_amount = friend_a_amount * 2 result = "friend A: $" + str(friend_a_amount) + ", friend B: $" + str(friend_b_amount) return result
Four students correctly solved 28 math problems together. If one of the students solved 2 problems more than the other three, how many problems did that student solve?
def solve() -> int: total_problems = 28 num_students = 4 equal_share_problems = total_problems/num_students one_student_extra_problems = equal_share_problems + 2 result = one_student_extra_problems return result
Student: Nicole bought 24 pieces of candy, but later ate 3 of them. How many pieces of candy were left?
def solve() -> int: initial_candy = 24 ate_candy = 3 left_candy = initial_candy - ate_candy result = left_candy return result
Student: My bike was originally priced at $300, but I was able to get it for $220. What percentage discount did I get on my bike?
def solve() -> int: original_price = 300 discounted_price = 220 discount = original_price - discounted_price percentage_discount = (discount / original_price) * 100 result = percentage_discount return result
Vince has 20 books in his library. He bought 10 new books and returned 5 books that he had. How many books does Vince have in his library now?
def solve() -> int: number_of_books = 20 number_of_new_books = 10 number_of_returned_books = 5 number_of_books_in_library = number_of_books + number_of_new_books - number_of_returned_books result = number_of_books_in_library return result
In a class of 30 students, 18 were boys and the rest were girls. What percentage of the class was boys?
def solve() -> int: total_number_of_students = 30 number_of_boys = 18 percentage_of_bys = (number_of_boys / total_number_of_students) * 100 result = round(percentage_of_bys) return result
The total cost for a DVD is $14.99. The sales tax is 6.5%. What is the total cost including tax?
def solve() -> int: dvd_price = 14.99 sales_tax = 0.065 total_price = dvd_price * (1 + sales_tax) result = total_price return result
A company has a total profit of $450,000. After paying expenses of $250,000, how much profit does the company have left?
def solve() -> int: total_profit = 450000 expenses = 250000 leftover_profit = total_profit - expenses result = leftover_profit return result
If Joe's monthly salary is $2,500 and he pays a 12% tax, how much tax will he pay each month?
def solve() -> int: monthly_salary = 2500 tax_rate = 0.12 monthly_tax = monthly_salary * tax_rate result = monthly_tax return result
A car dealership sells two types of cars, A and B. They earn $42,000 selling 10 type A cars and 6 type B cars. If each type A car costs $4,500 and each type B car costs $6,000, how many of each type of car do they sell every year (52 weeks)?
def solve() -> int: earnings_typeA = 42000 earnings_typeB = 30000 cost_typeA = 4500 cost_typeB = 6000 total_earnings_per_year = (earnings_typeA + earnings_typeB) * 52 total_cars_sold_per_year = total_earnings_per_year / (4500 + 6000) fraction_of_typeA_sales = earnings_typeA / (earnings_typeA...
Student: The sum of the ages of a father and his son is 56 years. The father is three times as old as his son. How old is the son?
def solve() -> int: father_age = 0 son_age = 0 total_age = 56 father_age = 3 * son_age total_age = father_age + son_age son_age = total_age / 4 result = son_age return result
A company has 200 employees. If 60% of them are female, how many male employees are there?
def solve() -> int: num_employees = 200 percent_female = 60 percent_male = 100 - percent_female num_male = num_employees * percent_male / 100 result = num_male return result
In a sports store, 50 soccer balls were sold every month. With a new soccer tournament upcoming, sales increased by four times more each month. How many soccer balls did the store sell each month from then on?
def solve() -> int: balls_sold_per_month = 50 increase_factor = 4 balls_sold_per_month = balls_sold_per_month * increase_factor result = balls_sold_per_month return result
In a school of 500 students, 275 students participated in a school fair. What percentage of the school students didn't participate in the fair?
def solve() -> int: total_students = 500 participated = 275 not_participated = total_students - participated percentage_not_participated = not_participated / total_students * 100 result = percentage_not_participated return result
Student: Steps and her family rent a boat from the beach for a weekend joyride. The boat costs $90 per hour, and they have decided to spend a total duration of 4 and ½ hours on the boat. Assuming that they have to pay a 10% additional tax on the rental price, how much would their entire boat rent cost?
def solve() -> int: hourly_rate = 90 duration = 4.5 tax_rate = 0.1 base_price = hourly_rate * duration tax_amount = base_price * tax_rate total_price = base_price + tax_amount result = total_price return result
A baker adds 3/4 cup of chocolate chips to a large batch of cookie dough every hour. If the batch initially contained 6 cups of dough, how many cups of chocolate chips will have been added after 8 hours?
def solve() -> int: dough = 6 chocolate_chips_per_hour = 3/4 hours = 8 chocolate_chips_added = chocolate_chips_per_hour * hours result = dough + chocolate_chips_added return result
Michelle has 14 apples in her basket. She already ate 3 apples and she shared the remaining 11 apples with 4 of her friends. How many apples does each of her friends get?
def solve() -> int: totalApples = 14 ateApples = 3 leftApples = totalApples - ateApples friendsNumber = 4 eachShare = leftApples / friendsNumber result = eachShare return result
Mia is training for a marathon. On the first day, she ran 2 miles. Every day after that, she ran half as much again as the day before. After 6 days, how many miles has Mia run?
def solve() -> int: day_1 = 2 day_2 = day_1 + (day_1 / 2) day_3 = day_2 + (day_2 / 2) day_4 = day_3 + (day_3 / 2) day_5 = day_4 + (day_4 / 2) day_6 = day_5 + (day_5 / 2) total_miles = day_1 + day_2 + day_3 + day_4 + day_5 + day_6 result = total_miles return result
A roller coaster moves at an average speed of 80 kilometers per hour. How long does it take the roller coaster to complete a 4 kilometer loop?
def solve() -> int: time = 4 / 80 time = time * 3600 time = round(time) result = time return result
The student council has one bubble tea for every group of 4 students. If there are 24 students attending the council meeting, how many bubble teas are needed for the meeting?
def solve() -> int: x = 24 y = x // 4 result = y return result
If the sum of the angles in a triangle is 180 degrees and one angle is 45 degrees, what is the measure of the remaining two angles?
def solve() -> int: angle1 = 0 angle2 = 0 result = (angle1, angle2) return result
Student: George has 52 cards in his collection. He has 7 times as many baseball cards than football cards. How many baseball cards are there?
def solve() -> int: football_cards = 1 baseball_cards = 7 * football_cards total_cards = football_cards + baseball_cards total_cards = 52 baseball_cards = total_cards - football_cards result = baseball_cards return result
Zara has 5 bags of vegetables, each weighing 21kg. What is the total weight of all 5 bags?
def solve() -> int: bags = 5 total = bags * 21 result = total return result
A phone plan costs $40 a month for unlimited talk and text, and 5 cents per minute of data usage. If Jane uses 700 minutes of data in a month, what is the total cost of her phone bill?
def solve() -> int: plan_cost = 40 data_minutes = 700 data_cost_per_minute = 0.05 data_cost = data_minutes * data_cost_per_minute total_cost = plan_cost + data_cost result = total_cost return result
Mr. Gupta drives his truck at a speed of 40 miles per hour for 1 hour. If he drives for an additional 50 miles, rests for 20 minutes, and then covers the remaining distance of 30 miles, what's the total time in minutes it took for Mr. Gupta to complete the journey?
def solve() -> int: speed = 40 time_1 = 1 distance_1 = speed * time_1 additional_distance = 50 rest_time = 20 remaining_distance = 30 time_2 = (additional_distance / speed) * 60 time_3 = rest_time time_4 = (remaining_distance / speed) * 60 total_time = time_...
- Oscar has six times as many marbles as Anna. 1/3 of Anna's marbles are blue. If Anna has 9 blue marbles, how many marbles does Oscar have?
def solve() -> int: anna_marbles = 9 * 3 oscar_marbles = anna_marbles * 6 result = oscar_marbles return result
A bakery produces 240 muffins every 6 hours. How many muffins does it produce in 45 minutes?
def solve() -> int: rate = 240 / 6 muffins = rate * 45 / 60 result = muffins return result
A factory has a production run of 5000 items. If 2% of the items are defective, how many items are defective?
def solve() -> int: total_items = 5000 defective_percent = 0.02 num_defective_items = total_items * defective_percent result = num_defective_items return result
Grace is calculating the amount of time an athlete must sit out for a red card offense in a soccer game. The usual penalty is 2 games for every red card received. The athlete's penalty will be increased by 40% because they have received a red card before, plus an additional 1 game for engaging in unsportsmanlike behavi...
def solve() -> int: red_cards = 3 usual_penalty = 2 penalty_increase = 1.4 total_penalty = (usual_penalty + 1) * penalty_increase * red_cards result = total_penalty return result
Student: John’s bookstore has 791 books. On Sunday, 65 books are taken out and 173 books are given back on Monday. How many books does John have now?
def solve() -> int: books_original = 791 books_taken_out = 65 books_given_back = 173 books_now = books_original - books_taken_out + books_given_back result = books_now return result
Logan has 12% more blocks than Max. Max has 6 more blocks than Luke. Luke has 50% fewer blocks than Jack. If Jack has 80 blocks, how many blocks does Logan have? The minimum age required to drive a car is 18 years old. Edmond wants to get his driver's license and will be one-third the age of his brother in four years. ...
def solve() -> int: jack_blocks = 80 luke_blocks = jack_blocks * (1 - 0.5) max_blocks = luke_blocks + 6 logan_blocks = max_blocks * (1 + 0.12) brother_age = 21 edmond_age = brother_age / 3 years_to_wait = 18 - edmond_age result = logan_blocks, years_to_wait return result
Mary needs to drive to work. Her car can drive 10 miles in 5 minutes. How many miles can her car drive in an hour?
def solve() -> int: miles_in_5_minutes = 10 minutes_in_an_hour = 60 miles_in_an_hour = miles_in_5_minutes * (minutes_in_an_hour/5) result = miles_in_an_hour return result
A group of friends have 24 cupcakes. They give away two-thirds of them to their neighbors, then buy 12 more, and finally divide the rest equally among themselves. How many cupcakes does each friend get?
def solve() -> int: cupcakes = 24 neighbors_cupcakes = cupcakes * 2 / 3 cupcakes -= neighbors_cupcakes cupcakes += 12 friends = 3 friends_cupcakes = cupcakes / friends result = friends_cupcakes return result
A soup contains 32 carrots and 18 potatoes. A chef wants to use them to make 4 equal portions of soup, but needs to remove some of the vegetables first. After removing them, each portion will have the same number of carrots and potatoes. How many carrots and potatoes will be in each portion?
def solve() -> int: total_veggies = 32+18 portions = 4 vegg_per_portion = total_veggies/portions carrots_per_portion = vegg_per_portion/2 potatoes_per_portion = vegg_per_portion/2 result = carrots_per_portion+potatoes_per_portion return result
Teddy has a bag of coins. He gave one third of his coins to Emma, one quarter of his coins to Emma and Tom combined, and 5 coins to Emma's sister. If he has 105 coins in the bag, how many coins did he give away?
def solve() -> int: total_coins = 105 third = total_coins/3 quarter = total_coins/4 emma = third + quarter + 5 result = total_coins - emma return result
There are 4 fewer Shoeshines than White-fronted Geese, and 4 more than half as many White-fronted Geese as Pintails. If there are 40 ducks total, how many Pintails are there?
def solve() -> int: x=int() y=int() z=int() x = 40 - 4 y = (x - 4)/2 z = 40 - ( x + y ) result = z return result
Student: Matthew has 42 stickers. He has 10 yellow stickers, 8 green stickers, and the rest are blue stickers. If he has twice as many blue stickers as green stickers, how many blue stickers does Matthew have?
def solve() -> int: yellow_stickers = 10 green_stickers = 8 blue_stickers = 42 - yellow_stickers - green_stickers blue_stickers = green_stickers * 2 result = blue_stickers return result
Student: Jason is 9 years younger than Timothy. In 8 years, Timothy will be 40 years old. How old is Jason now?
def solve() -> int: timothy_age = 40 jason_age = timothy_age - 9 timothy_age_in_8_years = 40 jason_age_in_8_years = timothy_age_in_8_years - 9 jason_age_now = jason_age_in_8_years - 8 result = jason_age_now return result
In a language learning app, 40% of the users are learning Spanish. The rest are learning French. Every Spanish learner completed 5 lessons, while every French learner completed 3 lessons. What is the average progress of the users?
def solve() -> int: spanish_users = 0.4 french_users = 1 - spanish_users spanish_lessons = 5 french_lessons = 3 total_lessons = spanish_users * spanish_lessons + french_users * french_lessons total_users = spanish_users + french_users average_progress = total_lessons / total_users ...
Student: Marco bought 5 pencils for $0.50 each and 3 notebooks for $1.75 each. How much did he spend in total?
def solve() -> int: pencils = 5 pencil_price = 0.50 notebooks = 3 notebook_price = 1.75 pencil_cost = pencils * pencil_price notebook_cost = notebooks * notebook_price total_cost = pencil_cost + notebook_cost result = total_cost return result
A company has 32 employees and wants to divide them up evenly into teams of 4. How many teams can they make?
def solve() -> int: employees = 32 team_size = 4 teams = employees // team_size result = teams return result
3. Nina and Carla went camping and bought the same amount of supplies. Nina bought 1 tent for $100 and a hiking stick for $15. Carla bought 2 sleeping bags for $50 each and a flashlight for $12. How much did Carla pay for her supplies?
def solve() -> int: a = 100 b = 15 c = 50 d = 12 total = a + b + (c * 2) result = total + d return result
Student: A class has 30 students. 40% of them are boys and the rest are girls. If 20% of the girls will participate in the science exhibition, how many girls will participate?
def solve() -> int: total_students = 30 boys_percentage = 40 girls_percentage = 100 - boys_percentage girls = total_students * girls_percentage / 100 participation_percentage = 20 participating_girls = girls * participation_percentage / 100 result = participating_girls return result
Kayla and Jamie went horse-riding together. Kayla rode the horse for 16 minutes, and Jamie rode for 22 minutes. How many minutes did they ride in total?
def solve() -> int: minutes_kayla = 16 minutes_jamie = 22 result = minutes_kayla + minutes_jamie return result
A store sells apples for $0.50 each and oranges for $0.75 each. If a customer buys 8 apples and 4 oranges, how much does it cost?
def solve() -> int: apple_price = 0.5 orange_price = 0.75 total_apples = 8 total_oranges = 4 total_cost = (total_apples * apple_price) + (total_oranges * orange_price) result = total_cost return result
Andrea is counting the number of plates in her restaurant. She has 15 tables with 4 plates on each table. Half of the plates have a diameter of 20cm and the other half have 5 more. How many plates does Andrea have to count?
def solve() -> int: num_tables = 15 num_plates_per_table = 4 total_num_plates = num_tables * num_plates_per_table num_plates_20cm = total_num_plates / 2 num_plates_25cm = num_plates_20cm total_num_plates = num_plates_20cm + num_plates_25cm result = total_num_pla...
Ryan ordered a pizza for $14.50, a salad for $6, and a garlic bread for $4.75. He also bought a brownie for $3.50 and tipped 20% on his total bill. What was his final bill?
def solve() -> int: pizza_price = 14.50 salad_price = 6 garlic_bread_price = 4.75 brownie_price = 3.50 total_bill = pizza_price + salad_price + garlic_bread_price + brownie_price tip = 0.20 * total_bill final_bill = total_bill + tip result = final_bill return result
Peter is buying books for school. His history book costs $50, his science book costs $40, and his math book costs $60. If he has a coupon for 20% off, how much does he pay in total?
def solve() -> int: history_price = 50 science_price = 40 math_price = 60 discount = 0.2 total_price = history_price + science_price + math_price final_price = total_price * (1 - discount) result = final_price return result
A group of friends went shopping and bought items worth $230.45. If each friend contributed $25, calculate how many friends were there.
def solve() -> int: total_cost = 230.45 each_contribution = 25 num_friends = total_cost/each_contribution result = round(num_friends) return result
Ten friends went on a road trip. Ana paid the $300 rental fee for the van, while Ben and Chris split the cost of gas and spent $40 each. Emma and Frank split the cost of toll fees and spent $15 each. Gab and Helen rented a GPS for $20. Ian spent $50 on snacks. Jack and Kim agreed to split the cost of a hotel room and s...
def solve() -> int: van_rental_fee = 300 gas = 40 * 2 toll_fees = 15 * 2 gps = 20 snacks = 50 hotel_room = 100 * 2 total_expenses = van_rental_fee + gas + toll_fees + gps + snacks + hotel_room num_friends = 10 each_contribution = total_expenses / num_friends result = each_contrib...
David has $30. He wants to buy 4 candy bars at $1.50 per candy bar, 3 ice creams for $2.25 per ice cream, and 2 sodas for $1.00 each. Does he have enough money to buy all of these?
def solve() -> int: total_money = 30 candy_cost = 1.50 icecream_cost = 2.25 soda_cost = 1.00 candy_amount = 4 icecream_amount = 3 soda_amount = 2 total_spent = candy_cost * candy_amount + icecream_cost * icecream_amount + soda_cost * soda_amount if total_money >= total_spent: ...
In a classroom, there are 36 students and 30 chairs. If each student needs one chair, how many more chairs must be added to the classroom?
def solve() -> int: num_students = 36 num_chairs = 30 additional_chairs = num_students - num_chairs result = additional_chairs return result
If Jane collected 4 times as many shells as Tom who collected 1, how many shells did Jane collect?
def solve() -> int: tom_shells = 1 jane_shells = 4 * tom_shells result = jane_shells return result
Maria needs to catch a train that leaves at 8:45 am. She needs to walk 10 minutes to the train station and arrive 15 minutes early to board. If it takes her 5 minutes to get dressed and 15 minutes to have breakfast, what is the latest time she can wake up and still make it to the train on time?
def solve() -> int: train_leaves = 8*60 + 45 walk_time = 10 early_arrival = 15 get_dressed = 5 breakfast_time = 15 total_time = walk_time + early_arrival + get_dressed + breakfast_time latest_time = train_leaves - total_time hours = latest_time // 60 minutes = lat...
Liam is making lemonade for his friends. He knows that he needs 4 lemons and 3 cups of water for each liter of lemonade. He has already squeezed 12 lemons and poured 9 cups of water into a pitcher. How much more lemonade can he make with the remaining ingredients if he has 16 lemons and 12 cups of water left?
def solve() -> int: already_made = min(12 / 4, 9 / 3) remaining_made = min(16 / 4, 12 / 3) difference = remaining_made - already_made result = difference return result
John can mow a lawn in 30 minutes and trim the bushes in 20 minutes. How long will it take him to mow 2 lawns and trim 4 bushes?
def solve() -> int: mow_time = 30 bush_time = 20 total_mow_time = mow_time * 2 total_bush_time = bush_time * 4 total_time = total_mow_time + total_bush_time result = total_time return result
Lucy has 4 dolls with 2 eyes each and 6 toy aliens with 6 eyes each. How many eyes do all the toys have in total?
def solve() -> int: dolls = 4 doll_eyes = 2 aliens = 6 alien_eyes = 6 total_doll_eyes = dolls * doll_eyes total_alien_eyes = aliens * alien_eyes result = total_doll_eyes + total_alien_eyes return result
Rachel reports to work at a cinema where there were 100 individuals watching movies. Another 20 people join them while 15 people depart. What is the present number of moviegoers?
def solve() -> int: initial_count = 100 additional_count = 20 departed_count = 15 current_count = initial_count + additional_count - departed_count result = current_count return result
A bag of candies has 150 candies and weighs 750 grams. How many grams does one candy weigh?
def solve() -> int: candy_weight = 750 / 150 result = candy_weight return result
Ryan needed to buy new clothes for the summer and went shopping. He wanted to buy 4 t-shirts costing $15 each, 3 pairs of shorts at $25 each, and 5 tank tops at $12 each. How much did Ryan pay for all the clothes?
def solve() -> int: shirts = 4*15 shorts = 3*25 tank_tops = 5*12 total_price = shirts + shorts + tank_tops result = total_price return result
- Question Samantha the chameleon needs to eat ants to get protein in her diet. She hunts 3 ants every hour and twice that over the course of the day, snacking on nuts and seeds in between. How many ants does Samantha hunt per day?
def solve() -> int: ants_per_hour = 3 hours_per_day = 24 ants_per_day = ants_per_hour * hours_per_day result = ants_per_day return result
A farmer has 30 cows and 6 pigs. How many legs are there in total?
def solve() -> int: number_of_cow_legs = 30 * 4 number_of_pig_legs = 6 * 4 total_legs = number_of_cow_legs + number_of_pig_legs result = total_legs return result
John runs 2 miles every day for 30 days. If he started on Monday, what day of the week will he complete his 30th run?
def solve() -> int: days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] start_day = 'Monday' total_runs = 30 day_index = days.index(start_day) final_day_index = (day_index + total_runs % 7) % 7 result = days[final_day_index] return result
Student: Amy is buying bananas for $5 per kg. If she would get a 15% discount on each kg of bananas, how much would she pay for 4 kg of them?
def solve() -> int: price = 5 discount = 0.15 quantity = 4 discounted_price = price * (1 - discount) cost = discounted_price * quantity result = cost return result
A store offers a 10% discount on all items. If the original price of an item is $200, what is the discounted price?
def solve() -> int: original_price = 200 discount_percent = 10 discount_amount = discount_percent/100 * original_price discounted_price = original_price - discount_amount result = discounted_price return result
A rectangular garden has a length of 12 feet and a width of 8 feet. If a fence is put around the garden, how many feet of fence is needed?
def solve() -> int: perimeter = 2 * (12+8) result = perimeter return result
Max has 12 red socks and 16 white socks. He divides the total into 4 equal parts, removes some socks from each part, and doubles the rest to have 5 socks in each part now. How many socks were removed from each part?
def solve() -> int: red_socks = 12 white_socks = 16 total_socks = red_socks + white_socks equal_parts = total_socks // 4 remaining_socks = equal_parts // 5 removed_socks = equal_parts - remaining_socks result = removed_socks return result
Tom drinks 2 liters of water every day. He goes jogging for 45 minutes and drinks 500 ml of water while jogging. He also drinks 1 cup (250ml) of water after he is finished jogging. If he wants to drink a total of 3 liters of water today, how many more liters of water does he need to drink?
def solve() -> int: water_per_minute = 0.044 jogging_time = 0.75 water_while_jogging = 0.5 additional_water = 0.25 total_water_consumed = 2 + (water_per_minute * jogging_time) + water_while_jogging + additional_water total_water_goal = 3 remaining_water = total_water_goal - total_water_consu...
A rectangle has a perimeter of 30 meters. If the length is 5 meters more than the width, what is the length and width of the rectangle?
def solve() -> int: perimeter = 30 length = (perimeter/2) - 5 width = (perimeter/2) - length result = (length, width) return result
A carpenter charges $45 per hour for labor. If a job takes 6.5 hours to complete, how much will the carpenter charge for labor?
def solve() -> int: hourly_rate = 45 hours_worked = 6.5 labor_cost = hourly_rate * hours_worked result = labor_cost return result
John has a rectangular yard that is 15ft wide and 20ft long. If he wants to fence in the yard with chain link fencing, how much fencing will he need to buy?
def solve() -> int: width = 15 length = 20 fencing_needed = (2 * length) + (2 * width) result = fencing_needed return result
Jack has 9 books. Kelly has 7 more books than Jack. Liam has 2 fewer books than Kelly. How many books does Liam have?
def solve() -> int: jack = 9 kelly = jack + 7 liam = kelly - 2 result = liam return result
If the sum of 6 consecutive integers is 156, what is the smallest integer?
def solve() -> int: x=156 y=6 result = x//y - y +1 return result
Student: Alfred and his 3 friends have a total of $56 for snacks, Alfred get 1/4 of the total amount, his 2 friends get 1/3 of the total amount, and his last friend get the balance of the money. How much money does the last friend get?
def solve() -> int: total = 56 alfred = total / 4 friends = total / 3 last = total - alfred - 2 * friends result = last return result
John can complete a task in 30 minutes while Tom can complete the same task in 25 minutes. How long would it take them to complete the task together?
def solve() -> int: time_john = 30 time_tom = 25 total_time = 1 / (1/time_john + 1/time_tom) result = total_time return result
The total of the ages of an adult, a teenager and a child is 45 years. The teenager is half as old as the adult and the child is half as old as the teenager. What is the age of the adult?
def solve() -> int: total_age = 45 child_age = total_age/4 teen_age = child_age*2 adult_age = teen_age*2 result = adult_age return result
Sanjana wants to make necklaces for her friends. She needs 1.2 yards of string for each necklace and there are 8 friends. If the string is sold in spools of 25 yards, how many spools should Sanjana buy?
def solve() -> int: yards_per_necklace = 1.2 num_friends = 8 yards_needed = yards_per_necklace * num_friends yards_per_spool = 25 spools_needed = yards_needed / yards_per_spool spools_needed = round(spools_needed + 0.5) result = spools_needed return result
If a pizza that originally cost 12 dollars is now on sale for 9 dollars, what is the percentage discount?
def solve() -> int: original_price = 12 sales_price = 9 discount = (original_price - sales_price) / original_price * 100 result = discount return result
The recipe for a cake calls for 2 1/2 cups of sugar. If you only have 1 1/2 cups, how much more sugar do you need?
def solve() -> int: sugar_needed = 2 + 1/2 sugar_have = 1 + 1/2 sugar_needed_more = sugar_needed - sugar_have result = sugar_needed_more return result
A company had a total revenue of $200,000 last year. They spent 25% of their revenue on salaries, 35% on rent, 20% on supplies, and 10% on taxes. How much profit did the company make last year?
def solve() -> int: total_revenue = 200000 salary_percentage = 0.25 rent_percentage = 0.35 supplies_percentage = 0.2 tax_percentage = 0.1 total_expenses = total_revenue * (salary_percentage + rent_percentage + supplies_percentage + tax_percentage) profit = total_revenue - total_expenses ...
5 friends went to a park. They brought 20 cans of soda and 12 packets of chips. If they want to distribute them equally, how many cans and packets will each friend have?
def solve() -> int: cans = 20//5 packets = 12//5 result = (cans, packets) return result
Sarah has a flower garden that has 12 rows and 8 columns of flowers. Each flower has 5 petals. She wants to pick some flowers from her garden and make a bouquet. She picks 3 flowers from each row and 2 flowers from each column. How many petals does Sarah's bouquet have?
def solve() -> int: rows = 12 columns = 8 petals = 5 bouquet = 0 total_petals = 0 bouquet = 3 * rows + 2 * columns total_petals = bouquet * petals result = total_petals return result
In 25 years, Emma will be eight times as old as Oliver. If Oliver is currently 5 years old, how old is Emma now?
def solve() -> int: oliver_age = 5 emma_age = 8 * (oliver_age + 25) result = emma_age return result
The sum of two numbers is 45 and their difference is 15. Find the two numbers.
def solve() -> int: sum_of_numbers = 45 difference = 15 number1 = 30 number2 = 15 result = (number1, number2) return result
A book club requires a $30 membership fee to join and offers books at a discounted price of 20% off the original price. If a member buys a book that originally costs $25, how much should they pay?
def solve() -> int: discounted_price = 25 * 0.2 final_price = 25 - discounted_price + 30 result = final_price return result
If it takes Emma 15 minutes to walk 2 blocks, how many minutes will it take her to walk 8 blocks?
def solve() -> int: blocks_walked = 8 time_per_block = 15 total_time = blocks_walked * time_per_block result = total_time return result
At a music festival, attendance was 500 on the first day, half as many on the second day, but then grew by 250 on the third day. How many people attended the festival in total over those 3 days?
def solve() -> int: day1 = 500 day2 = day1 / 2 day3 = day2 + 250 total_attendance = day1 + day2 + day3 result = total_attendance return result
David earned $1020 before taxes and John earns $17 per hour. How many hours did he work?
def solve() -> int: david_earnings = 1020 john_hourly_rate = 17 hours_worked = david_earnings / john_hourly_rate result = hours_worked return result
The sum of three consecutive integers is 102. What are the three integers?
def solve() -> int: sum_of_integers = 102 second_int = sum_of_integers // 3 first_int = second_int - 1 third_int = second_int + 1 result = (first_int, second_int, third_int) return result
A toy store packages each toy car with 1/2 foot of tape while each toy plane requires 1 foot of tape to package. If the store packaged 15 toy cars and 7 toy planes today, how much tape did they use in total?
def solve() -> int: tape_per_car = 1/2 tape_per_plane = 1 num_cars = 15 num_planes = 7 total_tape = num_cars * tape_per_car + num_planes * tape_per_plane result = total_tape return result