question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Emily worked for 2 years and 3 months as a server and 4 years and 5 months as a shift supervisor. How many months of work experience does she have total?
def solve() -> int: years_as_server = 2 months_as_server = 3 years_as_shift_supervisor = 4 months_as_shift_supervisor = 5 total_months = years_as_server*12 + months_as_server + years_as_shift_supervisor*12 + months_as_shift_supervisor result = total_months return result
If 1 notebook costs $2 less than 3 pens, and a dozen pens is sold at the same price as 8 notebooks, how much does 1 pen cost?
def solve() -> int: x = 1 y = 3 z = 12 a = 8 total_pens = z / x total_notebooks = a / y cost_notebook = total_notebooks * 2 cost_pens = (total_pens * x + cost_notebook) / z result = cost_pens return result
Student: Question10: Anne buys 7 books that cost $5.00 each and she gets 30% off the total price. How much does she pay in total?
def solve() -> int: book_price = 5.00 num_books = 7 discount_percentage = 0.30 total_price_before_discount = book_price * num_books total_price_after_discount = total_price_before_discount * (1 - discount_percentage) result = total_price_after_discount return result
Student: Kira had half of the amount of bubbles that Bryan had and three times less than the amount of bubbles Lyla had. If Bryan had 39 bubbles, how many bubbles did Lyla have?
def solve() -> int: bryan = 39 kira = bryan / 2 lyla = kira * 3 result = lyla return result
A recipe calls for 3 cups of flour to make 24 muffins. If you want to make 48 muffins, how much flour do you need?
def solve() -> int: flour_per_muffin = 3/24 flour_needed = flour_per_muffin * 48 result = flour_needed return result
The grocery store currently has 60 apples. If the store sells 9 apples every day, in how many days will the grocery store have 21 apples left?
def solve() -> int: apples_in_store = 60 apples_sold_per_day = 9 apples_left = 21 days = (apples_in_store - apples_left) / apples_sold_per_day result = days return result
A movie theater can seat 400 people if all seats are regular. If every theater-goer requires a wheelchair space that takes up two regular seats, how many fewer people can the theater accommodate?
def solve() -> int: total_seats = 400 wheelchair_seats = total_seats // 2 regular_seats = total_seats - wheelchair_seats people_can_accommodate = regular_seats + wheelchair_seats people_can_accommodate = 400 wheelchair_seats = people_can_accommodate // 2 regular_seats = people_can_accom...
If a train travels 100 miles in 2 hours, what is its average speed in miles per hour?
def solve() -> int: distance_traveled = 100 time_traveled = 2 speed = distance_traveled / time_traveled result = speed return result
Sophia has a rabbit hutch filled with rabbits. Every day, Sophia feeds each rabbit 2 carrots. It takes Sophia 5 minutes to find each carrot. If it takes Sophia 6 hours to find enough carrots to feed all of her rabbits, how many rabbits does Sophia have in her hutch?
def solve() -> int: rabbits = 0 carrots_per_rabbit = 2 time_per_carrot = 5 time_to_find_carrots = 6 * 60 total_carrots = rabbits * carrots_per_rabbit total_time = total_carrots * time_per_carrot while total_time < time_to_find_carrots: rabbits += 1 total_carrots =...
A recipe calls for 2 cups of sugar to make 24 cookies. If Mark wants to make 60 cookies, how many cups of sugar will he need?
def solve() -> int: sugar_per_cookie = 2 / 24 total_sugar = sugar_per_cookie * 60 result = total_sugar return result
Brian earns $12 per hour at his job and receives a 5% commission on any sale he makes. In a week, he worked a total of 40 hours and made sales of $3,000. If he spends 60% of his earnings on food, clothes, and entertainment, how much did he allocate towards transportation and bills combined?
def solve() -> int: hourly_rate = 12 commission_rate = 0.05 hours_worked = 40 sales = 3000 spending_percentage = 0.6 earnings = hourly_rate * hours_worked + commission_rate * sales spending_amount = spending_percentage * earnings transportation_and_bills = earnings - spending_amount...
Student: Tom is building a contact list with his class. He can call 5 people in 10 minutes. How long will it take for Tom to call the whole class if he has 25 people in his class?
def solve() -> int: people = 25 call_per_10_min = 5 total_calls = people // call_per_10_min total_time = total_calls * 10 result = total_time return result
The weight of a truck is twice the weight of a car, while the weight of the car is four times the weight of a bicycle. If the weight of the truck is 8000 pounds, calculate the total weight of the three vehicles.
def solve() -> int: bicycle_weight = 1 car_weight = 4 * bicycle_weight truck_weight = 2 * car_weight total_weight = bicycle_weight + car_weight + truck_weight result = total_weight * 8000 return result
A landscaping company's employees each earn $18 per hour. If there are 6 employees and they've earned $1296, how many hours have they worked?
def solve() -> int: num_employees = 6 hourly_wage = 18 total_earnings = 1296 total_hours = total_earnings / (num_employees * hourly_wage) result = total_hours return result
Jenny is decorating her patio with string lights. She has 60 feet of string lights to hang. If she needs 3 feet of string lights for every 1 foot of space, how many feet of space will she be able to decorate?
def solve() -> int: total_feet_of_lights = 60 feet_of_lights_per_foot_of_space = 3 total_feet_of_space = total_feet_of_lights / feet_of_lights_per_foot_of_space result = total_feet_of_space return result
Lily has 8 stickers. She buys 4 more stickers. Then she gives 2 stickers to her sister and 3 stickers to her cousin. How many stickers does Lily have now?
def solve() -> int: stickers = 8 stickers_after_buy = stickers + 4 stickers_after_give = stickers_after_buy - (2 + 3) result = stickers_after_give return result
A rectangular garden has an area of 80 square meters and a perimeter of 34 meters. What are the dimensions of the garden?
def solve() -> int: garden_area = 80 garden_perimeter = 34 garden_length = (garden_perimeter + ((garden_perimeter ** 2) - (16 * garden_area)) ** 0.5) / 8 garden_width = garden_area / garden_length result = (garden_length, garden_width) return result
The Millennium Tower has 47 more stories than the Carlton Estate. Together they have a total of 98 stories. How many stories does the Millennium Tower have?
def solve() -> int: carlton_estate_stories = (98 - 47) / 2 millennium_tower_stories = carlton_estate_stories + 47 result = millennium_tower_stories return result
Matthew rented a toy car for $25 and a boat for $35. How much did Matthew pay for both rentals?
def solve() -> int: car_rent = 25 boat_rent = 35 total = car_rent + boat_rent result = total return result
Julia gets a 20% of her allowance every month. If her allowance is $150, how much money does she get every month?
def solve() -> int: allowance = 150 percentage = 0.2 money_per_month = allowance * percentage result = money_per_month return result
Derek takes 3 tests and fails 2 of them. If each test is 100 points, what is his score?
def solve() -> int: tests = 3 fails = 2 points_per_test = 100 failed_points = fails * points_per_test total_score = points_per_test * tests - failed_points result = total_score return result
Sophie earns $5000 per month and she saves 20% of her salary. If she spends the remaining amount equally on rent, utilities, groceries and entertainment, how much does she spend on each category?
def solve() -> int: salary = 5000 savings_percentage = 0.20 savings = salary * savings_percentage remaining = salary - savings rent = remaining / 4 utilities = remaining / 4 groceries = remaining / 4 entertainment = remaining / 4 result = [rent, utilities, groceries, entertainment] ...
Tom has to divide a pizza of 100 slices into 10 groups. How many slices will each group have?
def solve() -> int: slice_per_group = int(100/10) result = slice_per_group return result
Mary spent 3 hours studying math every Monday for 4 weeks. She spent 2 hours studying math every Thursday for 5 weeks. What was the average amount of hours Mary spent studying math per week?
def solve() -> int: monday_hours = 3 * 4 thursday_hours = 2 * 5 total_hours = monday_hours + thursday_hours average_hours = total_hours / 9 result = average_hours return result
``` A factory had a total output of 4800 units over the course of a month. If the production increases linearly each week and the entire month has four weeks, how many units were produced in the second week?
def solve() -> int: total_output = 4800 weeks_in_month = 4 average_output_per_week = total_output/weeks_in_month second_week_output = average_output_per_week*2 result = second_week_output return result
Jane bought 16 cakes for a party. Each cake has 8 slices. How many slices of cake does Jane have in total?
def solve() -> int: cakes = 16 slices_per_cake = 8 total_slices = cakes * slices_per_cake result = total_slices return result
Jack likes to take bike rides around the neighborhood. He pedals 100 yards from his house to the cycling trail. Then he bikes 1,000 yards along the trail to reach the pond. Then he takes a left turn and bikes five times his total distance so far until he reaches the next crossroad. Then he bikes half the total distance...
def solve() -> int: house_to_trail = 100 trail_to_pond = 1000 total_distance = house_to_trail + trail_to_pond next_crossroad = total_distance * 5 total_distance += next_crossroad total_distance += total_distance / 2 total_distance *= 2 result = total_distance return result
A rectangle has a length of 8 cm and a width of 4 cm. What is the perimeter of the rectangle?
def solve() -> int: length = 8 width = 4 perimeter = 2 * (length + width) result = perimeter return result
Rachel and her friends collected 30 seashells on the beach. Rachel's friend, Emma, kept 7 seashells for herself. Rachel then gives 4 seashells to her cousin and splits the rest evenly with her friends. How many seashells does each friend have?
def solve() -> int: seashells_collected = 30 seashells_kept = 7 seashells_given_to_cousin = 4 seashells_remaining = seashells_collected - seashells_kept - seashells_given_to_cousin seashells_per_friend = seashells_remaining // 3 result = seashells_per_friend return result
Student: Lisa has 12 candies and she wants to share them equally with her 3 friends. How many candies will each person get?
def solve() -> int: candies = 12 friends = 3 candies_each = candies // friends remaining_candies = candies % friends result = candies_each return result
Emily is counting the number of cars in a parking lot, but she double-counts 6 red cars and misses 3 blue cars. If Emily thinks there are 50 cars, how many are there really?
def solve() -> int: red_cars = 6 blue_cars = -3 total_counted = 50 actual_count = (total_counted - red_cars/2) - blue_cars result = actual_count return result
Student: If garnet has 4 more precious stones than tourmaline and quartz has 8 fewer precious stones than garnet, how many precious stones do they have together if tourmaline has 18 precious stones?
def solve() -> int: tourmaline = 18 garnet = tourmaline + 4 quartz = garnet - 8 total = tourmaline + garnet + quartz result = total return result
A boat can travel 18 kilometers downstream in 30 minutes on a river. However, when it goes upstream, it faces a current of 3 kilometers per hour. How long will it take the boat to travel the same distance upstream?
def solve() -> int: boat_speed = 18 / (30 / 60) upstream_speed = boat_speed - 3 upstream_time = 18 / upstream_speed upstream_time = upstream_time * 60 upstream_time = round(upstream_time, 2) result = upstream_time return result
Possible new questions and python programs: Lucas uses a VPN service that randomly assigns him to one of five servers, each with a different speed. Server A has a speed of 50 Mbps, server B has a speed of 40 Mbps, server C has a speed of 30 Mbps, server D has a speed of 20 Mbps, and server E has a speed of 10 Mbps. Wha...
def solve() -> int: A = 50 B = 40 C = 30 D = 20 E = 10 total_speed = A + B + C + D + E average_speed = total_speed / 5 result = average_speed return result
A classroom has 35 students and they have to solve 100 math problems in 2 hours. If 50 problems are solved in the first hour, how many problems should be solved per student in the second hour to complete the task on time?
def solve() -> int: students = 35 total_problems = 100 time_limit = 2 problems_solved_first_hour = 50 problems_remaining = total_problems - problems_solved_first_hour time_remaining = time_limit - 1 problems_per_student_per_hour = problems_remaining / (students * time_remaining) ...
If Hannah has a piggy bank with 150 pennies, Daniel saved 500 nickels, and Ryan has 200 dimes in his wallet, how much money did they save in total?
def solve() -> int: hannah_pennies = 150 daniel_nickels = 500 ryan_dimes = 200 hannah_total = hannah_pennies * 0.01 daniel_total = daniel_nickels * 0.05 ryan_total = ryan_dimes * 0.10 total_savings = hannah_total + daniel_total + ryan_total result = total_savings retur...
The cafeteria increased its prices by 15% due to inflation. Before, a student could buy a sandwich, a juice, and a cookie for $7.50 in total. If the student now wants to buy the same items, how much change will he get from a $10 bill?
def solve() -> int: sandwich_old = 3.5 juice_old = 2 cookie_old = 2 old_cost = sandwich_old + juice_old + cookie_old sandwich_new = sandwich_old * 1.15 juice_new = juice_old * 1.15 cookie_new = cookie_old * 1.15 new_cost = sandwich_new + juice_new + cookie_new mon...
In a shoe store, there are a total of 100 pairs of shoes and sandals. Half of them are sandals, and a tenth of the shoes are red. How many red shoes are in the store?
def solve() -> int: total_pairs = 100 sandals = total_pairs / 2 shoes = total_pairs / 2 red_shoes = shoes / 10 result = red_shoes return result
A plumber can fix a leak in 40 minutes. If he needs to fix 4 leaks, how long will it take him in hours?
def solve() -> int: time_in_minutes = 40 * 4 time_in_hours = time_in_minutes / 60 result = time_in_hours return result
A store sells apples for $0.50 each and bananas for $0.30 each. If Tom bought 4 apples and 6 bananas, how much did he spend?
def solve() -> int: apple_cost = 0.5 banana_cost = 0.3 apples = 4 bananas = 6 total_cost = (apple_cost * apples) + (banana_cost * bananas) result = total_cost return result
Rachel works 5 hours on Monday and then 3 hours on Tuesday. If she needs to work 20 hours total for the week, how many more hours does she need to work?
def solve() -> int: monday_hours = 5 tuesday_hours = 3 total_hours = monday_hours + tuesday_hours remaining_hours = 20 - total_hours result = remaining_hours return result
amantha can pour a glass of water in 12 seconds. If Sean can pour twice as fast as Samantha, how long will it take him to pour 5 gallons of water?
def solve() -> int: time_samantha = 12 volume_samantha = 1 flow_samantha = volume_samantha/time_samantha volume_sean = 5 flow_sean = flow_samantha*2 time_sean = volume_sean/flow_sean result = time_sean return result
Student: John has $30 and wants to buy 3 toys for $8 each. Can he afford all of the toys and how much money will he have left over?
def solve() -> int: money = 30 toy_price = 8 num_toys = 3 total_cost = toy_price * num_toys money_leftover = money - total_cost result = money_leftover return result
Student: Ron also wants to buy some firewood for the camp fire. He finds a seller who charges $10.00 for a bundle of 12 logs. Each log can burn for about 30 minutes. Ron estimates that he will need the fire to last for 3 hours. How many bundles of firewood does he need to buy, and how much will he spend on them?
def solve() -> int: price_per_bundle = 10.00 logs_per_bundle = 12 burn_time_per_log = 30 fire_duration = 3 fire_duration_in_minutes = fire_duration * 60 logs_needed = fire_duration_in_minutes / burn_time_per_log from math import ceil bundles_needed = ceil(logs_needed / logs_per_bundl...
arah had $50 to spend at the grocery store. She bought 3 cans of soup, each costing $2.50 and 2 bags of chips, each costing $1.75. How much money does Sarah have left?
def solve() -> int: money = 50 soup_cost = 2.50 chips_cost = 1.75 cans_of_soup = 3 bags_of_chips = 2 total_cost = (soup_cost * cans_of_soup) + (chips_cost * bags_of_chips) money_left = money - total_cost result = money_left return result
Chelsea rented four textbooks from a store for the semester. The first two textbooks costed $26 each and the last two costed $30 each. How much did Chelsea spend in total for the four books?
def solve() -> int: cost1 = 26 cost2 = 30 num_books1 = 2 num_books2 = 2 total_cost = (cost1 * num_books1) + (cost2 * num_books2) result = total_cost return result
A store has a sale where all items are 20% off. If a $50 shirt is on sale, what is the sale price?
def solve() -> int: price = 50 discount = 0.2 sale_price = price*(1-discount) result = f'<<<{sale_price}>>>' result = sale_price return result
arah ran a 5k race in 22 minutes and 30 seconds. If the race was 3.1 miles long, what was her average speed in miles per hour?
def solve() -> int: distance_in_miles = 3.1 time_in_hours = (22*60 + 30)/3600 average_speed = distance_in_miles / time_in_hours result = average_speed return result
A restaurant has 50 customers, 3/5 of whom ordered chicken and the rest ordered beef. 1/4 of the chicken orders are grilled while 3/4 are fried. All the beef orders are grilled. If a customer is picked at random, what is the probability of getting a chicken order that is fried?
def solve() -> int: total_orders = 50 chicken_orders = total_orders * 3/5 beef_orders = total_orders - chicken_orders fried_chicken = chicken_orders * 3/4 prob = fried_chicken / total_orders result = prob return result
William buys 8 donuts, 4 bottles of water, 2 chocolates and 1 laptop at the store. The donuts cost $2.50 each, the water was 100¢ each, the chocolates were 5$ each and the laptop was 400$. How much did William spend at the store?
def solve() -> int: donuts = 8*2.5 water = 4*0.1 chocolates = 2*5 laptop = 400 result = donuts + water + chocolates + laptop return result
A basketball player scores an average of 20 points per game over the first 50 games of the season. If she wants to raise her season average to 22 points per game, how many points does she need to score in her next game?
def solve() -> int: first_50_games_points = 20 * 50 total_season_points = 22 * 51 points_needed = total_season_points - first_50_games_points result = f'{points_needed} points needed in next game' result = points_needed return result
Karen is counting the seeds in her pumpkin. She has 60 seeds in total. If 30% of the seeds are white, how many white seeds does she have?
def solve() -> int: total_seeds = 60 white_seeds_percentage = 30 white_seeds = (white_seeds_percentage / 100) * total_seeds result = white_seeds return result
Michael has a rectangular table that is 4 meters by 8 meters. He increases each dimension by 2 meters and creates 2 more identical tables. What is the total area of all the tables?
def solve() -> int: length = 4 + 2 width = 8 + 2 area = length * width total_area = area * 3 result = total_area return result
There are 36 cans of soda in a fridge. 4/5 of them are cola and 1/5 of them are cherry. How many cans of cherry soda are in the fridge?
def solve() -> int: total_soda = 36 cola = 0 cherry = 0 cola = (total_soda * 4)/5 cherry = (total_soda * 1)/5 result = cherry return result
A farm has 100 cows. If 25% of the cows are brown and 60% are black, how many cows are not brown or black?
def solve() -> int: brown_cows = 0.25 * 100 black_cows = 0.6 * 100 other_cows = 100 - brown_cows - black_cows result = other_cows return result
In a computer lab, there are 360 computers, with 10 computers broken each day, how many days will it take for the computer lab to have no computers?
def solve() -> int: days = 0 c = 360 while (c > 0): c = c - 10 days = days + 1 result = days return result
Student: A power company charges $0.10 per kilowatt hour (kWh) during the day and $0.08 per kWh during the night. If a household uses 20 kWh during the day and 30 kWh during the night, what is the total cost for the day?
def solve() -> int: cost_day = 0.10 cost_night = 0.08 kwh_day = 20 kwh_night = 30 total_cost = cost_day * kwh_day + cost_night * kwh_night result = total_cost return result
A grocery store has 120 apples. If each bag has 6 apples, how many bags can the store make?
def solve() -> int: apples = 120 apples_per_bag = 6 bags = apples // apples_per_bag result = bags return result
Charlie had 15 apples. He ate 3 of them and gave 6 to his sister. Then, he bought another 10 apples from the store and ate 2 more. His sister gave him back 4 apples that she did not want. How many apples did Charlie have at the end of the day?
def solve() -> int: apples = 15 apples = apples - 3 - 6 apples = apples + 10 apples = apples - 2 apples = apples + 4 result = apples return result
The school newspaper needs to print the same number of pages as last year when they printed 500 pages. This year, they can only print 20 pages per cartridge, whereas last year, they could print 25 per cartridge. How many more cartridges must they buy to print the same number of pages as last year? Three days ago, Sarah...
def solve() -> int: last_year_pages = 500 this_year_pages_per_cartridge = 20 last_year_pages_per_cartridge = 25 this_year_cartridges = last_year_pages / this_year_pages_per_cartridge last_year_cartridges = last_year_pages / last_year_pages_per_cartridge additional_cartri...
Lisa has 24 cupcakes that she wants to share with her friends. She invites 6 friends over and gives each of them 3 cupcakes. How many cupcakes does she have left?
def solve() -> int: cupcakes_given = 6 * 3 cupcakes_left = 24 - cupcakes_given result = cupcakes_left return result
``` Ron went to the store to buy eggs. He bought 3 dozen and 6 eggs. How many eggs did he buy in total?
def solve() -> int: dozen = 12 total_eggs = (3 * dozen) + 6 result = total_eggs return result
A store sells items for 25%, 30%, 35%, and 40% off. If a customer buys 4 items, one for each discount, and the subtotal is $100, what is the total cost including tax if the sales tax is 8%?
def solve() -> int: subtotal = 100 discount1 = subtotal * 0.25 discount2 = subtotal * 0.3 discount3 = subtotal * 0.35 discount4 = subtotal * 0.4 total_discount = discount1 + discount2 + discount3 + discount4 subtotal_after_discount = subtotal - total_discount sales_tax = 0.08 total_c...
Emma and John have $50. John owns 7/10 of the amount. Emma borrowed $10 from John and John borrowed $5 from Emma. After returning the debts, how much money does John have?
def solve() -> int: total_money = 50 john_money = total_money * (7/10) emma_money = total_money - john_money emma_money += 10 john_money -= 10 john_money += 5 emma_money -= 5 result = john_money return result
Student: Adam is growing sunflowers in his garden. He starts with 5 sunflower seeds and plants them in the first month. Each sunflower produces 3 seeds in the second month, which Adam also plants. In the third month, each sunflower produces 6 seeds, which Adam again plants. However, in the fourth month, 20% of the sunf...
def solve() -> int: num_seeds_start = 5 num_seeds_second_month = 3 num_seeds_third_month = 6 percent_die_fourth_month = 0.2 num_seeds_fourth_month = num_seeds_start + num_seeds_second_month * num_seeds_start + num_seeds_third_month * num_seeds_second_month * num_seeds_start - percent_die_fourth_mont...
A construction worker was building a house and laid down 200 bricks on the first day. On the next day, 50 bricks were taken away and two times as many bricks were delivered. On the third day, 80 bricks were taken away and 10 bricks were delivered. How many bricks are in the house now?
def solve() -> int: first_day = 200 second_day = first_day - 50 + 2 * first_day third_day = second_day - 80 + 10 total_bricks = third_day result = total_bricks return result
A gardener planted some tulip bulbs in a rectangular flower bed that measured 10 feet by 8 feet. He placed the bulbs in a grid pattern, leaving 6 inches of space between each bulb and 1 foot of space between the edge of the flower bed and the first row and column of bulbs. How many bulbs did he plant in total?
def solve() -> int: feet_to_inches = 12 flower_bed_length = 10 * feet_to_inches flower_bed_width = 8 * feet_to_inches space_length = flower_bed_length - 2 * feet_to_inches space_width = flower_bed_width - 2 * feet_to_inches bulb_size = 6 row_number = space_length // bulb_size colu...
John earns $50 every hour he works. If he works 6 hours a day for 5 days a week, how much money will he earn in a week?
def solve() -> int: earnings_per_hour = 50 hours_per_day = 6 days_per_week = 5 total_hours_per_week = hours_per_day * days_per_week total_earnings_per_week = total_hours_per_week * earnings_per_hour result = total_earnings_per_week return result
A bicycle costs $500. If it is discounted by 15%, how much is the discounted price?
def solve() -> int: price = 500 discount = 0.15 result = price * (1 - discount) return result
At the pet store, Mike bought 500 pounds of food for his dogs. He fed them 25% on Monday, 20% on Tuesday and the rest on the other days. How many pounds of food did Mike feed his dogs on each of the other days?
def solve() -> int: pounds = 500 days = 7 mon_percent = 0.25 tue_percent = 0.2 remaining_percent = 1 - mon_percent - tue_percent mon = pounds * mon_percent tue = pounds * tue_percent remaining = pounds * remaining_percent remaining_each = remaining / (days - 2) result = remaining...
A store has a sale with a discount of 20% off the original price. If an item originally costs $50, how much does it cost after the discount?
def solve() -> int: original_price = 50 discount = 0.2 discounted_price = original_price - (original_price * discount) result = discounted_price return result
If a train travels 120 miles in 2 hours, what is its speed in miles per hour?
def solve() -> int: distance = 120 time = 2 speed = distance / time result = speed return result
Katie has a bag of candy that is 40% chocolate. If the bag contains 500 grams of candy, how many grams of chocolate does Katie have?
def solve() -> int: candy_weight = 500 chocolate_percentage = 40 chocolate_weight = (chocolate_percentage / 100) * candy_weight result = chocolate_weight return result
am drives 140 kilometers in two hours and 20 minutes. What is his average speed in meters per second?
def solve() -> int: time_in_seconds = (2 * 60 * 60) + (20 * 60) distance_in_meters = 140 * 1000 speed = distance_in_meters / time_in_seconds result = speed return result
Mr. Smith works as a consultant, and he makes $150 for 20 hours of consulting and an extra $20 for every hour of overtime. If he worked 35 hours in total last week, how much did he earn?
def solve() -> int: hours_worked = 35 regular_hours = 20 overtime_hours = hours_worked - regular_hours hourly_rate = 20 regular_pay = 150 overtime_pay = overtime_hours * hourly_rate total_pay = regular_pay + overtime_pay result = total_pay return result
Kelly enjoys horse riding and visits a stable every weekend. The cost for one hour of riding is $25. After a year, the cost increased to $30, and Kelly decided to visit only once a month. How much did Kelly spend on horse riding after 3 years?
def solve() -> int: hourly_cost = 25 yearly_cost = hourly_cost * 52 * 1.0 new_hourly_cost = 30 new_yearly_cost = new_hourly_cost * 12 * 1.0 total_cost = yearly_cost * 3 + new_yearly_cost result = total_cost return result
Student: Tom and his sister went to the store to buy snacks. Tom bought 40 pretzels and his sister bought 32 pretzels. How many pretzels did they buy in total?
def solve() -> int: tom_pretzels = 40 sister_pretzels = 32 total_pretzels = tom_pretzels + sister_pretzels result = total_pretzels return result
A car traveled 250 miles on 8 gallons of gas. If gas costs $3 per gallon and there was a 5% tax, how much did the driver spend on gas?
def solve() -> int: mpg = 250 / 8 price_per_gallon = 3 * 1.05 total_cost = price_per_gallon * 8 result = total_cost return result
Three numbers are in the ratio of 3:4:5. If the sum of the numbers is 360, what is the largest number?
def solve() -> int: total_ratio = 3+4+5 smallest_number = 360/(total_ratio) largest_number = smallest_number*5 result = largest_number return result
Kevin needs to buy 80 apples and 60 bananas with a discount of 5%, how much will he pay if an apple costs 75 cents and a banana costs 50 cents?
def solve() -> int: discount = 0.05 apple_price = 0.75 banana_price = 0.50 apples = 80 bananas = 60 total_without_discount = (apple_price * apples) + (banana_price * bananas) discount_value = total_without_discount * discount total_with_discount = total_without_discount - discount_va...
A clothing store offers a 25% discount on all purchases over $100. If a customer spends $150, how much will they pay?
def solve() -> int: total_cost = 150 discount_threshold = 100 discount_percentage = 0.25 if total_cost > discount_threshold: discount_amount = (total_cost - discount_threshold)*discount_percentage discounted_cost = total_cost - discount_amount else: discounted_cost = total_co...
ally can run 1200 meters in 6 minutes. If she wants to run a total of 6000 meters, how long will it take her in minutes?
def solve() -> int: meters_per_minute = 1200 / 6 total_meters = 6000 time = total_meters / meters_per_minute result = time return result
A train travels at a constant speed of 80 kilometers per hour. How far can it travel in 2 and a half hours?
def solve() -> int: speed = 80 time_in_hours = 2.5 distance = speed * time_in_hours result = distance return result
David and Emily baked 24 cookies on a Friday. They ate 1/4 of the cookies on the same day and saved the rest. On Saturday, David gave 2/5 of the remaining cookies to his neighbor and Emily ate 2/3 of the remaining cookies. How many cookies did Emily have on Saturday?
def solve() -> int: ate = 24 * 1/4 saved = 24 - ate david_gave = saved * 2/5 left = saved - david_gave emily_ate = left * 2/3 emily_had = left - emily_ate result = emily_had return result
If Jake has 18 pencils and 12 notebooks, Ethan has 6 more pencils and 5 less notebooks than Jake, and Hannah has 9 more notebooks and 4 less pencils than Jake, how many school items do they have altogether?
def solve() -> int: jake_pencils = 18 jake_notebooks = 12 ethan_pencils = jake_pencils + 6 ethan_notebooks = jake_notebooks - 5 hannah_pencils = jake_pencils - 4 hannah_notebooks = jake_notebooks + 9 total_items = jake_pencils + jake_notebooks + ethan_pencils + ethan_notebooks + hannah_penci...
Clark has a 12-square meter lemon farm. Each square meter has 10 lemon trees and each tree can produce 27 lemons in 16 months. If Clark charges $0.60 per lemon, how much will he earn in 3 years?
def solve() -> int: total_square_meters = 12 trees_per_square_meter = 10 lemons_per_tree = 27 charge_per_lemon = 0.60 total_months = 3*12 actual_harvest_months = total_months / 16 total_trees = total_square_meters * trees_per_square_meter total_lemons = total_trees * lemons_per_tree...
If a book has 300 pages and someone read 1/3 of it, how many pages is left to read?
def solve() -> int: pages = 300 read = pages * 1/3 left = pages - read result = left return result
``` A group of friends went out to eat and the bill was $105. They decided to split the bill equally, but one friend decided to leave early and only gave $20 towards the bill. How much does each person have to pay to split the rest of the bill equally?
def solve() -> int: bill = 105 amount_paid = 20 amount_owed = bill - amount_paid num_friends = 4 per_person = amount_owed / num_friends result = per_person return result
The distance from New York to Los Angeles is 2,800 miles. If a car travels at a speed of 70 miles per hour, how many hours will it take?
def solve() -> int: distance = 2800 speed = 70 time = distance / speed result = time return result
Ethan wants to buy 5 shirts of different colors. The first shirt costs $20 and each successive shirt costs $3 more than the previous one. If Ethan has $100, how much money will he have left after buying all the shirts?
def solve() -> int: shirt_cost = 20 additional_cost = 3 num_shirts = 5 total_cost = shirt_cost + additional_cost * (num_shirts - 1) money_left = 100 - total_cost result = money_left return result
Barbara has 3 times as many pencils as erasers. She has 36 erasers. How many pencils does she have?
def solve() -> int: num_erasers = 36 num_pencils = 3 * num_erasers result = num_pencils return result
A group of friends went out to eat and the total bill was $85. They want to leave a 20% tip. How much will each person need to contribute to pay for the meal and tip equally?
def solve() -> int: bill_total = 85 tip_percent = 0.2 num_people = 4 total_with_tip = bill_total*(1 + tip_percent) each_person = total_with_tip/num_people result = each_person return result
Ethan works as a valet and gets paid $6.00 per hour. In one hour, he parks 15 cars and receives a $2.00 tip for each car. How much money did he earn in that hour?
def solve() -> int: hourly_rate = 6.00 cars_parked = 15 tip_per_car = 2.00 total_earnings = (hourly_rate * cars_parked) + (tip_per_car * cars_parked) result = total_earnings return result
A train travels from city A to city B at a constant speed of 80 miles per hour. It then turns around and travels from city B to city A at a speed of 60 miles per hour. If the distance between the two cities is 240 miles, how long does it take for the train to complete the round trip?
def solve() -> int: distance = 240 speed1 = 80 speed2 = 60 time1 = distance / speed1 time2 = distance / speed2 total_time = time1 + time2 result = total_time return result
A haunted house can accommodate 25 people in 5 minutes. If the haunted house is open from 8:00 pm until 11:00 pm, how many people will enter?
def solve() -> int: capacity_per_minute = 25 opening_time = 3 * 60 total_capacity = capacity_per_minute * opening_time result = total_capacity return result
A train travels at a constant speed of 60 km/h. If it travels for 2.5 hours, what distance does it cover?
def solve() -> int: speed = 60 time_taken = 2.5 distance_covered = speed * time_taken result = distance_covered return result
Emily owns a store that sells organic fruits and vegetables. She charges 20% more than regular produce. On average, she sells 30 items a day and her store is open every day except Sunday. If a pound of regular produce costs $2, how much does Emily make in a week?
def solve() -> int: regular_produce_cost = 2 markup_percentage = 20 items_sold_per_day = 30 days_open_per_week = 6 markup_amount = regular_produce_cost * (markup_percentage / 100) selling_price = regular_produce_cost + markup_amount revenue_per_day = selling_price * items_sold...
Possible questions and programs are: There are 16 chocolate bars and 24 candy canes in a box. Jack wants to share them equally among his four friends. How many pieces of candy (chocolate bars or candy canes) will each friend get?
def solve() -> int: total_candy = 16 + 24 pieces_per_friend = total_candy // 4 result = pieces_per_friend return result
Student: Rachel bought seven packets of seeds for her garden. Each packet has 50 seeds. She plants 20 seeds per day. How many days will it take her to plant all the seeds?
def solve() -> int: packets = 7 seeds_per_packet = 50 seeds_planted_per_day = 20 total_seeds = packets * seeds_per_packet days_required = total_seeds / seeds_planted_per_day result = days_required return result
Student: Nick saved $21 in March. He saved $30 in April and $16 in May. Then Nick spent $25 on a bike and $17 on a lock. How much money does Nick have left?
def solve() -> int: march_saving = 21 april_saving = 30 may_saving = 16 bike_cost = 25 lock_cost = 17 total_saving = march_saving + april_saving + may_saving total_spent = bike_cost + lock_cost result = total_saving - total_spent return result