question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A recipe for soup calls for 8 cups of water and 4 cups of broth for every 3 cups of lentils. If we want to use 15 cups of lentils, how much water and how much broth will we need?
def solve() -> int: water_ratio_4 = 8/3 broth_ratio_4 = 4/3 lentils_needed_4 = 15 water_needed_4 = (water_ratio_4*lentils_needed_4) broth_needed_4 = (broth_ratio_4*lentils_needed_4) result = (water_needed_4, broth_needed_4) return result
Kay wanted to buy a new gaming console for $300 and a game for $45. The gaming store offered a 15% discount on both items, and Kay had an additional coupon for $5 off. At checkout he found out that he also had to pay an extra 10% sales tax. How much did Kay pay in total?
def solve() -> int: price_console = 300.00 price_game = 45.00 discount = 0.15 coupon = 5.00 tax_rate = 0.10 total_price = price_console + price_game total_price = total_price * (1-discount) total_price = total_price - coupon total_price = total_price * (1+tax_rate) resu...
A fruit stand sold 200 pounds of fruit on Monday. On Tuesday they sold 120% as much as they had sold on Monday. On Wednesday they only sold 80 pounds of fruit. On Thursday they sold 90% of what they had sold on Tuesday. If they had only planned to sell 400 pounds of fruit for the week, how much more did they sell beyon...
def solve() -> int: fruit_sold = 200+ (200*1.2)+80+ (200*1.2*0.9) fruit_extra = fruit_sold - 400 result = fruit_extra return result
The art class at Oakland High has 30 students. Each student needs a sketchbook, a set of pencils, and a set of watercolors. The sketchbooks cost $10 each, the pencils cost $8 per set, and the watercolors cost $12 per set. The teacher also needs to buy 5 easels, each costing $40. How much (in dollars) does the teacher n...
def solve() -> int: sketchbook_cost = 30 * 10 pencil_cost = 30 * 8 watercolor_cost = 30 * 12 easel_cost = 5 * 40 total_supply_cost = sketchbook_cost + pencil_cost + watercolor_cost + easel_cost result = total_supply_cost return result
Possible new questions: A bakery sold 120 cupcakes for an average cost of $2.50, 60 pies for an average cost of $6 and 40 loaves of bread for an average cost of $4. What was the total revenue and the average cost across all products sold today?
def solve() -> int: total_cupcakes = 120 * 2.5 total_pies = 60 * 6 total_bread = 40 * 4 total_revenue = total_cupcakes + total_pies + total_bread total_products = 120 + 60 + 40 average_cost = total_revenue / total_products result = 510, 3.4 return result
Lily collected 30 eggs. Benji collected 12 more eggs than Lily and three times as many as Charlotte. They used their eggs to make cakes. One cake used 10 eggs and they sold each cake for $12. How much money did they make from their cakes?
def solve() -> int: lily_eggs = 30 benji_eggs = lily_eggs + 12 charlotte_eggs = benji_eggs / 3 total_eggs = lily_eggs + benji_eggs + charlotte_eggs cakes = total_eggs // 10 money = cakes * 12 result = money return result
The price of tomatoes increased from $2 per kilogram to $3 per kilogram. If the total amount spent for 10 kilograms of tomatoes increased by $8, what was the initial total amount spent for the same amount of tomatoes?
def solve() -> int: tomatoes = 10 initial_price = 2 new_price = 3 increase = 8 initial_total = tomatoes * initial_price final_total = initial_total + increase initial_quantity = final_total/new_price result = int(initial_total) return result
Jake is baking cookies for his friends. He has a recipe that makes 24 cookies and requires 2 cups of flour, 1 cup of sugar, and 0.5 cups of butter. He wants to make 48 cookies and has 5 cups of flour, 3 cups of sugar, and 2 cups of butter in his pantry. How much more of each ingredient does he need to buy?
def solve() -> int: recipe_cookies = 24 recipe_flour = 2 recipe_sugar = 1 recipe_butter = 0.5 target_cookies = 48 pantry_flour = 5 pantry_sugar = 3 pantry_butter = 2 total_flour = recipe_flour * (target_cookies / recipe_cookies) total_sugar = recipe_sugar * (target_cooki...
Eva and Leah are collecting stickers. Eva has 36 stickers and Leah has 24 stickers. They want to trade some stickers so that they both have the same number of stickers. How many stickers should Eva give to Leah to make this happen?
def solve() -> int: eva_stickers = 36 leah_stickers = 24 diff = eva_stickers - leah_stickers eva_give = diff // 2 result = eva_give return result
Student: The market sells 100 apples for $50. If Emily buys 80 apples and sells each for 70 cents, how much profit will she make?
def solve() -> int: cost = 50 num_apples = 100 cost_per_apple = cost / num_apples num_apples_bought = 80 total_cost = num_apples_bought * cost_per_apple price_per_apple = 0.7 total_amount = num_apples_bought * price_per_apple profit = total_amount - total_cost result = profit re...
Alex has a faucet that leaks 0.1 gallons of water per hour and he does not fix it for 6 months. He finally fixes it with a new washer that stops the leak completely. How much water did Alex waste before fixing the faucet?
def solve() -> int: leak_rate = 0.1 leak_time = 6 * 30 * 24 wasted_amount = leak_rate * leak_time result = wasted_amount return result
If Kevin has 7 times as much money as Travis and Travis has 3 times as much money as Ethan, and Ethan has $100, how much money does Kevin have?
def solve() -> int: ethan_money = 100 travis_money = ethan_money * 3 kevin_money = travis_money * 7 result = kevin_money return result
Jackson is playing a video game with 10 levels, but he wants to win them quickly. He spends 4 hours playing the game. Each level takes him 12 minutes to complete, then it takes him 20 minutes to save and exit the game. How many minutes did it take Jackson to complete each level, if each level took the same amount of ti...
def solve() -> int: hours_spent = 4 minutes_per_level = (hours_spent * 60 - 10 * 20) / 10 result = minutes_per_level return result
A hotel has a total of 60 rooms. If they are fully booked, and 30% of the rooms are single rooms while the rest are double rooms, how many double rooms are there?
def solve() -> int: total_rooms = 60 single_rooms_percentage = 0.30 double_rooms_percentage = 1 - single_rooms_percentage double_rooms = total_rooms * double_rooms_percentage result = double_rooms return result
Kia has a large cleaning job and it takes her 5 hours to clean 200 square meters. How many hours will it take her to clean 1000 square meters?
def solve() -> int: time_to_clean_200sqm = 5 total_sqm = 1000 sqm_per_hour = 200 / time_to_clean_200sqm total_time = total_sqm / sqm_per_hour result = total_time return result
Ana can paint a wall in 4 hours and Bana can paint the same wall in 6 hours. If they work together, how long will it take them to paint the wall?
def solve() -> int: ana_rate = 1/4 bana_rate = 1/6 both_rate = ana_rate + bana_rate both_time = 1 / both_rate result = both_time return result
Alicia baked 9 chocolate cupcakes and 6 vanilla cupcakes. She wants to have a total of 20 cupcakes. How many more cupcakes does she need to bake?
def solve() -> int: cupcakes_needed = 20 - (9 + 6) result = cupcakes_needed return result
Anna is saving money for a college trip. She has $250 and wants to save $600 more. How much money does Anna need to save in total? Ava has 8 hair clips. Bella has 3 more hair clips than Ava, and Clara has 2 fewer hair clips than Ava. How many hair clips do Bella and Clara have together?
def solve() -> int: ava_hair_clips = 8 bella_hair_clips = ava_hair_clips + 3 clara_hair_clips = ava_hair_clips - 2 total_hair_clips = bella_hair_clips + clara_hair_clips result = total_hair_clips return result
Student: A rectangle has a length of 10 meters and a width of 5 meters. If the length is increased by 50% and the width is decreased by 30%, what is the new perimeter of the rectangle?
def solve() -> int: length = 10 width = 5 new_length = length * 1.5 new_width = width * 0.7 new_perimeter = 2 * (new_length + new_width) result = new_perimeter return result
The Panthers played 50 home games this year. They had 15 wins and half as many ties as losses. How many losses did they have?
def solve() -> int: home_games = 50 wins = 15 ties = wins / 2 losses = home_games - wins - ties result = losses return result
10 rabbits are digging holes in a field. Each rabbit can dig 2 holes per hour. If the field has 120 holes already, how many more hours will it take for the rabbits to dig 300 holes in total?
def solve() -> int: holes_per_hour = 10 * 2 holes_needed = 300 - 120 hours_needed = holes_needed / holes_per_hour hours_needed = round(hours_needed) result = hours_needed return result
John makes a bowl of fruit salad with 7 even portions. If there are 21 people at the party, how many portions of fruit can each person have?
def solve() -> int: portions = 7 people = 21 total_fruit = portions * 2 portions_per_person = total_fruit / people result = portions_per_person return result
A farmer has 12 chickens and 18 ducks. He sells 20% of his chickens and 30% of his ducks to a market. How many more ducks than chickens does he have left?
def solve() -> int: chickens_sold = 0.2 * 12 ducks_sold = 0.3 * 18 chickens_left = 12 - chickens_sold ducks_left = 18 - ducks_sold difference = ducks_left - chickens_left result = difference return result
The area of a rectangle is 48 square meters and the length is 8 meters. Find the width of the rectangle.
def solve() -> int: area = 48 length = 8 width = area / length result = width return result
Leo buys a pizza that has 8 slices. He eats 2 slices for lunch and 3 slices for dinner. He shares the remaining slices with his 2 friends equally. How many slices does each friend get?
def solve() -> int: pizza_slices = 8 lunch_slices = 2 dinner_slices = 3 friends = 2 left_slices = pizza_slices - lunch_slices - dinner_slices slices_per_friend = left_slices / friends result = slices_per_friend return result
If a car travels 137 kilometers in 2.5 hours, what is its speed in km/h?
def solve() -> int: distance = 137 hours = 2.5 kmPerHour = distance / hours result = kmPerHour return result
Student: Emily has $60. She wants to buy a new dress for $35. How much money will she have left after buying the dress?
def solve() -> int: money_before = 60 dress_price = 35 money_left = money_before - dress_price result = money_left return result
A bag has 100 marbles and Jane takes out 5 each day. After how many days will there be less than 50 marbles left in the bag?
def solve() -> int: marbles = 100 days = 0 while marbles > 50: marbles = marbles - 5 days = days + 1 result = days return result
Student: What is the perimeter of a rectangle whose length is 6 inches and whose width is 4 inches?
def solve() -> int: length = 6 width = 4 perimeter = 2 * (length + width) result = perimeter return result
A guitar costs $350. If Jayden wants to save up for it, how much will he have to save each week for 5 weeks to buy it?
def solve() -> int: guitar_cost = 350 num_weeks = 5 amount_saved_per_week = guitar_cost / num_weeks result = amount_saved_per_week return result
Linda bought a house for 80% of its actual price. She received an additional 10% discount when she paid with her debit card. If the actual price of the house is $400,000, how much money did Linda spend?
def solve() -> int: original_price = 400000 discount_percent = 0.8 debit_discount = 0.1 discount_from_percent = original_price * discount_percent discount_from_debit = discount_from_percent * debit_discount result = original_price - discount_from_percent - discount_from_debit ...
If a car travels 60 miles in 2 hours, what is its average speed in miles per hour?
def solve() -> int: distance = 60 time = 2 speed = distance / time result = speed return result
Student: Four friends, Alex, Bill, Carl, and David, have $100, $200, $300, and $400 respectively. If they want to divide their money equally among themselves, how much does Carl need to give to the others?
def solve() -> int: alex = 100 bill = 200 carl = 300 david = 400 total = alex + bill + carl + david each_share = total / 4 carl_share = each_share - carl result = carl_share return result
Emma has a jar with 20 marbles. 10 of them are red, 6 are blue, and 4 are green. She randomly picks one marble and does not put it back. What is the probability that she picks a blue marble?
def solve() -> int: probability = 6 / 20 result = probability return result
A beekeeper starts with 30 hives containing 12,000 bees each. During the week, the beekeeper adds 5 hives and loses 10% of the bees from the existing hives. How many bees are in the hives at the end of the week?
def solve() -> int: hives_start = 30 bees_per_hive = 12000 hives_added = 5 bee_lost_percentage = 0.1 hives_current = hives_start + hives_added bees_lost = int(bees_per_hive * hives_start * bee_lost_percentage) bees_current = int((hives_current * bees_per_hive) - bees_lost) ...
Student: If Joe has £120 and he wants to buy 6 items, each costs £15, how much money will he have left?
def solve() -> int: money_joe_has = 120 cost_of_each_item = 15 number_of_items = 6 total_cost = cost_of_each_item * number_of_items money_left = money_joe_has - total_cost result = money_left return result
In fifteen years, Maya will be four times as old as Ben right now. If Ben is currently 9 years old, how old is Maya now?
def solve() -> int: ben_age = 9 maya_age = 0 time_gap = 15 maya_age = 4 * ben_age - time_gap result = maya_age return result
A train travels 50 miles in 1 hour and 45 minutes. How many miles will it travel in 4 hours?
def solve() -> int: distance_per_time = 50 / (1 + 45/60) time_to_travel = 4 * 60 distance_traveled = distance_per_time * time_to_travel result = distance_traveled return result
A rectangular room is 12 meters long and 9 meters wide. If the perimeter of the room is 42 meters, what is the height of the room?
def solve() -> int: length = 12 width = 9 perimeter = 42 height = (perimeter - (2 * (length + width))) / 2 result = height return result
Student: Rachel earns $60 per day. She spent $580 in the first 10 days and saved the remaining money thereafter. If she saved a total of $720 in 20 days, how much money did she save every day after the 10th day?
def solve() -> int: daily_earnings = 60 total_spending = 580 total_saving = 720 total_earnings = daily_earnings * 20 remaining_money = total_earnings - total_spending daily_saving = (total_saving - remaining_money) / 10 result = daily_saving return result
A restaurant had 43 customers on Monday, and 58 customers on Tuesday. On Wednesday, there were 27 fewer customers than Monday, but 14 more customers than Tuesday. How many customers came to the restaurant on Wednesday in total?
def solve() -> int: Monday = 43 Tuesday = 58 Wednesday = Monday - 27 + 14 result = Monday + Tuesday + Wednesday return result
Student: A coach has a team of 18 players. If 5/6 attend practice, and 3/4 of those present ran the drills, how many players ran the drills?
def solve() -> int: team_size = 18 attendance_rate = 5/6 attendance = team_size * attendance_rate drill_rate = 3/4 drill_participants = attendance * drill_rate result = drill_participants return result
Kenny has 20% of the total number of marbles. Rachel has twice as many marbles as Kenny. If Rachel has 40 marbles, how many marbles are there in total?
def solve() -> int: rachel_marbles = 40 rachel_portion = 2 kenny_portion = 0.2 kenny_marbles = rachel_marbles / rachel_portion * kenny_portion total_marbles = rachel_marbles / rachel_portion / kenny_portion result = total_marbles return result
Student: Mark has 72 rubber bands and lost 40%. How many rubber bands does he have left?
def solve() -> int: rubber_bands = 72 percent_lost = 40 rubber_bands_lost = rubber_bands * (percent_lost/100) rubber_bands_left = rubber_bands - rubber_bands_lost result = rubber_bands_left return result
Student: There are 6 people who carry water buckets. The first person can carry 15 gallons, the second can carry 10 gallons, the third can carry 5 gallons, the fourth can carry 30 gallons, the fifth can carry 20 gallons and the sixth can carry 25 gallons. If all of them carry water together, how many gallons can they c...
def solve() -> int: person1 = 15 person2 = 10 person3 = 5 person4 = 30 person5 = 20 person6 = 25 total_gallons = person1 + person2 + person3 + person4 + person5 + person6 result = total_gallons return result
The gym is hosting a fitness challenge. For every 3 miles run, the participant will burn 150 calories. The challenge is to burn 450 calories. How many miles will the participant have to run to complete the challenge?
def solve() -> int: calories_burned_per_mile = 150 calories_to_burn = 450 miles_to_run = calories_to_burn / calories_burned_per_mile result = miles_to_run return result
Peter has 50 seashells. He dropped 12 seashells and then collected 2/3 of his remaining seashells. How many seashells does he have now? Sarah fills up her gas tank for a road trip, which is 400 miles away. She can get 25 miles to the gallon in her car, which has a 20-gallon gas tank. How many more miles will she be abl...
def solve() -> int: seashells = 50 seashells -= 12 seashells *= 2/3 miles = 400 mpg = 25 tank = 20 gas = tank * mpg miles -= gas result = seashells + miles return result
Student: Tony bought 24 boxes of cereal. If each box contains 15 pieces, how many pieces of cereal did Tony buy in total?
def solve() -> int: boxes = 24 pieces_per_box = 15 total_pieces = boxes * pieces_per_box result = total_pieces return result
A store has 576 bars of soap. If 48 bars of soap are sold every day, how many days will it take to sell all the bars of soap?
def solve() -> int: soap_bars = 576 soap_sold_daily = 48 days_to_sell = soap_bars / soap_sold_daily result = days_to_sell return result
A zoo has 6 adult pandas. Each adult panda eats 138 pounds of bamboo a day. How many pounds of bamboo will the pandas eat in a week?
def solve() -> int: total_bamboo_eaten = 6 * 138 * 7 result = total_bamboo_eaten return result
A rectangle has a width of 6 units and a length of 8 units. What is the area and perimeter of the rectangle?
def solve() -> int: width = 6 length = 8 area = width * length perimeter = 2 * (width + length) result = (area, perimeter) return result
Jason is going on a road trip and needs to fill up his car with gas. His car can hold 12 gallons of gas and he has already used 3 gallons. If gas costs 3 dollars per gallon, how much will it cost to fill up his car?
def solve() -> int: car_capacity = 12 gas_used = 3 gas_needed = car_capacity - gas_used price_per_gallon = 3 total_cost = gas_needed * price_per_gallon result = total_cost return result
Student: There are 500 packages that need to be distributed equally among 5 customers. Each customer returns 20 packages. How many packages are accepted by each customer?
def solve() -> int: total_packages = 500 customers = 5 returned_packages = 20 distributed_packages = total_packages // customers accepted_packages = distributed_packages - returned_packages result = accepted_packages return result
A car uses 12 liters of gas to travel 180 kilometers. How much gas would it use to travel 360 kilometers?
def solve() -> int: car_gas_consumption = 12 / 180 gas = car_gas_consumption * 360 result = gas return result
Letty is running a non-profit that auctions off art pieces every Friday night. Each art piece sold is worth $45. If her goal is to make a total of $360, how many art pieces does she need to sell?
def solve() -> int: goal = 360 art_price = 45 result = goal // art_price return result
Olivia's house has 10 rooms. Mason's house has 5 times as many rooms as Olivia's house. Max's house has 1/2 as many rooms as Mason's house. How many rooms does Max's house have?
def solve() -> int: olivia_rooms = 10 mason_rooms = olivia_rooms * 5 max_rooms = mason_rooms / 2 result = max_rooms return result
Ava has a recipe that requires 1 pound of flour. She only has a 1/2 pound measuring cup. How many times does she need to fill up the measuring cup to reach 1 pound of flour?
def solve() -> int: flour_needed = 1 measuring_cup = 1/2 fills_needed = flour_needed / measuring_cup result = fills_needed return result
Peter works four days a week as a valet and earns a variable amount of tips every day. The past two days, he earned $20 and $30. What is the minimum amount he needs to earn on the next two days combined if he wants to make an average of $35 in tips per day?
def solve() -> int: tips = [20, 30] num_days = 4 avg_tips = 35 total_tips = num_days * avg_tips earned_tips = sum(tips) required_tips = total_tips - earned_tips result = required_tips - tips[-1] return result
garden_length = 6 item_length =. 25 number_of_items = (garden_length**3) / item_length result = number_of_items <-endofprogram|> At the local market, there are 10 cups of fruit per box and 8 boxes in a case. How many cups of fruit are in a case?
def solve() -> int: number_of_cups = 10 number_of_boxes = 8 total_number_of_cups = number_of_cups * number_of_boxes result = total_number_of_cups return result
Two siblings split the cost of a new video game. One sibling paid for the game console and the other paid for the game. If the game console was $300 and the game was $60, and the first sibling paid $180 in total, how much did the second sibling pay?
def solve() -> int: total_cost = 300 + 60 second_pay = total_cost / 2 result = second_pay - (180 - second_pay) return result
Alex has 2 more bicycles than 4 times the number of skateboards he has. If he has 10 bicycles, how many skateboards does he have?
def solve() -> int: bicycles = 10 skateboards = (bicycles - 2) / 4 result = skateboards return result
The florist arranged 5 bouquets of roses containing a total of 120 roses. This week, they arranged 10 bouquets. How many dozens of roses did the florist arrange in total?
def solve() -> int: bouquets1 = 5 roses1 = 120 bouquets2 = 10 roses2 = bouquets2 * (roses1 / bouquets1) dozens = (roses1 + roses2) / 12 result = dozens return result
Jeff went to buy a phone worth $850, but he got a student discount of 10% and also a brand discount of 5%. The store has a tax of 7% on each purchase. What is the total price Jeff paid?
def solve() -> int: price = 850 discount_student = price * 0.10 discount_brand = price * 0.05 price_after_discounts = price - discount_brand - discount_student tax = price_after_discounts * 0.07 total_price = price_after_discounts + tax result = total_price return result
A woman bought 4/6 of a lot for the amount of $528. If the entire lot was worth $800, what is the worth of the remaining share?
def solve() -> int: total_worth = 800 rate = total_worth/6 woman_share_worth = rate * 4 remaining_share_worth = total_worth - woman_share_worth result = remaining_share_worth return result
am collects 128 stamps a month from different countries. Emma collects half as many stamps a month as Sam. How many more stamps does Sam collect than Emma in four months?
def solve() -> int: months = 4 sam_monthly = 128 emma_monthly = 0.5 * sam_monthly difference_monthly = sam_monthly - emma_monthly difference_four_months = difference_monthly * months result = difference_four_months return result
Amy's guacamole recipe requires 1/3 cup of avocado but she wants to increase the richness by tripling the amount. Each avocado produces 1/2 cup of fruit. How many avocados does Amy need?
def solve() -> int: avocado_needed = 1/3 avocado_richness = 3 fruit_per_avocado = 1/2 total_avocado_needed = (avocado_needed * avocado_richness) / fruit_per_avocado result = round(total_avocado_needed, 2) return result
If 18 people can finish work in 5 days, how long would it take for 30 people to finish the same work?
def solve() -> int: people_1 = 18 days_1 = 5 people_2 = 30 days_2 = (people_1 * days_1) / people_2 result = days_2 return result
A school held a bake sale and sold 30 cakes at $10 each, 20 cookies at $2 each, and 10 brownies at $3 each. If they collected $500, how much profit did they earn?
def solve() -> int: cakes_cost = 30*10 cookies_cost = 20*2 brownies_cost = 10*3 total_cost = cakes_cost + cookies_cost + brownies_cost profit = 500 - total_cost result = profit return result
Jeff drove to the post office. He spent 34 minutes driving there, and half the amount of time driving back home. How many minutes did he drive in total?
def solve() -> int: total_time_driving = 0 time_driving_there = 34 time_driving_back = time_driving_there/2 total_time_driving = time_driving_there + time_driving_back result = total_time_driving return result
- A gardener planted 480 flowers in his garden. He arranged them in rows of 15 and columns of 8. He watered each flower with 200 milliliters of water every day for a week. How much water did he use in total for his garden in a week?
def solve() -> int: total_number_of_flowers = 15 * 8 amount_of_water_per_flower_per_week = 200 * 7 total_amount_of_water = total_number_of_flowers * amount_of_water_per_flower_per_week result = total_amount_of_water return result
Student: Sarah wants to buy a house for $500,000. She plans to put 20% down and take out a loan for the rest, with a yearly interest rate of 2.5 and a loan term of 30 years. How much will be her monthly payment?
def solve() -> int: house_price = 500000 down_payment = house_price * 0.2 loan_amount = house_price - down_payment interest_rate = 0.025 loan_term = 30 monthly_payment = loan_amount * (interest_rate * (1 + interest_rate) ** loan_term) / ((1 + interest_rate) ** loan_term - 1) result = monthly...
A quilt is made up of 30 square patches. Each patch measures 8 inches on each side. What is the total area of the 30 patches?
def solve() -> int: patch_side_length = 8 num_patches = 30 patch_area = patch_side_length ** 2 total_area = patch_area * num_patches result = total_area return result
A restaurant needs to purchase 3 new refrigerators. The first costs $2000, the second costs $3000, and the third costs $4000. How much will just the refrigerators cost in total?
def solve() -> int: refrigerator_cost_1 = 2000 refrigerator_cost_2 = 3000 refrigerator_cost_3 = 4000 total_cost = refrigerator_cost_1 + refrigerator_cost_2 + refrigerator_cost_3 result = total_cost return result
In one week, Bikram spent 3/5 of his time studying and the rest of the time hanging out with friends. If Bikram studied for a total of 42 hours, how many hours did he spend hanging out with friends?
def solve() -> int: total_Hours = 42 studying_Hours = 0.60 * total_Hours hanging_Hours = total_Hours - studying_Hours result = hanging_Hours return result
Possible new questions and programs: Mr. Park teaches two classes of fifth graders, each with 28 students. On Friday, 5 students from the first class and 6 students from the second class went on a field trip. How many students did Mr. Park have in his classes on Friday?
def solve() -> int: first_class = 28 second_class = 28 first_class = first_class - 5 second_class = second_class - 6 total = first_class + second_class result = total return result
Anna is comparing two different plans to buy a smartphone. The first plan charges $300 for the phone and $50 per month for unlimited calls and data. The second plan charges $200 for the phone and $60 per month for the same service. How long will it take for the total cost of the two plans to be equal?
def solve() -> int: def total_cost(phone, fee, months): return phone + fee * months months = 0 while True: months += 1 plan1_cost = total_cost(300, 50, months) plan2_cost = total_cost(200, 60, months) if plan1_cost == plan2_cost: result = f"The total cost of t...
A car company produced 600 cars, selling 80% of them at full price, 10% with a discount of 10%, and the rest with a discount of 20%. The Full Price of a car is $10000. What was the total revenue obtained by the company?
def solve() -> int: cars_produced = 600 full_price = 10000 discount_1 = 0.1 discount_2 = 0.2 sale_price_1 = full_price * (1 - discount_1) sale_price_2 = full_price * (1 - discount_2) quantity_full_price = 0.8 * cars_produced quantity_sale_price_1 = 0.1 * cars_produced quantity_sale_p...
am has $87 in the bank. He made a $27 deposit and then followed by a $8 withdrawal. What is Sam's bank balance?
def solve() -> int: balance = 87 deposit = 27 withdrawal = 8 balance = balance + deposit balance = balance - withdrawal result = balance return result
The hypotenuse of a right triangle is 10 inches and the other leg is 6 inches. Calculate the length of the other leg.
def solve() -> int: hypotenuse = 10 one_leg = 6 other_leg = (hypotenuse ** 2 - one_leg ** 2) ** 0.5 result = other_leg return result
Amanda has $150 and she wants to buy a new phone that costs $250. She needs to save more money to buy the phone. How much more does she need to save?
def solve() -> int: money_saved = 150 phone_cost = 250 money_left = phone_cost - money_saved result = money_left return result
Frank earns $20 per hour for the first 40 hours he works in a week and $30 per hour for any additional hours he works. How much money will he earn after working 55 hours this week?
def solve() -> int: hours_worked = 55 hourly_pay_1 = 20 hourly_pay_2 = 30 if hours_worked <= 40: earnings = hours_worked * hourly_pay_1 else: earnings = 40 * hourly_pay_1 + (hours_worked - 40) * hourly_pay_2 result = earnings return result
A warehouse is 200 feet long and 150 feet wide. If there is 1 pallet per 50 square feet, how many pallets can fit in the warehouse?
def solve() -> int: length = 200 width = 150 area = length * width pallets_per_square_feet = 1/50 total_pallets = area * pallets_per_square_feet result = total_pallets return result
A factory produces 400 units of a certain product in a day. If the factory operates for 5 days a week, how many units of the product are produced in a month?
def solve() -> int: units_per_day = 400 days_per_week = 5 days_per_month = 30 total_units = units_per_day * days_per_week * days_per_month result = total_units return result
A car travels 120 miles on a highway at a speed of 60 miles per hour. It then travels 50 miles on a suburban road at a speed of 30 miles per hour. How long did the entire trip take in hours?
def solve() -> int: distance_highway = 120 speed_highway = 60 distance_suburban = 50 speed_suburban = 30 time_highway = distance_highway / speed_highway time_suburban = distance_suburban / speed_suburban total_time = time_highway + time_suburban result = total_time return result
A letter has a weight of 6 grams. If you need to send 375 letters, and the postage cost is 15 cents per ounce or fraction thereof, how much will it cost to send all the letters?
def solve() -> int: weight_per_letter = 6 total_letters = 375 total_weight = weight_per_letter * total_letters / 28.35 cost_per_ounce = 0.15 total_cost = cost_per_ounce * total_weight result = round(total_cost, 2) return result
A school has 4 classrooms. Each classroom has 25 tables with 4 chairs each. If there are 2 schools and they have the same number of chairs, calculate the total number of chairs.
def solve() -> int: tables = 25*4 chairs = tables * 2 schools_chairs = chairs * 2 result = schools_chairs return result
Mark bought 5 basketballs and 6 tennis rackets. Tennis rackets were 4 times as expensive as basketballs. How much did Mark spend on tennis rackets?
def solve() -> int: cost_basketball = 5 / (5 + 6) cost_racket = 4 * cost_basketball price_racket = 6 * cost_racket result = price_racket return result
Anna is saving money for a bike. The bike costs 200 dollars. She saves 10 dollars every week from her allowance. She has already saved 60 dollars. How many more weeks will she need to save enough money for the bike?
def solve() -> int: bike_cost = 200 saved_per_week = 10 saved_so_far = 60 remaining_amount = bike_cost - saved_so_far weeks_needed = remaining_amount // saved_per_week result = weeks_needed return result
Carla wants to earn $50 babysitting. She charges $10 per hour and has already babysat for 4 hours. How many more hours does Carla need to babysit to reach her goal?
def solve() -> int: goal = 50 rate = 10 hours_babysat = 4 remaining_goal = goal - (rate * hours_babysat) hours_needed = remaining_goal / rate result = hours_needed return result
Alex purchases a book with 2 dollar bills, 3 quarters, and 2 dimes. If he gets 35 cents back, how much did the book cost?
def solve() -> int: dollars = 2 quarters = 3 dimes = 2 change = 35 total_spent = dollars * 2 + quarters * 0.25 + dimes * 0.1 book_cost = total_spent - change result = book_cost return result
Joey found the average of 3 small numbers, and it was 10. Later, he found the average of 4 numbers, and it was 16. If the 4 numbers included the previous 3 small numbers, what is the fourth number?
def solve() -> int: prevAve = 10 newAve = 16 prevAveNums = 3 newAveNums = 4 differ = newAve - prevAve overallDiffer = differ * (newAveNums - prevAveNums) result = overallDiffer return result
An online store has 4 cashiers who have to process 1000 orders in 3 hours. How many orders should each cashier process in that time?
def solve() -> int: total_orders = 1000 num_cashiers = 4 task_duration = 3 orders_for_each_cashier = total_orders / num_cashiers / task_duration result = orders_for_each_cashier return result
Possible questions and programs: Maria sells 4 bracelets for $15 each. She pays a 10% commission to the store owner. How much money does she earn after paying the commission?
def solve() -> int: total_sales = 4 * 15 commission = total_sales * 0.1 net_income = total_sales - commission result = net_income return result
Student: For Nathan's science project, he wants to buy a pack of batteries and three LED lights. The pack of batteries costs $6 and each LED light costs $3. How much will the total cost be for Nathan's science project?
def solve() -> int: battery_cost = 6 led_cost = 3 num_led = 3 total_cost = battery_cost + led_cost * num_led result = total_cost return result
Laura has always wanted to learn how to play 5 musical instruments. She spends 6 months learning to play the first instrument and double the time for the rest. It takes her 2 years to learn and perfect her skills on all the instruments. How long did it take her to accomplish her goal?
def solve() -> int: first_instrument = 6 rest_instruments = first_instrument * 2 total_time = first_instrument + (rest_instruments * 4) result = total_time / 12 return result
Michael wants to buy a house that costs $300,000. He can afford to make a down payment of 20%, and he can get a 30-year mortgage with an interest rate of 4%. How much will his monthly mortgage payment be?
def solve() -> int: house_cost = 300000 down_payment_percent = 0.2 down_payment = house_cost * down_payment_percent loan_amount = house_cost - down_payment interest_rate = 0.04 years = 30 months = years * 12 interest_rate_per_month = interest_rate / 12 monthly_payment = loan_amount *...
The American Heart Association recommends that adults get at least 150 minutes of moderate exercise per week. If you have already exercised for 30 minutes on Monday and 45 minutes on Tuesday, how many more minutes of exercise do you need to get this week?
def solve() -> int: monday_exercise = 30 tuesday_exercise = 45 recommended_exercise = 150 total_exercise = monday_exercise + tuesday_exercise remaining_exercise = recommended_exercise - total_exercise result = remaining_exercise return result
Ashley studies for four semesters in a year. In 2021, she scored 15 more marks in chemistry in the first semester than the second, 10 marks less in physics, and 1/2 marks less in biology in the first semester than the second. If she got 75 marks in chemistry in the second semester, 80 marks in physics, and 85 in biolog...
def solve() -> int: first_semester_chem = 75 second_semester_chem = first_semester_chem - 15 first_semester_phy = 80 second_semester_phy = first_semester_phy + 10 first_semester_bio = 85 second_semester_bio = first_semester_bio + 1/2 total_marks = first_semester_chem + second_semester_c...
Hannah walks 1.5 miles to get to the library. After studying, she walks for 10 minutes at a speed of 4 miles per hour to get home. What is the total distance Hannah covers?
def solve() -> int: distance_to_library = 1.5 time_to_get_home = 10/60 speed_to_get_home = 4 distance_to_get_home = time_to_get_home * speed_to_get_home total_distance = distance_to_library + distance_to_get_home result = total_distance return result
Peter has a bookshelf with 50 books. On Monday, he borrowed 3 books from the library. On Tuesday, he read 4 books and kept them on the table. On Wednesday, he got 2 more books as gifts. How many books does he have now on the bookshelf?
def solve() -> int: books_on_shelf = 50 borrowed_books = 3 read_books = 4 gifted_books = 2 books_on_shelf = books_on_shelf - borrowed_books books_on_shelf = books_on_shelf + read_books books_on_shelf = books_on_shelf + gifted_books result = books_on_shelf return result...