question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Alex has two part-time jobs. He works 4 hours at $10/hr on weekdays and 6 hours at $15/hr on weekends. How much does he earn in a week?
def solve() -> int: weekday_earnings = 4 * 10 * 5 weekend_earnings = 6 * 15 * 2 total_earnings = weekday_earnings + weekend_earnings result = total_earnings return result
If a house has a width of 35 feet and an area of 2625, how many houses of the same size would have a length of 75 feet?
def solve() -> int: width = 35 area = 2625 length = 75 ratio = length / width num_houses = area / (width * length) result = num_houses return result
Liam has twelve toy cars, each with an equal number of stickers on them. He took four stickers off each car and shared the remaining stickers equally with his two friends. If each friend received six stickers, how many stickers were on each car originally?
def solve() -> int: x = 16 result = x return result
There are two numbers whose sum is 35 and the difference is 5. What are the two numbers?
def solve() -> int: sumanddiff=35 diff=5 num2=(sumanddiff-diff)/2 num1=sumanddiff-num2 result=(num1+num2) return result
Student: How many pairs of pants did Alexis buy if she bought 21 pairs of pants and 18 dresses in total?
def solve() -> int: total_items = 21 + 18 dresses = 18 pairs_of_pants = total_items - dresses result = pairs_of_pants return result
A business sells 300 packs of pencils every day at $5 per pack. What is the total revenue for a month?
def solve() -> int: revenue_per_day = 300 * 5 days_in_month = 30 revenue_per_month = revenue_per_day * days_in_month result = revenue_per_month return result
New line Possible questions and programs: Alice bought 12 pencils from a store. She gave 3 pencils to her friend Bob and used 2 pencils for her homework. The next day, she lost 1 pencil on the way to school and gave another pencil to her teacher as a gift. How many pencils did Alice have left at the end of the day?
def solve() -> int: pencils = 12 pencils = pencils - 3 - 2 pencils = pencils - 1 - 1 result = pencils return result
A box of chocolates has 24 pieces and costs $12. If Sarah buys 3 boxes of chocolates and eats 10 pieces, how much does each piece of chocolate cost and how many pieces does she have left?
def solve() -> int: pieces_per_box = 24 cost_per_box = 12 boxes_bought = 3 pieces_eaten = 10 cost_per_piece = cost_per_box / pieces_per_box pieces_left = (pieces_per_box * boxes_bought) - pieces_eaten result = (cost_per_piece, pieces_left) return result
If John oversees a construction project using a reference of a building with 100 floors, 5000 rooms, and 50 elevators, and the new building should have half the number of floors, 10,000 rooms, and 60 elevators, how many elevators, rooms, and floors will be required?
def solve() -> int: floors_reference = 100 rooms_reference = 5000 elevators_reference = 50 floors_new = floors_reference / 2 rooms_new = 10000 elevators_new = 60 result = f"The new building will require {elevators_new} elevators, {rooms_new} rooms, and {floors_new} floors." ret...
Olivia has 12 stickers and her best friend Ava has thrice as many. If Ava gives 5 stickers to Olivia, how many stickers do they both have now?
def solve() -> int: olivia_stickers = 12 ava_stickers = olivia_stickers * 3 ava_stickers -= 5 stickers_together = olivia_stickers + ava_stickers result = stickers_together return result
Jack walked for 1 hour every day for two weeks. Sophia walked for 20 minutes on each of six days. How many minutes did they walk in total?
def solve() -> int: jack_walked_per_day = 60 jack_days = 14 sophia_walked_per_day = 20 sophia_days = 6 jack_total_minutes = jack_walked_per_day * jack_days sophia_total_minutes = sophia_walked_per_day * sophia_days total_minutes = jack_total_minutes + sophia_total_minutes ...
Rita needs to borrow a total of $27 from her father. She has already borrowed $13. How much money does she need?
def solve() -> int: amount_borrowed = 13 amount_needed = 27 result = amount_needed - amount_borrowed return result
- Leo likes to listen to music on his headphones. He listened to a song that was 3 minutes long, and then listened to another song that was 25% shorter. How many total minutes did he spend listening to music?
def solve() -> int: second_song = 3 * 0.75 total_minutes = 3 + second_song result = total_minutes return result
Student: You have 70$ to spend on accessories. You buy a necklace for 20$, earrings for 12$, and then spend 3/7 of whats left on bracelets. How much money do you have left?
def solve() -> int: money = 70 necklace = 20 earrings = 12 money_left = money - necklace - earrings bracelets = money_left * 3 / 7 money_left = money_left - bracelets result = money_left return result
Emma gave half of her apples to Finn. Finn counted the apples and then gave 7 to Grace. Grace ate 3 apples and gave the rest to Harry. Harry kept 2 apples and gave the remainder to Isla. How many apples did Finn count?
def solve() -> int: emma_apples = 20 finn_apples = emma_apples / 2 grace_apples = finn_apples - 7 grace_apples_after_eating = grace_apples - 3 harry_apples = grace_apples_after_eating isla_apples = harry_apples result = finn_apples return result
A certain sum of money invested at an annual interest rate of 4.5% compounded quarterly will triple in 15 years. What is the sum of money initially invested?
def solve() -> int: interest_rate = 0.045 compounding_periods = 4 years = 15 final_amount = 3 periods = years * compounding_periods interest_rate_per_period = interest_rate / compounding_periods initial_amount = final_amount / ((1 + interest_rate_per_period) ** periods) result = initial_...
Tony had $30. He decided to buy some items from the mall. Out of the items he bought, two items each cost $4.50, and two items each cost $7.50. How much money did Tony have left?
def solve() -> int: price1 = 4.50 price2 = 7.50 item1 = price1 * 2 item2 = price2 * 2 total = item1 + item2 moneyleft = 30 - total result = moneyleft return result
A grocery store sells milk for $3.50 per gallon. If you buy 2 gallons of milk, how much does it cost?
def solve() -> int: price_per_gallon = 3.50 gallons_bought = 2 price_total = price_per_gallon * gallons_bought result = price_total return result
Five times the difference of twice a number and 7 is 23. What is the number?
def solve() -> int: num = (23/5 + 7)/2 result = num return result
Student: Alex sold 60 cupcakes at a bake sale. He made 50 cents profit on each chocolate cupcake and 75 cents profit on each vanilla cupcake. If he sold twice as many chocolate cupcakes as vanilla cupcakes, how much profit did he make in total?
def solve() -> int: chocolate_cupcakes = 40 vanilla_cupcakes = 20 chocolate_profit = 0.5 vanilla_profit = 0.75 chocolate_total_profit = chocolate_cupcakes * chocolate_profit vanilla_total_profit = vanilla_cupcakes * vanilla_profit total_profit = chocolate_total_profit + vanilla_total_p...
Carissa pays $400 for rent every month. If she makes $1,500 in a month, what percentage of her income goes towards monthly rent?
def solve() -> int: rent = 400 income = 1500 percentage = (rent/income)*100 result = percentage return result
Student: Daniella has four boxes of beads. There are 10 beads in each box. She adds two more beads to each box. How many beads are there total in the 4 boxes?
def solve() -> int: box1 = 10 box2 = 10 box3 = 10 box4 = 10 box1 += 2 box2 += 2 box3 += 2 box4 += 2 result = box1 + box2 + box3 + box4 return result
Carla throws a party and has 15 boxes of donuts, each box contains 12 donuts. How many donuts does Carla have in total?
def solve() -> int: boxes = 0 donuts = 0 while boxes < 15: donuts += 12 boxes += 1 if boxes == 15: result = donuts return result
4. Lisa filled up a swimming pool with 540 gallons of water and emptied out 135 gallons. How much water is left in the pool?
def solve() -> int: amount_in_pool = 540 amount_out = 135 amount_left = amount_in_pool - amount_out result = amount_left return result
Four friends shared 8 scoops of ice cream. If each scoop of ice cream is 75g, how many grams did Jerry eat if Tom ate one-fifth of a scoop, Sally ate half a scoop, Bob ate one-third of a scoop and Jerry ate 1 scoop?
def solve() -> int: grams_per_scoop = 75 scoops = 8 total_grams = grams_per_scoop * scoops tom_grams = total_grams / 5 / 1000 sally_grams = total_grams / 2 bob_grams = total_grams / 3 jerry_grams = total_grams / 1000 total_grams_eaten = tom_grams + sally_grams + bob_grams + jerry_grams ...
Student: Steve bought 24 markers for the price of 1. The regular price of 1 marker is $0.50. If he pays with credit card, he also has to pay a 3% transaction fee. How much does he have to pay in total?
def solve() -> int: markers_bought = 24 price_of_1_marker = 0.50 total_price = markers_bought * price_of_1_marker transaction_fee = total_price * 0.03 total_price_with_fee = total_price + transaction_fee result = total_price_with_fee return result
Alice and Bob shared a pizza. Alice ate 3 slices and Bob ate 2 slices. The pizza had 8 slices in total and cost $12. How much did Alice owe Bob if they split the cost evenly?
def solve() -> int: alice_eaten = 3 * (12 / 8) bob_eaten = 2 * (12 / 8) total_cost = 12 each_pay = total_cost / 2 alice_owe_bob = alice_eaten - each_pay result = alice_owe_bob return result
Four boxes of apples were delivered. Each box contained 6 apples. 3 of the boxes were sent to a store. How many apples are left?
def solve() -> int: total_apples = 6 * 4 sent_apples = 6 * 3 leftover_apples = total_apples - sent_apples result = leftover_apples return result
Tyler has 20 toy cars. He gave two to his cousin. How many toy cars does Tyler have left now?
def solve() -> int: toy_cars = 20 cars_given = 2 cars_left = toy_cars - cars_given result = cars_left return result
Jill bought a new computer for $900. She also had to pay a 15% sales tax. How much did Jill pay in total?
def solve() -> int: cost_computer = 900 sales_tax_rate = 0.15 total_cost = cost_computer * (1 + sales_tax_rate) result = total_cost return result
Daniel has 12% more marbles than John. John has 11 fewer marbles than Julie. Julie has 70% fewer marbles than Alex. If Alex has 250 marbles, how many marbles does Daniel have?
def solve() -> int: alex_marbles = 250 julie_marbles = alex_marbles * 0.3 john_marbles = julie_marbles + 11 daniel_marbles = john_marbles * 1.12 result = daniel_marbles return result
Dad wants to change his $1500 bill into smaller bills to give to his kids. He plans to change 2/5 of the money into $50 bills and the rest into $20 bills. How many pieces of bills will Dad have in all?
def solve() -> int: total_money = 1500 money_for_50s = total_money * 2/5 money_for_20s = total_money - money_for_50s num_50s = money_for_50s / 50 num_20s = money_for_20s / 20 total_bills = num_50s + num_20s result = total_bills return result
A school has 350 students. In the first week of the semester, 25 new students enrolled and 12 students transferred out. In the second week, 10% of the remaining students dropped out. How many students are left?
def solve() -> int: students = 350 students += 25 students -= 12 students *= 0.9 result = students return result
Emily brings a jar of gummies to her friend's house. Half are sour and the other half are sweet. The friends eat 75% of the sour gummies and 20% of the sweet ones. If there are only 12 gummies left, how many were originally in the jar?
def solve() -> int: sour_gummies = 12 / (1 - 0.75) sweet_gummies = 12 / (1 - 0.2) total_gummies = sour_gummies + sweet_gummies result = total_gummies return result
Result: 300.0 Ben had $1200. He gave 1/3 of his money to his parents, 10% of what he had left on books, and spent the rest on video games. How much money did Ben spend on video games?
def solve() -> int: ben_money = 1200 parents = ben_money * 1/3 ben_money_left = ben_money - parents books = ben_money_left * 10/100 ben_money_left = ben_money_left - books video_games = ben_money_left result = video_games return result
Mason is 6 years younger than Owen. In 8 years, Mason will be 25 years old. What is the sum of their present ages? Michelle has 4 less than 3 times the number of pencils that Taylor has. If there are 28 pencils in total, how many does Taylor have?
def solve() -> int: mason_age = 25 - 8 owen_age = mason_age + 6 sum_of_ages = mason_age + owen_age result = sum_of_ages return result
The time is currently 2:30 PM. What time will it be in 4.5 hours?
def solve() -> int: currentTime = 2.5 elapsedTime = 4.5 finalTime = currentTime + (elapsedTime / 12) result = finalTime return result
Nick starts with 20 bitcoin and he doubles the amount he has each day for a week. How many bitcoins does he have at the end of the week?
def solve() -> int: amount = 20 for i in range(7): amount = amount * 2 result = amount return result
Rachel is babysitting her neighbor's child. She charges $10 per hour of babysitting. If Rachel babysits for 4 hours every day for 2 weeks, how much money will she earn?
def solve() -> int: hourly_rate = 10 hours_per_day = 4 days_per_week = 7 weeks = 2 total_hours = hours_per_day * days_per_week * weeks total_earnings = total_hours * hourly_rate result = total_earnings return result
A restaurant serves 100 customers per day. With a new chef hired, they were able to serve 6 times more customers per day. How many customers were served in a week?
def solve() -> int: customers_per_day_before = 100 customers_per_day_after = customers_per_day_before * 6 customers_per_week = customers_per_day_after * 7 result = customers_per_week return result
Lila has a jar of jelly beans. She counts 12 red beans, 16 green beans, and 20 yellow beans. She takes out 4 red beans, 5 green beans, and 6 yellow beans and puts them in a bowl. She then randomly picks one bean from the bowl. What is the probability that she picks a green bean?
def solve() -> int: red_beans = 12 green_beans = 16 yellow_beans = 20 red_beans_bowl = 4 green_beans_bowl = 5 yellow_beans_bowl = 6 beans_bowl = red_beans_bowl + green_beans_bowl + yellow_beans_bowl green_probability = green_beans_bowl / beans_bowl result = green_probability retu...
A box contains 48 chocolates. If you want to distribute them to 8 friends equally, how many chocolates will each friend get?
def solve() -> int: total_chocolates = 48 friends = 8 result = total_chocolates / friends return result
Karen finished a book in 2 hours and 15 minutes, while her friend Alice finished it in 1 hour and 45 minutes. How many minutes faster did Alice finish the book than Karen?
def solve() -> int: karen_time = 2*60 + 15 alice_time = 1*60 + 45 difference = karen_time - alice_time result = abs(difference) return result
Lily and her four cousins, Jake, Emma, Noah, and Mia, each received some money from their grandparents for Christmas. Lily received $20. Jake received twice as much money as Lily. Emma received $5 less than Jake. Noah received half as much money as Emma. And Mia, who was the youngest, received $10. How much money did L...
def solve() -> int: lily = 20 jake = lily * 2 emma = jake - 5 noah = emma / 2 mia = 10 total = lily + jake + emma + noah + mia result = total return result
Claire buys a limited edition book for $200, which then increases in value by 150%. How much profit would she make by selling it?
def solve() -> int: book_price = 200 increase_percentage = 150 increase_amount = book_price * increase_percentage / 100 selling_price = book_price + increase_amount profit = selling_price - book_price result = profit return result
During a birthday party, 10 children shared and ate 42 doughnuts, which was in two flavors: chocolate and vanilla. If they ate 30 chocolate doughnuts, how many vanilla doughnuts were left?
def solve() -> int: chocolate_doughnuts = 30 total_doughnuts = 42 vanilla_doughnuts = total_doughnuts - chocolate_doughnuts result = vanilla_doughnuts return result
The height of a triangle is 8cm and its base is 12cm. What is the area of the triangle?
def solve() -> int: height = 8 base = 12 area = (1/2)*height*base result = area return result
A baseball player is up to bat every inning. Unfortunately, one-tenth of the time, they strike out and do not make it to base. However, one-fifth of the time, they make it all the way to home plate and score a run. If the player played in 60 innings, how many runs did they score?
def solve() -> int: innings = 60 strike_out_probability = 1/10 score_run_probability = 1/5 strike_outs = innings * strike_out_probability runs = innings * score_run_probability result = runs return result
Jackson can paint a room in 6 hours. If he starts painting at 10:00am and takes a 30-minute break, what time will he be done painting?
def solve() -> int: start_time = 10 break_time = 0.5 end_time = start_time + break_time + 6 result = end_time return result
If a rectangle has a length of 12cm and a width of 5cm, what is its perimeter?
def solve() -> int: length = 12 width = 5 perimeter = (2 * length) + (2 * width) result = perimeter return result
Jacob needs 80 blueberries for 4 muffins and needs 160 blueberries for 4 pancakes. If he has a total of 360 blueberries, how many of each can Jacob make?
def solve() -> int: muffins = 360 // 80 pancakes = (360 - (muffins * 80)) // 160 result = (muffins, pancakes) return result
If there are 40 students in the Period 1 gym class and the Period 3 gym class combined, how many students are in the Period 3 gym class alone?
def solve() -> int: num_P1 = 11 num_P3 = 40 - num_P1 result = num_P3 return result
A farmer harvested 478 onions from 3 acres of onion fields last year. This year, he planted 5 additional acres of onions and harvested 765 onions. If the farmer sells each onion for $3 in his market, how much money did he make from selling the onions this year?
def solve() -> int: acres_last_year = 3 onions_last_year = 478 additional_acres = 5 onions_this_year = 765 price_per_onion = 3 total_onions = acres_last_year + onions_last_year + additional_acres + onions_this_year total_sales = total_onions * price_per_onion result = total_sales ...
Student: A recipe calls for 2 and a half teaspoons of baking powder for every 3 cups of flour. If you only have 4 cups of flour, how much baking powder do you need?
def solve() -> int: flour = 4 teaspoons_per_3_cups = 2.5 baking_powder = flour * teaspoons_per_3_cups / 3 result = baking_powder return result
Student: A toy store buys a toy car for $2.50 and sells it for $5.00. The store has a fixed cost of $100 per week for rent and utilities. The store wants to make a profit of $500 in one month. After three weeks, it has made a profit of $300. How many toy cars did it sell in the third week?
def solve() -> int: cost_of_toy_car = 2.50 price_of_toy_car = 5.00 fixed_cost = 100 target_profit = 500 profit_after_3_weeks = 300 profit_from_one_toy_car = price_of_toy_car - cost_of_toy_car total_profit_after_3_weeks = profit_after_3_weeks + fixed_cost total_profit_needed = target_prof...
A room is 10 feet by 15 feet. If the perimeter is painted with a paint can that covers 50 square feet, how many paint cans will be needed for two coats?
def solve() -> int: length = 15 width = 10 perimeter = 2*(length + width) paint_coverage = 50 total_coverage = perimeter*2 paint_cans_needed = total_coverage/paint_coverage result = paint_cans_needed return result
If Mary wants to earn a profit of $600 by selling 80 shirts at $15 each, what was the cost price of each shirt?
def solve() -> int: num_shirts = 80 selling_price = 15 total_profit = 600 total_revenue = num_shirts * selling_price cost_price = (total_revenue - total_profit) / num_shirts result = cost_price return result
A gardener has 100 plants, but only 30% of them are roses. How many plants are NOT roses?
def solve() -> int: total_plants = 100 rose_percentage = 0.3 non_rose_plants = total_plants * (1 - rose_percentage) result = non_rose_plants return result
Student: 7. At the park, Noe and Keisha drive 4 hours. They stop for snacks for 1.5 hours before continuing the drive for 2 more hours. How long have they spent at the park in total?
def solve() -> int: drive_time = 4 snack_time = 1.5 continue_drive_time = 2 total_time = drive_time + snack_time + continue_drive_time result = total_time return result
Growing up, John has always dreamed of buying his own house. To help fund his dream, he bought a wooden box in July and started saving. By last week, he had saved $20,000. Inspired by his progress, he has decided to continue saving $500 per month, for 8 years. Today, John’s girlfriend secretly added $50,000 into the wo...
def solve() -> int: savings = 20000 monthly_savings = 500 years = 8 total_months = years * 12 for i in range(total_months): savings += monthly_savings savings += 50000 result = savings return result
A class of 25 students took a test and the average score was 80%. How many students scored above 90% if the total score of the class was 2000 points?
def solve() -> int: num_students = 25 average_score = 0.8 total_score = 2000 percent_above = 0.9 points_above = 100 * percent_above sum_above = num_students * average_score * 100 - total_score num_above = sum_above / points_above result = num_above return re...
There are 140 students in a school. If 60% of the students are girls, how many boys are in the school?
def solve() -> int: total_students = 140 girls_percent = 60 boys_percent = 100 - girls_percent boys = total_students * boys_percent / 100 result = boys return result
A store sells two types of cereals. Cereal A costs $3 and has 150 calories per serving. Cereal B costs $4 and has 200 calories per serving. Which cereal has a better value in terms of calories per dollar?
def solve() -> int: cal_per_dol_a = 150/3 cal_per_dol_b = 200/4 if cal_per_dol_a > cal_per_dol_b: result = "Cereal A is a better value in terms of calories per dollar." else: result = "Cereal B is a better value in terms of calories per dollar." return result
To paint a room, Tom needs 3 gallons of paint and a paint roller. If a gallon of paint costs $25 and a paint roller costs $10, how much will it cost him in total?
def solve() -> int: paint_gallons = 3 paint_cost = 25 paint_roller_cost = 10 total_cost = (paint_gallons * paint_cost) + paint_roller_cost result = total_cost return result
Lily is making bracelets with beads. She has 120 beads and each bracelet requires 15 beads. She wants to make as many bracelets as possible and sell them for $5 each. How much money can she make from selling the bracelets?
def solve() -> int: bracelets = 120 // 15 money = bracelets * 5 result = money return result
A phone plan costs $25 per month plus $0.15 per minute. If Mark used the phone plan for 120 minutes this month, how much does he have to pay?
def solve() -> int: monthly_cost = 25 per_minute_cost = 0.15 minutes_used = 120 total_cost = monthly_cost + (per_minute_cost * minutes_used) result = total_cost return result
A plane flies 900 miles in 2 hours. At the same rate, how many minutes would it take to fly 300 miles?
def solve() -> int: rate = 900 / 2 time = 300 / rate time = time * 60 result = time return result
John has $2400 in a savings account that earns 3% simple interest per year. How much money will he earn in interest after one and a half years?
def solve() -> int: balance = 2400 interest_rate = 0.03 time = 1.5 interest = balance * interest_rate * time result = interest return result
A gym charges $30 per month for a membership. If a customer signs up for a year, they get 2 free months. How much will the customer pay in total for the year?
def solve() -> int: price_per_month = 30 num_months = 12 free_months = 2 total_months = num_months + free_months total_cost = price_per_month * total_months result = total_cost return result
Peter sells apples at the farmer's market. On the first day, he sold 30 apples. If he sells 2 apples more per day, how many apples does he sell in 10 days?
def solve() -> int: apples = 30 for i in range(10): apples+=2 result = apples return result
Student: If $2x + 1 = 13$, then what is $5x - 3$?
def solve() -> int: x = None x = (13 - 1) / 2 result = 5 * x - 3 return result
Eva is baking cookies for a school fundraiser. She has 5 cups of flour, 4 cups of sugar, 3 cups of butter, and 2 cups of chocolate chips. She can make 24 cookies with one cup of each ingredient. How many cookies can she make with what she has?
def solve() -> int: cookies_per_flour = 24 cookies_per_sugar = 24 cookies_per_butter = 24 cookies_per_chips = 24 cookies_per_least = min(cookies_per_flour, cookies_per_sugar, cookies_per_butter, cookies_per_chips) cups_least = min(5, 4, 3, 2) cookies = cookies_per_least * cups_least ...
Student: The price of a computer is $1200. If the tax rate is 8%, what is the total cost of the computer?
def solve() -> int: price = 1200 tax_rate = 0.08 tax_amount = price * tax_rate total_cost = price + tax_amount result = total_cost return result
Tracy's furniture store delivers 250 pieces of furniture each month. 10% of them are returned, and each item is worth $500. What is the net sales figure for Tracy's store?
def solve() -> int: pieces_delivered = 250 return_percentage = 0.1 item_value = 500 pieces_returned = pieces_delivered * return_percentage pieces_sold = pieces_delivered - pieces_returned net_sales = pieces_sold * item_value result = net_sales return result
A field is to be used for a soccer game. If each player requires a space that is 2.5 feet wide and they must have at least 3 feet of space between them or the borders of the field, how many players can participate in the game if the field is 100 feet wide?
def solve() -> int: field_width = 100 player_width = 2.5 min_space = 3 total_space = player_width + min_space players_per_row = int((field_width - 2*min_space) / total_space) rows_needed = int(players_per_row / 2) + 1 total_players = players_per_row * rows_needed ...
Olivia is trying to lose weight and wants to increase her level of physical activity. Currently she burns 300 calories per day and wants to burn 20% more in 1 month. How many more calories does she need to burn each day to reach her goal?
def solve() -> int: current_calories = 300 percent_increase = 0.2 days_in_month = 30 increase_calories = current_calories * percent_increase total_calories = current_calories + increase_calories calories_per_day = total_calories / days_in_month additional_calories = calories_per_da...
Ahmed owns a restaurant and uses 3 pounds of flour to make a large pizza and 1.5 pounds of flour to make a small pizza. He sells 10 large and 20 small pizzas every day. How much flour does Ahmed use in a week?
def solve() -> int: large_pizza_flour = 3 small_pizza_flour = 1.5 large_pizzas_per_day = 10 small_pizzas_per_day = 20 flour_per_day = (large_pizza_flour * large_pizzas_per_day) + (small_pizza_flour * small_pizzas_per_day) flour_per_week = flour_per_day * 7 result = flour_per_week ...
Olivia got $2000 from her parents for her birthday. She spent $500 on a bike and donated 1/3 of the remaining money to charity. How much money is left with Olivia?
def solve() -> int: money_received = 2000 bike_cost = 500 remaining_money = money_received - bike_cost donation = remaining_money / 3 money_left = remaining_money - donation result = money_left return result
A company produces 5000 products each month. If their expenses are $10,000 per month and they sell their products for $4 each, how many units do they have to sell to break even?
def solve() -> int: monthly_production = 5000 monthly_expenses = 10000 selling_price = 4 break_even_point = monthly_expenses / (selling_price * monthly_production) result = break_even_point return result
Moe bought 3 bottles of soda at $1.50 each and 5 cans of beer at $2.50 each. How much money did he spend in total?
def solve() -> int: soda = 3 * 1.50 beer = 5 * 2.50 result = soda + beer return result
An office has a total of 50 employees. If 20% of the employees are managers and 75% of the remaining employees are female, how many male employees are there?
def solve() -> int: total_emp = 50 manager_emp = 0.20*total_emp remaining_emp = total_emp-manager_emp female_emp = 0.75*remaining_emp male_emp = remaining_emp-female_emp result = male_emp return result
Student: If Tim has 8 more pencils than twice the number of pencils that Dick has, and Dick has 22 pencils, how many pencils do they have together?
def solve() -> int: dick_pencils = 22 tim_pencils = 2 * dick_pencils + 8 total_pencils = dick_pencils + tim_pencils result = total_pencils return result
A pack of chocolate candies contains 90 almond-flavored candies, 75 hazelnut-flavored candies, and 60 walnut-flavored candies. Emma eats one-fourth of the almond-flavored candies, one-third of the hazelnut-flavored candies, and half of the walnut-flavored candies. How many candies are left in the pack?
def solve() -> int: almond_candies = 90 hazelnut_candies = 75 walnut_candies = 60 eaten_almond = almond_candies // 4 eaten_hazelnut = hazelnut_candies // 3 eaten_walnut = walnut_candies // 2 remaining_almond = almond_candies - eaten_almond remaining_hazelnut = hazelnut_candies ...
A company made a profit of $45,000 this year. The profit was a 20% increase from the previous year. What was the company's profit in the previous year?
def solve() -> int: current_profit = 45000 increment_percentage = 20 previous_profit = current_profit/(1+(increment_percentage/100)) result = previous_profit return result
A gym has 50 exercise machines, but only 80% of them are being used. If each person pays $30 for a workout, how much more money would be made if all of the machines were being used?
def solve() -> int: machines_total = 50 utilization_rate = 0.8 price_per_workout = 30 machines_used = machines_total * utilization_rate money_made_current = machines_used * price_per_workout machines_unused = machines_total - machines_used money_made_potential = machines_total * pr...
If 90 apples plus 40 oranges equals 130 fruits, how many oranges do I need to add to bring the total number of fruits to 150?
def solve() -> int: totalFruits = 130 givenApples = 90 neededFruits = 150 - totalFruits result = neededFruits + givenApples return result
A farmer has a field that is 15 miles long and 7 miles wide. How many acres is the field, if 1 square mile is equivalent to 640 acres?
def solve() -> int: field_length = 15 field_width = 7 area_miles = field_length * field_width area_acres = area_miles * 640 result = area_acres return result
Peter needs to buy enough tickets for 4 people attending the theatre show. If each ticket costs $15, how much money does he need in total?
def solve() -> int: number_people = 4 cost_per_ticket = 15 total_cost = number_people * cost_per_ticket result = total_cost return result
Max has a pen with 15 chicks that will grow up and lay eggs after 2 months. His cousin James has a larger pen with 300 chicks that will lay eggs in 3 months. If they sell all the eggs after 6 months, how many eggs can they sell altogether?
def solve() -> int: max_chicks = 15 james_chicks = 300 max_eggs = max_chicks * 2 james_eggs = james_chicks * 3 total_eggs = max_eggs + james_eggs result = total_eggs return result
Student: How many days in a total are there in 7 weeks?
def solve() -> int: week = 7 days = week * 7 result = days return result
At the archery range, Alice shot an arrow 32 meters. Bob shot an arrow 20 percent shorter than Alice and Charlie shot an arrow 1.5 times longer than Bob. Compared to Alice, how much longer did Charlie shoot an arrow?
def solve() -> int: bob_length = 32 * (1 - 0.2) charlie_length = bob_length * 1.5 difference = charlie_length - 32 result = difference return result
John is picking between two cars. The first car is going to go on a 50-mile trip on a flat road in 45 minutes, while the second car is going to go on the same trip in 40 minutes. If he has a gas budget of $10, how much cheaper per mile is the first car compared to the second car?
def solve() -> int: distance = 50 time1 = 45/60 time2 = 40/60 budget = 10 speed1 = distance/time1 speed2 = distance/time2 cost_per_mile1 = budget/(distance/speed1) cost_per_mile2 = budget/(distance/speed2) difference = cost_per_mile2 - cost_per_mile1 result ...
A ladder is 12 meters long. The ladder touches the wall at 7 meters above the ground. How far away is the base of the ladder from the wall?
def solve() -> int: ladder_length = 12 height_on_wall = 7 distance_from_wall = ((ladder_length**2)-(height_on_wall**2))**(1/2) result = distance_from_wall return result
Student: A store sold 112 books in one day. The sales of non-fiction books were 50% of the total sales. If the store sold 30 more fiction books than non-fiction books, how many fiction books were sold?
def solve() -> int: total_books = 112 non_fiction_books = 0 fiction_books = 0 non_fiction_books = total_books * 0.5 fiction_books = non_fiction_books + 30 result = fiction_books return result
Student: A company has a total budget of $50,000 to distribute as bonuses to its employees. If there are 25 employees, and each employee must receive an equal bonus, how much will each employee receive?
def solve() -> int: num_employees = 25 total_budget = 50000 bonus_per_employee = total_budget / num_employees result = bonus_per_employee return result
A train travels 400 kilometers in 5 hours. What is its average speed?
def solve() -> int: distance_km = 400 time_hours = 5 speed_kmph = distance_km / time_hours result = speed_kmph return result
A pizza restaurant makes 60 pizzas a day. If one-third of the pizzas are vegetarian, and half of the vegetarian pizzas are gluten-free, how many gluten-free vegetarian pizzas are made daily?
def solve() -> int: total_pizzas = 60 vegetarian_pizzas = total_pizzas / 3 gluten_free_vegetarian_pizzas = vegetarian_pizzas / 2 result = gluten_free_vegetarian_pizzas return result
If there are 400 students in a school and 25% of them are absent, how many students are present in school?
def solve() -> int: total_students = 400 absent_percent = 25 present_percent = 100 - absent_percent present_students = (total_students * present_percent) / 100 result = present_students return result
Mark is 5 years older than Sarah. If Sarah is 8 years old now, how old will Mark be in 3 years?
def solve() -> int: sarahAge = 8 ageDifference = 3 markAge = sarahAge + (5 * ageDifference) result = markAge return result
The thunderstorm picked up the Williams' trampoline and sent it flying 250 feet away. A pair of shoes had been blown twice as far as the trampoline had been carried. Also, a basketball had flown three times farther than the shoes were blown. How far had the basketball flown?
def solve() -> int: trampoline_distance = 250 shoes_distance = trampoline_distance * 2 basketball_distance = shoes_distance * 3 result = basketball_distance return result