question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A factory produces 120 units of product A and 80 units of product B. Each unit of A requires 4 hours of labor and each unit of B requires 8 hours of labor. If the factory has 800 hours of labor available, how many units of A and B can they produce?
def solve() -> int: hours_per_A = 4 hours_per_B = 8 total_hours = 800 total_units = total_hours // hours_per_A units_of_A = min(total_units, 120) units_of_B = min(total_units - units_of_A, 80) result = (units_of_A, units_of_B) return result
Judith studied for 6 hours and completed 90 pages of math. How many pages did she complete in 1 hour?
def solve() -> int: time = 6 pages = 90 rate = pages / time eachhour = rate * 1 result = eachhour return result
Possible new questions: Alia is planning a road trip with her friends. She knows that her car consumes 0.07 liters of gas per kilometer, and gas costs $1.25 per liter. She also wants to save 10% of the total gas cost for emergencies. How much money does she need to budget for gas if her trip is 800 kilometers long?
def solve() -> int: gas_liters = 0.07 * 800 gas_cost = gas_liters * 1.25 emergency = gas_cost * 0.1 budget = gas_cost + emergency result = budget return result
John wants to make smoothies for his family in July and August. He uses 1/2 cup of milk in the morning and 2/5 cup of berries in the evening. What is the total amount of milk and berries he needs for these two months?
def solve() -> int: milk_per_day = 1/2 berries_per_day = 2/5 days_in_july = 31 days_in_august = 31 total_milk = milk_per_day * (days_in_july + days_in_august) total_berries = berries_per_day * (days_in_july + days_in_august) result = total_milk + total_berries return resul...
A gym has 1000 members. If each member pays $50 per month, how much money does the gym earn per year?
def solve() -> int: members = 1000 monthly_payment = 50 total_income = members * monthly_payment * 12 result = total_income return result
Max had $800 and spent 3/5 of his money on a new guitar. He then bought some accessories with 1/4 of what was left. How much did he spend on accessories?
def solve() -> int: money = 800 spent_on_guitar = money * 3/5 money_left = money - spent_on_guitar spent_on_accessories = money_left * 1/4 result = spent_on_accessories return result
Evelyn bought a box of brownies that had a certain number of pieces. Her dad ate 7 pieces from the brownies at two different points in time, and then Evelyn decided she would make an ice cream sundae with the remaining pieces. If she uses 4 pieces of brownie to make 1 ice cream sundae, how many pieces were in the origi...
def solve() -> int: result = 29 print return result
Gabriella can knit a hat in 1 hour and a scarf in 2 hours. If she spends 5 hours knitting hats and 3 hours knitting scarves, how many knit items did she make?
def solve() -> int: hat_time = 1 scarf_time = 2 total_hat_time = 5 total_scarf_time = 3 hats_made = total_hat_time // hat_time scarves_made = total_scarf_time // scarf_time total_items = hats_made + scarves_made result = total_items return result
If a car travels 60 miles in 1 hour, how long does it take to travel 80 miles?
def solve() -> int: distance = 80 speed = 60 time = distance/speed result = time return result
There are 5 boxes of apples. If each box contains 25 apples, how many apples are there in total?
def solve() -> int: boxes = 5 apples_per_box = 25 total_apples = boxes * apples_per_box result = total_apples return result
The ages of four siblings are consecutive even integers whose sum is 76. What is the age of the eldest sibling?
def solve() -> int: a = (76-6)/4 result = a*3+6 return result
-Capitalize the first letter of each question and end each question with a question mark. A baker makes 8 loaves of bread every day. He sells each loaf for $5. However, he also has to pay $2 for each kilogram of flour he uses, and he uses 0.5 kilograms of flour for each loaf. How much profit does he make in a week (ass...
def solve() -> int: loaves = 8 price = 5 cost = 2 flour = 0.5 days = 7 revenue = loaves * price * days cost = loaves * cost * flour * days profit = revenue - cost result = profit return result
David collects and sells stamps. He buys 200 stamps for $50 and sells them for $0.5 each. He also pays $20 for a stamp album to store and display his stamps. How much money does David make after paying for the stamps and the album?
def solve() -> int: stamps = 200 buy_price = 50 sell_price = 0.5 album = 20 revenue = stamps * sell_price cost = buy_price + album profit = revenue - cost result = profit return result
Jackson works in a bookshop that sells 20 books per day. If the bookshop operates for 5 days in a week, how many total books are sold in a week?
def solve() -> int: books_per_day = 20 days_per_week = 5 total_books_sold = books_per_day * days_per_week result = total_books_sold return result
A car dealership sold 85 cars last month. Out of these, 60 were sedans and the rest were SUVs. How many SUVs were sold?
def solve() -> int: total_cars = 85 sedans = 60 suvs = total_cars - sedans result = suvs return result
David is buying candy for his classmates. He can buy a pack of 12 candies for $3 or a pack of 18 candies for $4. He wants to buy the same number of candies for each of his 30 classmates. What is the minimum amount of money he needs to spend?
def solve() -> int: pack_12 = 3 pack_18 = 4 candy_12 = 12 candy_18 = 18 cost_12 = pack_12 / candy_12 cost_18 = pack_18 / candy_18 if cost_12 < cost_18: cheaper_pack = candy_12 cheaper_cost = cost_12 else: cheaper_pack = candy_18 cheaper_cost = cost_18 total_ca...
Mia wants to buy some flowers. Roses cost $2, tulips cost $1.5, and daisies cost $1. If Mia buys 10 roses, 8 tulips, and 12 daisies, what is the average cost of each flower in dollars?
def solve() -> int: total_cost = 10 * 2 + 8 * 1.5 + 12 * 1 total_flowers = 10 + 8 + 12 average_cost = total_cost / total_flowers result = average_cost return result
A recipe requires 3 1/2 cups of flour to make 10 pancakes. How many cups of flour are required to make 23 pancakes?
def solve() -> int: flour_per_pancake = 3.5 / 10 total_flour = flour_per_pancake * 23 result = total_flour return result
Student: Chris has 3 times as many stamps as Niki. Niki has twice as many stamps as Ali. If Chris has 64 stamps, how many stamps does Ali have?
def solve() -> int: chris = 64 niki = 0 ali = 0 niki = ali * 2 niki = chris / 3 ali = niki / 2 niki = chris / 3 ali = chris / 6 result = ali return result
Student: Ryan has 4 packages of chips. Each package contains 6 chips. How many chips does he have in total?
def solve() -> int: package = 4 chips_per_package = 6 total_chips = package * chips_per_package result = total_chips return result
Emily had 11 toy cars and her brother gave her one-fourth of his 28 toy cars. How many toy cars does Emily have now?
def solve() -> int: emily_toy_cars = 11 brother_toy_cars = 28 emily_toy_cars += brother_toy_cars / 4 result = emily_toy_cars return result
- Lily plants 5 sunflowers in July. Each month, the number of sunflowers she plants doubles. How many sunflowers will she plant in November?
def solve() -> int: sunflowers = 5 for month in range(4): sunflowers = sunflowers * 2 result = sunflowers return result
Student: Suzie has $50 and wants to buy a pair of shoes that costs $75. She decides to earn the extra money by doing yard work for her neighbors for $10 per hour. How many hours does she need to work to make enough money to buy the shoes?
def solve() -> int: shoes_cost = 75 suzie_money = 50 hourly_rate = 10 money_needed = shoes_cost - suzie_money hours_needed = money_needed / hourly_rate hours_needed = round(hours_needed) result = hours_needed return result
Student: If a small pizza costs $5, a medium pizza costs $8, and a large pizza costs $12, and you have $60 to spend, how many pizzas of each size can you buy to get the most slices of pizza possible?
def solve() -> int: small_pizza_cost = 5 medium_pizza_cost = 8 large_pizza_cost = 12 total_money = 60 max_small_pizzas = total_money // small_pizza_cost max_medium_pizzas = total_money // medium_pizza_cost max_large_pizzas = total_money // large_pizza_cost max_slices = max_small_pizzas *...
A pack of gum has 12 pieces and costs $1.20. A friend gives you half of his pack of gum. How much did your friend spend on the gum he gave you?
def solve() -> int: cost_per_piece = 1.20 / 12 cost_of_half_pack = cost_per_piece * 6 result = cost_of_half_pack return result
Nate wants to purchase a $80,000 electric guitar that his colleague, Ben, is selling. Nate currently has $250 in cash. He proceeds to sell his 5 synthesizers, each expected to fetch $500. How much money will Nate have left after buying Ben's electric guitar?
def solve() -> int: cash = 250 guitar_price = 80000 synthesizer_price = 500 num_synthesizers = 5 total_synthesizer_price = synthesizer_price * num_synthesizers total_cost = guitar_price + total_synthesizer_price money_left = cash - total_cost result = money_left return resu...
A train leaves a station and travels east at a speed of 70 miles per hour. Two hours later, a second train leaves the same station and travels east on a parallel track at a speed of 90 miles per hour. How far from the station will the trains be after 6 hours?
def solve() -> int: speed_train1 = 70 speed_train2 = 90 time_train2 = 4 distance_train1 = speed_train1*time_train2 distance_train2 = speed_train2*time_train2 total_distance = distance_train1 + distance_train2 result = total_distance return result
Student: Jay drives 8,000 miles a year and needs to make an oil change every 10,000 miles. He gets 6 free oil changes a year. If an oil change costs $65, how much money does Jay spend on oil changes every year?
def solve() -> int: miles_driven_per_year = 8000 miles_per_oil_change = 10000 free_oil_changes_per_year = 6 cost_per_oil_change = 65 oil_changes_needed_per_year = miles_driven_per_year // miles_per_oil_change oil_changes_paid_for_per_year = oil_changes_needed_per_year - free_oil_changes_per_year...
Lily has eight window screens. When they are unfolded, each screen covers an area of 24 x 24 inches. After she folds them up, their total area is 16 square feet. How many times did she fold them?
def solve() -> int: screen_area = 24 * 24 total_area = 16 * 12 * 12 folded_screens = total_area / screen_area result = folded_screens return result
Ava has $6.00 in change made up of quarters, dimes, and nickels. She has 18 quarters and 16 dimes. How many nickels does she have?
def solve() -> int: quarters = 18 dimes = 16 total_change = 6.00 quarters_value = quarters * 0.25 dimes_value = dimes * 0.10 remaining_value = total_change - quarters_value - dimes_value nickels = remaining_value / 0.05 result = nickels return result
An online store distributes books in packages of 4 books. If a customer orders 80 books, how many packages will they receive?
def solve() -> int: books = 80 per_package = 4 result = books / per_package return result
Angela's house has an area of 1,500 square feet. There are 5 windows that are each 3 x 6 feet. The bedrooms measure 12 x 10 feet, while the bathrooms are 6 x 8 feet each. The foyer and the kitchen combined have an area equal to the area of the living room. What is the area of the kitchen?
def solve() -> int: house_area = 1500 window_area = 5 * (3 * 6) bedroom_area = 2 * (12 * 10) bathroom_area = 2 * (6 * 8) living_room_area = house_area - window_area - bedroom_area - bathroom_area kitchen_foyer_area = living_room_area / 2 kitchen_area = kitchen_foyer_area result...
Mark has 8 cars. He gave 5 cars to his brother and he bought 7 more cars. How many cars does Mark have now?
def solve() -> int: cars_before = 8 cars_given = 5 cars_bought = 7 total_cars = cars_before - cars_given + cars_bought result = total_cars return result
Student: Christina wants to buy new books for her home library. Each hardcover book cost $15 and each paperback book cost $10. She spends $167. How many paperback books did Christina buy?
def solve() -> int: hardcover_price = 15 paperback_price = 10 total_spent = 167 num_hardcover = total_spent // hardcover_price remaining_money = total_spent - num_hardcover * hardcover_price num_paperback = remaining_money // paperback_price result = num_paperback return result
Student: If Catherine spends 1/4 of her salary on rent and the remaining 3/4 on bills, how much does she spend on bills if her salary is $4,000 per month and her rent is $800?
def solve() -> int: salary = 4000 rent = 800 fraction = 1/4 bills = (salary - rent) * fraction result = bills return result
Tom saved 18 dollars and Susie saved 15 dollars. How much money did Tom and Susie saved together?
def solve() -> int: savings_Tom = 18 savings_Susie = 15 result = savings_Tom + savings_Susie result = 33 return result
Student: A store sells 3 shirts for $45. What is the price of one shirt?
def solve() -> int: num_shirts = 3 total_price = 45 price_per_shirt = total_price / num_shirts result = price_per_shirt return result
Student: Mia has 1186 marbles and she wants to give them away equally to her five friends. How many marbles does each of her friends get?
def solve() -> int: marbles = 1186 friends = 5 result = marbles // friends return result
Two ships sail to different ports for cargo delivery. If one ship sails from Port A to Port B, which is 1000 miles apart, and then to Port C, which is 2000 miles from Port B, while the other ship sails from Port X to Port Y, which is 1500 miles apart, and then back to Port X and on to Port Z, which is 3000 miles from P...
def solve() -> int: distance_AB = 1000 distance_BC = 2000 distance_XY = 1500 distance_XZ = 3000 total_distance_ship1 = distance_AB + distance_BC + distance_AB + distance_XY + distance_XZ total_distance_ship2 = distance_XY + distance_XZ + distance_XY + distance_XZ total_distance = t...
David and his friends went to the amusement park. Each ticket cost $35 and they also had to pay an additional $25 parking fee. What was the total cost?
def solve() -> int: ticket_cost = 35 parking_fee = 25 total_cost = ticket_cost + parking_fee result = total_cost return result
A bus runs at a speed of 40 miles per hour. If the bus driver drives for 12 hours, how far did the bus travel?
def solve() -> int: speed = 40 time = 12 distance = speed * time result = distance return result
Daniel has a coupon that gives him 15% off any purchase at a bookstore. He buys a book for $18 and a magazine for $6. How much does he pay after using the coupon?
def solve() -> int: amount = round(24 - 0.15 * 24, 2) result = amount return result
ally the Kight has 3600 gold coins. She donated 20% of them to the local temple. How much gold did Sally donate?
def solve() -> int: gold_coins = 3600 percentage = 20 result = gold_coins * percentage / 100 return result
Claire and Dave play basketball together, earning 2 points for every basket made. After playing 25 rounds, Claire scored 9 points less than 2/3 of the total points scored. How many total points did Dave score?
def solve() -> int: points_per_basket = 2 rounds_played = 25 total_points = points_per_basket * 2 * rounds_played claire_points = (2/3) * total_points - 9 dave_points = total_points - claire_points result = dave_points return result
Student: At a clothing store, t-shirts are sold for $15 each and jeans are sold for $40 each. If Sam buys 2 t-shirts and 1 pair of jeans, how much does he spend in total?
def solve() -> int: t_shirt_price = 15 jeans_price = 40 num_t_shirts = 2 num_jeans = 1 total_cost = t_shirt_price * num_t_shirts + jeans_price * num_jeans result = total_cost return result
Kate has a cake that weighs 2 pounds. She cuts it into 8 equal slices and puts some frosting on each slice. The frosting adds 0.1 pound to each slice. How much does one slice of cake with frosting weigh?
def solve() -> int: slice_weight = 2 / 8 slice_with_frosting = slice_weight + 0.1 result = slice_with_frosting return result
Leo can write 6 articles in 4 hours, he took a course that enhanced his writing skills and it increased his writing speed by 15 percent. How many articles can Leo write in 10 hours?
def solve() -> int: original_articles_per_hour = 6 / 4 enhanced_articles_per_hour = original_articles_per_hour * 1.15 articles_in_10_hours = enhanced_articles_per_hour * 10 result = articles_in_10_hours return result
A gym has eight different exercise areas containing three times as many weights as machines. Three of the areas are dedicated to machines. The weights are divided evenly among the remaining areas. One area contains 10 machines, and the other two areas house 20 machines each. How many weights are in each weight area?
def solve() -> int: weights = 0 machines = 0 total_machines = 10 + 20 + 20 weights = total_machines * 3 num_weight_areas = 8 - 3 weights_per_area = weights / num_weight_areas result = weights_per_area return result
ophia and Isabella planted flowers. Sophia planted 7 flowers while Isabella planted 3 less than four times as many as Sophia's. How many flowers did they plant together?
def solve() -> int: sophia = 7 isabella = (sophia * 4) - 3 total = sophia + isabella result = total return result
Helen buys a dress that costs $60 and is on sale for 20% off. She also pays 8% sales tax on the discounted price. How much does she pay for the dress?
def solve() -> int: original_price = 60 discount_rate = 0.2 tax_rate = 0.08 discounted_price = original_price * (1 - discount_rate) tax_amount = discounted_price * tax_rate final_price = discounted_price + tax_amount result = final_price return result
Hannah and Tyler are measuring ingredients for a cake. Hannah can measure 100 grams in 2 minutes. Tyler can measure 150 grams in 4 minutes. If they measure for 6 minutes together, how many grams will they have measured in total?
def solve() -> int: hannah_grams_per_minute = 100 / 2 tyler_grams_per_minute = 150 / 4 total_grams_measured = (hannah_grams_per_minute + tyler_grams_per_minute) * 6 result = total_grams_measured return result
A candy bar costs $2.25 and a bag of chips costs twice as much. If someone buys four candy bars and two bags of chips, how much do they spend in total?
def solve() -> int: quantity_candy = 4 price_candy = 2.25 quantity_chips = 2 price_chips = 2 * price_candy total_cost = (quantity_candy * price_candy) + (quantity_chips * price_chips) result = total_cost return result
Student: Eric purchased a laptop for $800, a phone $150 and a headset for $50 last month. This month he bought a new mouse for $25. How much did Eric spend altogether this month?
def solve() -> int: laptop = 800 phone = 150 headset = 50 mouse = 25 last_month = laptop + phone + headset this_month = mouse total = last_month + this_month result = total return result
Student: Ben earns $12 per hour and worked 36 hours last week. If he gets time and a half for every hour worked over 30, how much did he earn last week?
def solve() -> int: hourly_wage = 12 hours_worked = 36 overtime_hours = hours_worked - 30 overtime_wage = hourly_wage * 1.5 regular_pay = hourly_wage * hours_worked overtime_pay = overtime_wage * overtime_hours total_pay = regular_pay + overtime_pay result = total_pay return result
At a club membership meeting, 75 students attended. This is 64% of the membership. How many students are in the club?
def solve() -> int: members = ((75/64)*100) result = members return result
Bill buys 18 packs of gum. He uses 4/9 of them. How many packs of gum does he have left?
def solve() -> int: result = 0 packs_used = 4/9 * 18 packs_left = 18 - packs_used result = packs_left return result
A bakery sold 180 cupcakes in January. The sales in February increased by 20%. The sales in March decreased by 10% from February. What is the average number of cupcakes sold per month for these three months?
def solve() -> int: sales_feb = 180 * 1.2 sales_mar = sales_feb * 0.9 total_sales = 180 + sales_feb + sales_mar average_sales = total_sales / 3 result = average_sales return result
A ferry boat can carry a maximum of 100 passengers per trip. If there are 295 passengers waiting to be transported, how many trips will be needed?
def solve() -> int: max_passengers = 100 waiting_passengers = 295 trips_required = waiting_passengers // max_passengers + (waiting_passengers % max_passengers > 0) result = trips_required return result
If Jane's rent is $750 and she receives monthly income of $960, how much money will she have left to cover other expenses?
def solve() -> int: monthly_rent = 750 monthly_income = 960 Money_left = monthly_income - monthly_rent result = Money_left return result
A bike shop rented out 18 bikes for $12.50 per day and 24 bikes for $15.75 per day. If they earned $539.25 in total, how many days were the bikes rented for?
def solve() -> int: no_of_bikes_first_type = 18 no_of_bikes_second_type = 24 price_first_type = 12.5 price_second_type = 15.75 total_amount = 539.25 days_rented = (total_amount - (no_of_bikes_first_type * price_first_type) - (no_of_bikes_second_type * price_second_type)) / (no_of_bikes_first_typ...
A company has a total of 200 employees, of which 40% are women. How many men are there in the company?
def solve() -> int: num_women = 0.4*200 num_men = 200 - num_women result = num_men return result
Sophia’s mom gives her an apple for a snack every day during the school week (Monday to Friday). There are 40 school weeks in the year and Sophia has only missed 5 weeks. How many apples did Sophia eat throughout the year?
def solve() -> int: weeks_in_year = 40 missed_weeks = 5 school_weeks = weeks_in_year - missed_weeks apples_per_week = 1 total_apples = school_weeks * apples_per_week result = total_apples return result
Student: Ryan has 24 bottles of juice, each bottle contains 8 ounces of juice. He drinks 3 ounces of juice every day and shares 2 bottles of juice with his friends every week. How many days will it take for him to finish all the juice?
def solve() -> int: bottles = 24 juice_per_bottle = 8 total_juice = bottles * juice_per_bottle daily_juice_consumption = 3 weekly_juice_sharing = 2 * juice_per_bottle days_to_finish_juice = total_juice / (daily_juice_consumption + 7 * weekly_juice_sharing) result = days_to_finish_juice ...
Ava has 40 apples, and Finn has 16 bananas. If they put their fruits together and then each takes away 1/10 of the total number of fruits, how many fruits are left in the end?
def solve() -> int: apples = 40 bananas = 16 total_fruits = apples + bananas each_takes_away = total_fruits / 10 fruits_left = total_fruits - each_takes_away result = fruits_left return result
The length of a rectangle is 8 feet longer than the width. If the perimeter of the rectangle is 40 feet, what is the length of the rectangle?
def solve() -> int: perimeter = 40 width = perimeter / 2 - 8 / 2 length = width + 8 result = length return result
Student: In a town of 135 people 90 have read the new novel, 60 have seen the new movie and 30 have done both. How many people have done neither?
def solve() -> int: people = 135 read_novel = 90 seen_movie = 60 both = 30 neither = people - read_novel - seen_movie + both result = neither return result
There are 12 pencils in a box. Each pencil has a length of 18 cm. If 3 pencils are broken in half and 2 pencils are sharpened by 2 cm each, what is the total length of the pencils in the box?
def solve() -> int: pencils = 12 length = 18 broken = 3 * (length / 2) sharpened = 2 * (length - 2) remaining = (pencils - 3 - 2) * length total = broken + sharpened + remaining result = total return result
Student: Jamie is using a garden hose to fill a swimming pool with water. If it takes 4 hours to fill the pool with 300 gallons of water, how much time will it take to fill the pool with 800 gallons of water?
def solve() -> int: gallons_per_hour = 300 / 4 pool_capacity = 800 time = pool_capacity / gallons_per_hour result = time return result
There are 150 tourists on a trip and 1/7 of as many managers as tourists. If 1/5 of tourists and 1/3 of managers are left behind, how many people are on the trip?
def solve() -> int: tourists = 150 managers = (1/7) * tourists tourists_left = (1/5) * tourists managers_left = (1/3) * managers total_people = tourists - tourists_left + managers - managers_left result = total_people return result
A plumber charges $120 for a job plus an additional $30 per hour. If the plumber works for 5 hours, what is the total cost of the job?
def solve() -> int: hours_worked = 5 hourly_rate = 30 fixed_cost = 120 total_cost = fixed_cost + hourly_rate * hours_worked result = total_cost return result
If there are 9 jellybeans in a jar and Sarah takes 2 jellybeans out of the jar, what percentage of jellybeans are left inside?
def solve() -> int: jellybeans = 9 jellybeans -= 2 percentage_left = jellybeans/9 * 100 result = percentage_left return result
After Tina bought a 10% discount ticket, she paid $180 for a concert. If the original price of the ticket was $p, how much did Tina save by buying the discount ticket?
def solve() -> int: p = 180 / 0.9 result = 0.1 * p return result
Sarah wants to save money by setting aside a certain amount each week. She plans to start by saving $10 in the first week, then increase the amount by $2 each week for the next five weeks. How much money will Sarah have saved at the end of the six-week period?
def solve() -> int: week1 = 10 week2 = week1 + 2 week3 = week2 + 2 week4 = week3 + 2 week5 = week4 + 2 week6 = week5 + 2 total_saved = week1 + week2 + week3 + week4 + week5 + week6 result = total_saved return result
Maria planted 6 daisy bushes in her garden. Each daisy bush has 3 flowers, and 2 of the bushes have twice as many flowers as the others. How many flowers does Maria have in her garden in total?
def solve() -> int: number_of_flowers_in_each_normal_bush = 3 number_of_normal_bushes = 4 number_of_double_bushes = 2 result_normal = number_of_flowers_in_each_normal_bush * number_of_normal_bushes result_double = number_of_flowers_in_each_normal_bush * 2 * number_of_double_bushes resu...
Alex works 45 hours a week for $500 and earns $35 more per hour for every overtime hour worked. How much will she make by working 55 hours in a week?
def solve() -> int: hours_worked = 45 hourly_rate = 500 / hours_worked overtime_hours = 55 - hours_worked overtime_rate = hourly_rate + 35 overtime_pay = overtime_hours * overtime_rate total_pay = 500 + overtime_pay result = total_pay return result
If a book has 300 pages, how many pages are left to read if a person has already read 90 pages?
def solve() -> int: total_pages = 300 read_pages = 90 remaining_pages = total_pages - read_pages result = remaining_pages return result
In a grocery store, 25% of the fruit sold is apples, 30% is oranges, and the remaining is bananas. If there are 400 pieces of fruit sold, how many are bananas?
def solve() -> int: total_fruit_sold = 400 apples_percentage = 0.25 oranges_percentage = 0.30 bananas_percentage = 1 - apples_percentage - oranges_percentage bananas_sold = bananas_percentage * total_fruit_sold result = bananas_sold return result
A recipe calls for 2 cups of flour for every 3 cups of sugar. If the recipe has 9 cups of flour, how much sugar should be added?
def solve() -> int: flour_needed = 2 flour_available = 9 sugar_needed = 3 sugar_available = (flour_available/sugar_needed)*flour_needed result = sugar_available return result
A rectangle has a width of 8 cm and a length of 12 cm. What is the area of the rectangle?
def solve() -> int: width = 8 length = 12 area = width * length result = area return result
An athlete runs 2km in the first 6 minutes and 1.5km in the next 4 minutes. What was his average speed in km/h?
def solve() -> int: distance1 = 2.0 time1 = 6.0 / 60.0 distance2 = 1.5 time2 = 4.0 / 60.0 total_distance = distance1 + distance2 total_time = time1 + time2 average_speed = total_distance / total_time result = round(average_speed * 60, 2) return result
Daniel had 20 marbles of different colors. He lost 2 red marbles, 3 blue marbles, and 1 green marble when he played with his friends. He then found 4 yellow marbles and 2 purple marbles on the ground. What percentage of Daniel's marbles were yellow at the end of the day?
def solve() -> int: marbles = 20 - 2 - 3 - 1 + 4 + 2 yellow = 4 percent = (yellow / marbles) * 100 result = percent return result
Rapheal has 3 bags of marbles. The first bag has 4 marbles, the second bag has 16 marbles, and the third bag has 10 marbles. How many marbles does Rapheal have?
def solve() -> int: bag1amount = 4 bag2amount = 16 bag3amount = 10 totalAmount = bag1amount + bag2amount + bag3amount result = totalAmount return result
Student: A plumber has two types of pipe fittings: A and B. She has 50 fittings in total, and the ratio of A fittings to B fittings is 4:1. How many B fittings does she have?
def solve() -> int: total_fittings = 50 ratio_A_to_B = 4 num_A_fittings = total_fittings * (ratio_A_to_B / (ratio_A_to_B + 1)) num_B_fittings = total_fittings - num_A_fittings result = num_B_fittings return result
A purse contains 43 coins in total. 1/5 of the coins are quarters and 2/3 of the remaining coins are dimes. How many dimes are there in the purse?
def solve() -> int: total_coins = 43 quarters = total_coins/5 remaining_coins = total_coins - quarters dimes = (remaining_coins/3)*2 result = dimes return result
Olivia had 18 cupcakes and 5 of them had 2 cherries each. She sold 3 cupcakes for 1 muffin. One day, she found an additional 4 cupcakes in her fridge. How many cupcakes does Olivia have in total?
def solve() -> int: cupcakes = 18 cherries_per_cupcake = 2 sold_cupcakes = 5 muffins_per_cupcake = 3 additional_cupcakes = 4 total_cherries = cherries_per_cupcake * sold_cupcakes remaining_cupcakes = cupcakes - sold_cupcakes total_cupcakes = remaining_cupcakes + additional_cupcakes ...
Amina studied for 90 minutes every day for five days. David studied for 35 minutes on each of eight days. How many hours did Amina and David study in total?
def solve() -> int: amina_study_time = 90 david_study_time = 35 amina_days = 5 david_days = 8 amina_total_time = amina_study_time * amina_days david_total_time = david_study_time * david_days amina_total_hours = amina_total_time / 60 david_total_hours = david_total_time / 60 ...
Lisa drives at a constant speed of 40 miles per hour for 2 hours. She then increases her speed by 30% and drives for another 3 hours. What is her average speed for the trip?
def solve() -> int: distance_1 = 40*2 distance_2 = 1.3*(40*3) total_distance = distance_1 + distance_2 total_time = 2 + 3 average_speed = total_distance / total_time result = average_speed return result
A coffee shop sells 200 cups of coffee per day for $3 each. On a particular day, they had a promotional offer and sold 50 additional cups. If the promotional price was $2 for each cup, what was the total revenue on that day?
def solve() -> int: cups_sold_regularly = 200 price_per_cup_regular = 3 total_revenue_regular = cups_sold_regularly * price_per_cup_regular cups_sold_promotion = 50 price_per_cup_promotion = 2 total_revenue_promotion = cups_sold_promotion * price_per_cup_promotion total_revenue = total_reven...
A car rental company charges a flat rate of $40 per day plus an additional $0.20 per mile driven. If a customer rents a car for 3 days and drives a total of 500 miles, how much will they be charged?
def solve() -> int: days_rented = 3 miles_driven = 500 flat_rate = 40 * days_rented additional_fee = 0.20 * miles_driven total_cost = flat_rate + additional_fee result = total_cost return result
Alex read 4 books, Ethan read 11 books and Clare read 13 books. Alex and Ethan read 3 of the same books and all three had read 8 of the same books as each other. In total how many different books have Alex, Ethan, and Clare read?
def solve() -> int: total_book = 0 shared_book = 3 + 8 total_book = 4 + 11 + 13 - shared_book result = total_book return result
Student: Daniel's age is equal to eight times Abby's age minus 10. Abby is two years younger than Frank. Frank is four times Ivy's age. If Ivy will be 6 in 2 years, how old is Daniel?
def solve() -> int: daniel_age = 0 abby_age = 0 frank_age = 0 ivy_age = 0 frank_age = ivy_age + 2 abby_age = frank_age - 2 daniel_age = 8 * abby_age - 10 ivy_age = 6 - 2 frank_age = ivy_age + 2 abby_age = frank_age - 2 daniel_age = 8 * abby_age - 10 result = daniel_age ...
A machine produces 200 bolts per hour. How many bolts can it produce in 8 hours and 15 minutes?
def solve() -> int: minutes_in_8_hours_15_minutes = (8 * 60) + 15 bolts_per_hour = 200 total_bolts_produced = minutes_in_8_hours_15_minutes / 60 * bolts_per_hour result = total_bolts_produced return result
A grocery store sells 30 dozen eggs per day. If each dozen eggs sells for $3.00, how much money do they make in a week assuming they are open for 7 days?
def solve() -> int: eggs_per_day = 30 * 12 price_per_dozen = 3.00 total_days = 7 total_sales = eggs_per_day / 12 * price_per_dozen * total_days result = total_sales return result
Student: Dave has 6 pairs of black socks and five times as many pairs of white socks as black socks. He also has half as many pairs of gray socks as black and white socks combined. How many total pairs of socks does Dave have?
def solve() -> int: black_socks = 6 white_socks = black_socks * 5 gray_socks = (black_socks + white_socks) / 2 total_socks = black_socks + white_socks + gray_socks result = total_socks return result
Student: A restaurant charges a 15% service charge on the total bill. If a customer's bill was $100, how much was the service charge?
def solve() -> int: bill = 100 service_charge_rate = 0.15 service_charge = bill * service_charge_rate result = service_charge return result
A car travels 240 miles in 4 hours. If the car continues to travel at the same speed, how far could it travel in 10 hours?
def solve() -> int: distance = 240 time = 4 speed = distance/time new_time = 10 new_distance = speed*new_time result = new_distance return result
A store has a sale with 25% off all clothing items. A shirt originally cost $40. How much does it cost with the discount?
def solve() -> int: original_price = 40 discount_percent = 25 discount_amount = original_price * (discount_percent/100) sale_price = original_price - discount_amount result = sale_price return result
Some possible questions are: A school has 500 students, 40 teachers and 15 staff members. Due to a snowstorm, the school had to close for three days and only 10% of the students, 25% of the teachers and 60% of the staff members could attend online classes. How many people from the school participated in online classes ...
def solve() -> int: x = 0.1 * 500 y = 0.25 * 40 z = 0.6 * 15 w = x + y + z result = w return result
Samantha has a rectangular garden that has a length of 10 meters and a width of 5 meters. She plants a row of flowers along the entire perimeter of the garden. Each side of the garden needs 6 flowers. How many flowers does Samantha need for her garden?
def solve() -> int: length = 10 width = 5 perimeter = 2 * length + 2 * width flowers_per_side = 6 total_flowers = perimeter * flowers_per_side result = total_flowers return result
Joy bought a table for $50. She had 1/4 of the money left. She bought a second table for 3/4 of the money left. How much money did she have left?
def solve() -> int: original_money = 50 remaining_money = original_money * 1/4 second_table_money = remaining_money * 3/4 result = remaining_money - second_table_money result = result return result