question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
7. Rachel was making cookies for her school bake sale. She needed to use 15 cups of sugar if she was going to make 200 cookies. How many cups of sugar would she need to make 400 cookies?
def solve() -> int: cookies_200 = 200 sugar_200 = 15 cookies_400 = 400 result = sugar_200 * cookies_400 / cookies_200 return result
There are 15 apples in a basket and four times as many oranges in another basket. If 2/3 of the apples and 1/6 of the oranges are rotten, calculate the total number of fresh fruits.
def solve() -> int: apples = 15 oranges = 4 * apples rotten_apples = 2/3 * apples rotten_oranges = 1/6 * oranges fresh_apples = apples - rotten_apples fresh_oranges = oranges - rotten_oranges total_fresh = fresh_apples + fresh_oranges result = total_fresh return result
At a grocery store, Jason bought 4 bags of apples for 5 dollars each and 2 cartons of milk for 3 dollars each. If he paid with a 50 dollar bill, how much change did he receive?
def solve() -> int: apple_bags_price = 5 milk_carton_price = 3 number_of_bags = 4 number_of_cartons = 2 total_cost = apple_bags_price * number_of_bags + milk_carton_price * number_of_cartons change = 50 - total_cost result = change return result
Nate is making a fruit salad. He uses 2/5 of a pineapple, 3/4 of a watermelon, and 1/3 of a cantaloupe. Each fruit weighs 2 kg before cutting. How much does the fruit salad weigh?
def solve() -> int: fruit_salad_weight = 2/5 * 2 + 3/4 * 2 + 1/3 * 2 result = fruit_salad_weight return result
A train travels 100 miles at 50 miles per hour and then travels another 200 miles at 60 miles per hour. What is the total travel time?
def solve() -> int: distance1 = 100 speed1 = 50 time1 = distance1 / speed1 distance2 = 200 speed2 = 60 time2 = distance2 / speed2 total_travel_time = time1 + time2 result = total_travel_time return result
Bob buys 20 pencils for $2 and sells them for $0.15 each. If he sells them all, how much profit does he make in cents?
def solve() -> int: pencil_cost = 2 pencils_bought = 20 pencil_sell_price = 0.15 pencils_sold = pencils_bought revenue = pencils_sold * pencil_sell_price cost = pencil_cost profit = revenue - cost * pencils_bought result = profit return result
A total of 300 candies are to be divided equally among a group of children. If the candies are shared equally, each child gets 5. How many children are in the group?
def solve() -> int: total_candies = 300 candies_per_child = 5 number_of_children = total_candies // candies_per_child result = number_of_children return result
In three years, Fiona will be five times as old as Greg. If Fiona is now 9 years old, how old is Greg now?
def solve() -> int: Fiona = 9 Greg = None Greg = Fiona / 5 - 2.4 result = Greg return result
A company has a total monthly income of $5000. It spends 30% of its income on salaries. The expenses of the company are twice the salary paid and it saves 25% of the remaining income. If the company has saved $1000, how much time has elapsed?
def solve() -> int: total_income = 5000 salary_percent = 0.3 expenses_to_salary_ratio = 2 remaining_income_percent = 1 - salary_percent saved_percent_of_remaining_income = 0.25 saved_money = 1000 total_expenses = expenses_to_salary_ratio*total_income*salary_percent remaining_income = tot...
A chef wants to mix two kinds of nuts to make a trail mix. The first kind of nuts costs $3 per pound, and the second kind costs $5 per pound. The final mix should have a cost of $4 per pound, and it should contain twice as much of the first kind of nuts as of the second kind. How much of each type of nut should be used...
def solve() -> int: first_nut_price = 3 second_nut_price = 5 final_mix_price = 4 total_mix_weight = 10 first_nut_ratio = 2 y = (total_mix_weight / (first_nut_ratio + 1)) * (final_mix_price - first_nut_price) / (second_nut_price - final_mix_price + first_nut_price) x = first_nut_rat...
8. A certain software was downloaded 150 times in the first week at a cost of $25 per copy. In the second, the cost increased by a factor of 3 and the number of downloads by a factor of 5. How much money were the developers able to make in the second week?
def solve() -> int: cost1 = 25 cost2 = cost1 * 3 downloads1 = 150 downloads2 = downloads1 * 5 income1 = cost1 * downloads1 income2 = cost2 * downloads2 result = income1 + income2 return result
- Mia and Zoe are collecting money for a charity. Mia collects 5 dollars for every hour she works, and Zoe collects 7 dollars for every hour she works. They both work for 10 hours. How much more money does Zoe collect than Mia?
def solve() -> int: mia = 5 * 10 zoe = 7 * 10 difference = zoe - mia result = difference return result
A certain fruit is available in the market for 12 days a year only. The annual production of the farmer is 480 kg from an orchard of 200 trees. It is found that on an average 30% of the fruit gets decayed. If a man purchases 6 kg of that fruit, how many fruits did the man buy?
def solve() -> int: production = 480 trees = 200 decay_percent = 30 days = 12 total_fruits = production / (1 - decay_percent/100) fruit_per_day = total_fruits / days fruit_bought = 6 number_of_fruits = fruit_bought / (1 - decay_percent/100) result = number_of_fruits return resul...
John's music class has 8 members and 1/3 of them are playing the violin. How many members are playing the violin?
def solve() -> int: members = 8 total = members violinists = 1/3 * total result = round(violinists) return result
Student: A bookshop had 27 books that contained stories of the same type. Each book contains 36 pages and each story contains 9 pages. How many stories does the bookshop have in total?
def solve() -> int: books = 27 pages_per_book = 36 pages_per_story = 9 total_stories = books * (pages_per_book // pages_per_story) result = total_stories return result
Juan is making a sauce that's 80% tomato, 10% onion, and the rest spices. If he adds 400 grams of tomato, how many grams of spices does he need?
def solve() -> int: tomato_percentage = 80 onion_percentage = 10 spices_percentage = 100 - tomato_percentage - onion_percentage tomato_grams = 400 spices_grams = (spices_percentage / tomato_percentage) * tomato_grams result = spices_grams return result
A grocery store sells a box of 30 oranges for $11.75. How much does it cost to buy 15 boxes?
def solve() -> int: price_per_box = 11.75 total_price = price_per_box * 15 result = total_price return result
Jason is a sculptor. He uses 4 fewer than 7 pounds of clay for each sculpture. If he has 2 tons of clay, how many sculptures can he make?
def solve() -> int: clay_per_sculpture = 7 - 4 clay_in_ton = 2000 sculptures = clay_in_ton * 1000 / clay_per_sculpture result = sculptures return result
Two buses heading from two different cities start from the same point. After covering 200 miles, one bus arrives at its destination 30 minutes earlier than the other. What was the difference in speed between these two buses?
def solve() -> int: totalTime = 30 totalDistance = 200 result = totalDistance/totalTime return result
Student: Lorraine has 12 blueberries and 3 blackberries. Lorraine has 3 more strawberries than David. Lorraine has one fourth as many grapes as David. If David has 4 strawberries and 8 grapes, how many fruits does Lorraine have in total?
def solve() -> int: blueberries = 12 blackberries = 3 strawberries_lorraine = 4 + 3 grapes_lorraine = 8 / 4 strawberries_david = 4 grapes_david = 8 total_fruits_lorraine = blueberries + blackberries + strawberries_lorraine + grapes_lorraine result = total_fruits_lorraine return resu...
There are 20 bags of chips that each holds 50 grams. If Carl wants to make 5 kilograms of chips, how many bags does he need to buy?
def solve() -> int: num_bags = (5*1000) / (50) result = int(num_bags) return result
A pizza shop sells a large pizza for $12.50 and a small pizza for $8.75. Last month they sold 500 large pizzas and 250 small pizzas. What was their total revenue?
def solve() -> int: price_large = 12.50 price_small = 8.75 quantity_large = 500 quantity_small = 250 revenue = (price_large * quantity_large) + (price_small * quantity_small) result = revenue return result
Isaac sells his custom-made phone cases for $5 each. He can make 4 phone cases in 45 minutes. If he has 9 hours to make phone cases, how much can he expect to earn?
def solve() -> int: time_to_make_cases = 9 * 60 sets_of_cases = time_to_make_cases // 45 total_cases = sets_of_cases * 4 money_earned = total_cases * 5 result = money_earned return result
Two joggers run in opposite directions around a circular track of 800 meters. One can complete a round in 225 seconds and the other in 300 seconds. After how many seconds will they meet again at the starting point?
def solve() -> int: total_distance = 800 jogger1_time_per_round = 225 jogger2_time_per_round = 300 time_to_meet = total_distance / (jogger1_time_per_round + jogger2_time_per_round) * 60 result = time_to_meet return result
A store has 20 regular products for $8 each and 40 sale products for $6 each. What is the total revenue after selling out all 60 products?
def solve() -> int: Number_regular = 20 Cost_regular = 8 Number_sale = 40 Cost_sale = 6 Total_revenue = Number_regular * Cost_regular + Number_sale * Cost_sale result = Total_revenue return result
Chris had 70 fish and he sold 1/2 of them. Then, he decided to give away another 1/3 of the remaining fish he had left. How many fish does Chris have left?
def solve() -> int: total_fish = 70 fraction_sell = 1/2 fraction_give = 1/3 total_fish -= total_fish * fraction_sell total_fish -= total_fish * fraction_give result = total_fish return result
In a week, a pizza restaurant sells 120 pizzas on a slow day, which is half the number of pizzas they sell on a busy day. How many pizzas do they sell in 3 busy days and 2 slow days?
def solve() -> int: busy_day_pizzas = 240 slow_day_pizzas = busy_day_pizzas / 2 total_pizzas = (busy_day_pizzas * 3) + (slow_day_pizzas * 2) result = total_pizzas return result
Christina has 5 packs of candies with 15 pieces in each pack. She wants to share them equally with her friends. If she has 3 friends, how many candies will each of them get?
def solve() -> int: packs = 5 pieces_per_pack = 15 total_candies = packs * pieces_per_pack friends = 3 candies_each = total_candies / friends result = candies_each return result
A group of hikers went on a trail. They brought 2 loaves of bread, each with 20 slices. If each of them ate 2 slices, how many hikers were in the group?
def solve() -> int: loaves_of_bread = 2 slices_per_loaf = 20 slices_per_hiker = 2 total_slices = loaves_of_bread * slices_per_loaf total_hikers = total_slices // slices_per_hiker result = total_hikers return result
Example output: There are 2243 green apples and 3121 red apples in a farm. The farmer wants to sell some of the apples to a market and keep the rest for himself. He decides to sell 3/5 of the green apples and 2/3 of the red apples. How many apples will he keep for himself?
def solve() -> int: green_sold = (3/5) * 2243 red_sold = (2/3) * 3121 green_kept = 2243 - green_sold red_kept = 3121 - red_sold total_kept = green_kept + red_kept result = total_kept return result
Max has a summer job as a lifeguard. In his first month, he earned $450. In his second month, he tripled his first month earnings. In the third month, he made $300 less than double the sum of his earnings for the first two months. What was Max's total earning for the three months?
def solve() -> int: first_month_earnings = 450 second_month_earnings = first_month_earnings * 3 third_month_earnings = (first_month_earnings + second_month_earnings) * 2 - 300 total_earnings = first_month_earnings + second_month_earnings + third_month_earnings result = total_earnings r...
A flower shop has 4 roses for each tulip. If the flower shop has 30 tulips, how many roses and tulips are there altogether?
def solve() -> int: num_roses = 4 * 30 total_flowers = num_roses + 30 result = total_flowers return result
A recipe for a cake requires 2 cups of sugar and 3 cups of flour. You want to make 4 cakes. How much sugar do you need in total?
def solve() -> int: sugar_per_cake = 2 total_cakes = 4 total_sugar = sugar_per_cake * total_cakes result = total_sugar return result
John has twice the amount of money Tom has, and Tom has $20 less than Sarah. If Sarah has $130, how much does John have?
def solve() -> int: sarah_money = 130 tom_money = sarah_money - 20 john_money = tom_money * 2 result = john_money return result
Emily bought 7 pairs of shoes. She gave 2 to her friends and then bought 5 more. How many pairs of shoes does Emily have now?
def solve() -> int: pairs_of_shoes = 7 shoes_given_to_friends = 2 shoes_bought = 5 total_shoes = pairs_of_shoes - shoes_given_to_friends + shoes_bought result = total_shoes return result
Student: Derek got a haircut for $20 and decided to leave a 20% tip. If Derek paid the barber with a $50 bill, how much did he receive in change?
def solve() -> int: cost = 20 tip_rate = 0.2 bill = 50 tip = cost * tip_rate total = cost + tip change = bill - total result = change return result
A coffee shop sold 24 more than seven times the number of cups of tea as it did cups of hot chocolate. If the coffee shop sold 8 cups of hot chocolate, how many cups of tea did it sell?
def solve() -> int: t = 24 + 7 * 8 result = t return result
Max has 6 beech trees and 1 oak tree. If each beech tree produces 55 beeches and the oak tree produces 40 oaks, how many fruits does Max have in total?
def solve() -> int: beech_num = 6 oak_num = 1 beech_fruit = 55 oak_fruit = 40 result = beech_num * beech_fruit + oak_num * oak_fruit return result
Student: A class of 30 students took a math test. The average score of the class was 80. If the top 10 students received an average score of 95, what was the average score of the other 20 students?
def solve() -> int: num_students = 30 avg_score_class = 80 avg_score_top_10 = 95 total_score_class = num_students * avg_score_class total_score_top_10 = 10 * avg_score_top_10 total_score_other_20 = total_score_class - total_score_top_10 avg_score_other_20 = total_score_other_20 / 20 resu...
Student: Carla is placing tiles on her kitchen floor. The kitchen is 12 feet long and 8 feet wide. Each tile is 1 square foot. How many tiles does she need to cover the entire floor?
def solve() -> int: length = 12 width = 8 tile_area = 1 floor_area = length * width tiles = floor_area / tile_area result = tiles return result
Abigail has 100 stickers. She wants to arrange them in 5 rows with an equal number of stickers in each row. How many stickers will be in each row?
def solve() -> int: stickers = 100 rows = 5 stickers_per_row = stickers // rows result = stickers_per_row return result
Student: The ratio of boys to girls in a class is 3:4. If there are 21 boys in the class, how many girls are there?
def solve() -> int: boys = 21 ratio_boys = 3 ratio_girls = 4 girls = boys * ratio_girls / ratio_boys result = girls return result
There are 1760 students in a school. The number of students in each of the 5 grade levels are in the ratio 3:4:3:5:4. How many students are in the third grade level?
def solve() -> int: grade_level_3 = 0 grade_level_3 = (1760 * 3) // 16 result = grade_level_3 return result
Kate needs to drive 400 miles to a job interview. She has 5 gallons of gas and her car consumes 10 gallons of gas per 100 miles. How many gallons of gas will she have left when she reaches her destination?
def solve() -> int: total_miles = 400 gallons_per_hundred_miles = 10 current_gas = 5 total_gallons = (total_miles / 100) * gallons_per_hundred_miles gas_left = current_gas - total_gallons result = gas_left return result
A football stadium had 50000 spectators on Sunday and 60000 spectators on Monday. If each spectator spent $20 on average during their time in the stadium, calculate the total revenue of the stadium over the two days.
def solve() -> int: spectators_on_sunday = 50000 spectators_on_monday = 60000 average_spending_per_spectator = 20 total_revenue = (spectators_on_sunday + spectators_on_monday)*average_spending_per_spectator result = total_revenue return result
You have a $20 budget and want to buy socks that cost $3 a pair. How many pairs of socks can you buy with your budget?
def solve() -> int: pairs_of_socks = 20 // 3 result = pairs_of_socks return result
Sasha wants to buy a shirt that costs $15.99 but it is on sale for 20% off. How much will she save if she buys the shirt on sale?
def solve() -> int: original_price = 15.99 discount_percent = 20 discount_amount = original_price * discount_percent / 100 result = discount_amount return result
James picks 75 apples from his orchard. From each apple, he can make 2 apple pies. It requires 10 apples to make a pie. If James sells each pie for $25, and he paid $600 for all the labor, how much profit will he make?
def solve() -> int: apples_picked = 75 pies_per_apple = 2 apples_per_pie = 10 pies_made = apples_picked * pies_per_apple apples_used = pies_made * apples_per_pie cost_of_labor = 600 revenue = pies_made * 25 profit = revenue - cost_of_labor result = profit return result
Here are some possible questions and programs: Julia buys a pack of 12 muffins and a bottle of milk for her breakfast. She eats 3 muffins and drinks 250 ml of milk. The bottle of milk has a capacity of 1 liter and a price of $4. The pack of muffins costs $6. How much did Julia spend per muffin and per ml of milk?
def solve() -> int: muffin_price = 6 / 12 milk_price = 4 / 1000 breakfast_cost = 3 * muffin_price + 250 * milk_price result = breakfast_cost return result
The dimensions of a rectangle are 8 cm and 11 cm. What is the perimeter of the rectangle?
def solve() -> int: length = 8 width = 11 perimeter = 2*(length+width) result = perimeter return result
Jessica is buying paper plates for her barbecue party. She needs 2 plates for each guest and invited 25 guests, but her neighbor who is coming won't need any plates. If each pack has 20 plates, how many packs of plates does Jessica need to buy?
def solve() -> int: num_guests = 25 plates_per_guest = 2 total_plates = num_guests * plates_per_guest total_plates -= 2 plates_per_pack = 20 num_packs = total_plates // plates_per_pack + 1 result = num_packs return result
Rachel is distributing apples. She needs 5 apples for each basket. A bushel of apples has approximately 40 apples. How many baskets can she make using 2 bushels of apples?
def solve() -> int: bushels_of_apples = 2 apples_per_bushel = 40 apples_per_basket = 5 total_apples = bushels_of_apples * apples_per_bushel baskets = total_apples // apples_per_basket result = baskets return result
Alex owns 3 guitars and Gabe owns 5 guitars. If they combine all their guitars, how many guitars do they own together?
def solve() -> int: guitars_alex = 3 guitars_gabe = 5 total_guitars = guitars_alex + guitars_gabe result = int(total_guitars) return result
In one year, Lily will be twice as old as Max. If Max is currently five years old, how old is Lily? In a group project, four students have contributed to the final report. Mia contributed 5 pages more than Jon. Jon contributed twice as many pages as did Frank, and Frank contributed 3 pages less than Tyler. If Tyler con...
def solve() -> int: max_age = 5 tyler_pages = 12 lily_age = 2 * (max_age + 1) frank_pages = tyler_pages - 3 jon_pages = 2 * frank_pages mia_pages = jon_pages + 5 total_pages = tyler_pages + frank_pages + jon_pages + mia_pages result = total_pages return ...
Student: A plant produces 450 items each month. In order to reach a yearly rate of 9500 items, how many more items should the plant produce each month?
def solve() -> int: monthly_production = 450 yearly_target = 9500 months_in_year = 12 total_needed = yearly_target - (monthly_production * months_in_year) extra_items_needed = total_needed / months_in_year total_items_needed = monthly_production + extra_items_needed result = total_items_need...
There were 100 people in a building. 3/10 of them left to go to the park. After 2/5 of the remaining people left the building, how many people were left inside?
def solve() -> int: people_in_building = 100 left_for_park = people_in_building * 3 / 10 remaining = people_in_building - left_for_park left_again = remaining * 2 / 5 still_inside = remaining - left_again result = still_inside return result
Vivian is going to the store to buy apples. She needs 6 apples and each apple costs $0.50. How much should she pay for all of the apples?
def solve() -> int: apples = 6 price = 0.50 result = apples * price return result
``` Rachel has 5 boxes that weigh 10 pounds each and 3 boxes that weigh 8 pounds each. What is the total weight of all the boxes?
def solve() -> int: weight_of_box1 = 10 weight_of_box2 = 8 num_box1 = 5 num_box2 = 3 total_weight = weight_of_box1 * num_box1 + weight_of_box2 * num_box2 result = total_weight return result
Rachel needs 2 cups of chicken broth, 1 cup of rice, and 1/2 cup of chopped onion to make her chicken and rice casserole. Her measuring cup can hold 1/4 cup. How many times does she need to fill it to measure all the ingredients?
def solve() -> int: chicken_broth = 2 rice = 1 onion = 1/2 total = chicken_broth + rice + onion result = int(total / 0.25) return result
Student: A grocery store had a four day sale on oranges. On Monday, they sold 80 oranges. On Tuesday, they sold twice as many oranges as they did the day before. On Wednesday they sold 10 oranges more than they did on Tuesday and on Thursday they sold half as many as they did on Monday. How many oranges did they sell d...
def solve() -> int: monday = 80 tuesday = 2 * monday wednesday = tuesday + 10 thursday = monday / 2 total = monday + tuesday + wednesday + thursday result = total return result
A student studies for an average of 3 hours each day, 7 days a week. From Monday to Thursday he studied at an average speed of 40 pages per hour, and on Friday and Saturday at an average speed of 50 pages per hour. How many pages did the student study during these 7 days?
def solve() -> int: days = 7 hours_per_day = 3 pages_per_hour_mon_thu = 40 pages_per_hour_fri_sat = 50 pages_mon_thu = hours_per_day * pages_per_hour_mon_thu pages_fri_sat = hours_per_day * pages_per_hour_fri_sat total_pages = (pages_mon_thu * 4) + (pages_fri_sat * 2) ...
If a customer wants to purchase 10 boxes of donuts and each box contains a dozen donuts, how many donuts do they need to purchase in total?
def solve() -> int: num_boxes = 10 num_dozen = 12 total_donuts = num_boxes * num_dozen result = total_donuts return result
Claire likes to spend 1/5 of her day doing yoga. She spends 1/4 of her time doing beginner's yoga poses, 1/3 of her time doing intermediate yoga poses, and 1/2 of her time doing advanced yoga poses. Claire spends 20 minutes doing beginner's poses, 25 minutes doing intermediate poses, and 30 minutes doing advanced poses...
def solve() -> int: beginner = 20 intermediate = 25 advanced = 30 total_time = (beginner + intermediate + advanced) total_time = total_time * 1/5 total_time = total_time / 60 result = total_time return result
Here are some possible questions and programs: Lucas and Mia have $4.80 between them. If Lucas has 20% more than Mia, how many dollars does Mia have?
def solve() -> int: x = 4.8 / 2.2 result = x / 100 return result
A real estate investment has increased in value by 15% over the last 2 years. If the initial investment was $50,000, what is the current value of the investment?
def solve() -> int: initial_investment = 50000 percent_increase = 0.15 current_value = initial_investment + (initial_investment*percent_increase) result = current_value return result
If the radius of a circle is 5 cm, what is the circumference of the circle?
def solve() -> int: pi = 3.14159 radius = 5 circumference = 2 * pi * radius result = circumference return result
Kate and Kevin are chopping vegetables. Kate can chop an average of 2 pounds of vegetables per minute, while Kevin can chop an average of 3 pounds of vegetables per minute. They need to chop 20 pounds of vegetables. How many minutes will it take for both of them to finish chopping?
def solve() -> int: kate_chop_rate = 2 kevin_chop_rate = 3 total_vegetables = 20 kate_time = total_vegetables / kate_chop_rate kevin_time = total_vegetables / kevin_chop_rate total_time = max(kate_time, kevin_time) result = total_time return result
Victoria is saving 500 gallons of water in a container each week for the next 6 months. If she spills 20 gallons and refills with an additional 50 gallons, how many gallons of water does she have after 6 months?
def solve() -> int: initial_quantity = 500 weeks_in_six_months = 6 * 4 total_quantity = initial_quantity * weeks_in_six_months total_quantity -= 20 total_quantity += 50 result = total_quantity return result
In a restaurant, the number of customers on Monday was 80. On Tuesday, 50% more customers came than on Monday, while on Wednesday, 10 less customers arrived than on Tuesday. On Thursday and Friday, 15 customers dined each day. On the weekend, there were no customers. How many customers were there from Monday through Fr...
def solve() -> int: monday_customers = 80 tuesday_customers = monday_customers * 1.5 wednesday_customers = tuesday_customers - 10 thursday_customers = 15 friday_customers = 15 total_customers = monday_customers + tuesday_customers + wednesday_customers + thursday_customers + friday_customer...
Q6: Ten singers are lined up at a talent show. Each singer is required to bring two accompanists along with them. If five more singers join the show, how many accompanists are now present?
def solve() -> int: singers_init = 10 accompanists = 2 new_singers = 5 total_accompanists = singers_init * accompanists + new_singers * accompanists result = total_accompanists return result
Connor gets paid 2 dollars for each dog he walks. He also gets a 50 dollar bonus for every 25 dogs he walks. If he walks 75 dogs, how much will he earn including bonuses?
def solve() -> int: dogs_walked = 75 bonus = dogs_walked // 25 * 50 earnings = dogs_walked * 2 + bonus result = earnings return result
If an apple costs 0.75 dollars and you have 10 dollars, how much money will you have left after buying 8 apples?
def solve() -> int: apple_cost = 0.75 total_money = 10 apples_bought = 8 total_cost = apple_cost * apples_bought money_left = total_money - total_cost result = money_left return result
Abe gave Tim $16 and Joseph $8. How much money did Abe give away in total?
def solve() -> int: total_money = 0 money_to_tim = 16 money_to_joseph = 8 total_money = money_to_tim + money_to_joseph result = total_money return result
-Alice and Bob are painting a fence that is 40 feet long and 6 feet high. Alice can paint 2 square feet per minute, while Bob can paint 3 square feet per minute. They start painting at opposite ends of the fence and move towards each other. How long will it take them to finish painting the fence in minutes?
def solve() -> int: area = 40 * 6 rate = 2 + 3 time = area / rate result = time return result
Anna runs 6 miles per day and walks 3 miles per day. How many miles does Anna travel in a week?
def solve() -> int: miles_run_per_day = 6 miles_walk_per_day = 3 miles_per_week = (miles_run_per_day + miles_walk_per_day) * 7 result = miles_per_week return result
Jack has 20 hours to spend on his hobbies. He spends 7.5 hours on drawing and 5.25 hours on coding. How much time does he have left to write? Samantha distributed 60 cupcakes to her classmates. If each classmate got 2 cupcakes, how many classmates did she have?
def solve() -> int: jack_total_hours = 20 jack_drawing_hours = 7.5 jack_coding_hours = 5.25 jack_writing_hours = jack_total_hours - jack_drawing_hours - jack_coding_hours samantha_total_cupcakes = 60 samantha_cupcakes_per_classmate = 2 samantha_total_classmates = samantha_tota...
Paige has to drive to a nearby town and back again. The total distance to travel is 30 miles. She can drive at a speed of 45 miles per hour on the way there and back again at a speed of 40 miles per hour. How long will it take for Paige to complete the entire journey?
def solve() -> int: total_distance = 30 speed_to_town = 45 speed_to_home = 40 time_to_town = total_distance/speed_to_town time_to_home = total_distance/speed_to_home result = time_to_town + time_to_home return result
If Jake has half as many apples as Emma and the two of them together have four fewer apples than Ethan, and Ethan has ten apples, how many apples does Jake have?
def solve() -> int: emma_apples = 10 * 2 ethan_apples = 10 total_apples = emma_apples + ethan_apples jake_apples = total_apples - 4 result = jake_apples return result
Possible questions and programs: Emma sells cupcakes at a fair. She can make 12 cupcakes every 20 minutes and sell them for $1.50 each. If she works for 3 hours, how much money does she earn?
def solve() -> int: minutes = 3 * 60 cupcakes = minutes // 20 * 12 revenue = cupcakes * 1.5 result = revenue return result
Student: Carl's class of 20 students is going on a field trip. Each student needs to rent a bike to get to the destination, and bikes are $5 for the day. How much money does Carl need to rent enough bikes for the whole class?
def solve() -> int: num_students = 20 price_per_bike = 5 total_cost = num_students * price_per_bike result = total_cost return result
Student: A row of houses has 12 houses. Each house has 2 floors, except for the first two houses which have 3 floors. Every floor is 2.5 meters high. Calculate the total height of all the houses.
def solve() -> int: houses = 12 floors = 2 extra_floors = 3 floor_height = 2.5 total_floors = houses * floors + 2 * (extra_floors - floors) total_height = total_floors * floor_height result = total_height return result
Three years ago, Jane was four times younger than her cousin. If Jane is 16, how old is her cousin?
def solve() -> int: jane_age = 16 years_ago = 3 jane_age_three_years_ago = jane_age - years_ago cousin_age_three_years_ago = jane_age_three_years_ago * 4 cousin_age = cousin_age_three_years_ago + years_ago result = cousin_age return result
Anna has $1200. She spent 85% of the money in a supermarket. How much money did she spend?
def solve() -> int: spent = 1200*0.85 result = spent return result
John saves $300 each month. How many months will it take him to save $3600?
def solve() -> int: savings_per_month = 300 total_savings_goal = 3600 num_of_months = total_savings_goal / savings_per_month result = num_of_months return result
David reads 150 pages every day for a week. On the 8th day, he reads 100 pages. How many pages did he read in total?
def solve() -> int: pages_per_day = 150 days_in_a_week = 7 pages_on_8th_day = 100 total_pages_in_a_week = pages_per_day * days_in_a_week total_pages_in_8_days = total_pages_in_a_week + pages_on_8th_day result = total_pages_in_8_days return result
Mary bought a dress that was originally priced at 80 dollars but was on sale for 20% off. She also had a coupon that gave her an extra 10% off the sale price. How much did she pay for the dress?
def solve() -> int: sale_price = 80 * (1 - 0.2) final_price = sale_price * (1 - 0.1) result = final_price return result
John earns $25 an hour and works 60 hours a week at his job. He wants to save up to buy a gaming laptop that costs $1500. After 3 months, how much money will he have left over after buying the laptop?
def solve() -> int: hourly_wage = 25 weekly_hours = 60 laptop_cost = 1500 months = 3 total_earnings = hourly_wage * weekly_hours * 4 * months money_left_over = total_earnings - laptop_cost result = money_left_over return result
Leo has a rectangular garden that is 18 m long and 12 m wide. He wants to build a fence around it and leave a 2 m wide gate on one side. The fence costs $5 per meter and the gate costs $50. How much will he spend on the fence and the gate?
def solve() -> int: perimeter = (18 + 12) * 2 fence_length = perimeter - 2 fence_cost = fence_length * 5 total_cost = fence_cost + 50 result = total_cost return result
If the temperature is currently 20 degrees Celsius and it drops by 8 degrees Celsius, what is the new temperature?
def solve() -> int: current_temperature = 20 change_in_temperature = -8 new_temperature = current_temperature + change_in_temperature result = new_temperature return result
A sack of mangos holds 20 mangos. Two of the mangos are sour and one goes sour every day, but on the third day three are eaten. How many sour mangos are in the sack after seven days?
def solve() -> int: total_mangos = 20 sour_mangos = 2 day1 = sour_mangos + 1 day2 = day1 + 1 day3 = day2 - 3 day4 = day3 + 1 day5 = day4 + 1 day6 = day5 + 1 day7 = day6 + 1 result = day7 return result
An item costs $24. After discount, the price became $18. What was the percentage discount?
def solve() -> int: original_price = 24 discount_price = 18 discount_percentage = (original_price-discount_price)/original_price*100 result = discount_percentage return result
Five athletes are having a friendly race. Athlete 1 ran for 60 seconds, athlete 2 took 10 seconds less than athlete 1, athlete 3 completed the race in 40 seconds, athlete 4 ran in 25 seconds, and athlete 5 finished in 10 seconds more than athlete 4. How long, in seconds, did it take all the athletes to complete the rac...
def solve() -> int: athlete_1 = 60 athlete_2 = athlete_1 - 10 athlete_3 = 40 athlete_4 =25 athlete_5 = athlete_4 + 10 result = athlete_1 + athlete_2 + athlete_3 + athlete_4 + athlete_5 return result
A factory produces 1000 shirts per day. If 3/8 of the shirts are orange, 1/5 are red and the rest are blue, how many shirts are blue?
def solve() -> int: orange_shirts = 1000 * 3/8 red_shirts = 1000/5 blue_shirts = 1000 - (orange_shirts + red_shirts) result = blue_shirts return result
Alexis works as a server at a restaurant and earns a variable amount of tips every shift. For the past six shifts, she earned $10, $20, $30, $40, $50, and $60. How much does she need to earn during her next shift if she wants to make an average of $35 per shift?
def solve() -> int: tip1 = 10 tip2 = 20 tip3 = 30 tip4 = 40 tip5 = 50 tip6 = 60 total_tips = tip1 + tip2 + tip3 + tip4 + tip5 + tip6 average_tips = total_tips / 6 next_tip = (35 * 7) - total_tips result = next_tip return result
Sam is preparing a chocolate cake for a party. She knows that each slice requires 0.5 cups of sugar and she has 14 guests. She plans to make 2 cakes, each with 12 slices. If all the cake is consumed, how many slices does each guest eat on average?
def solve() -> int: num_slices_per_cake = 12 num_cakes = 2 num_guests = 14 sugar_per_slice = 0.5 total_slices = num_slices_per_cake * num_cakes total_sugar = total_slices * sugar_per_slice slices_per_guest = total_slices / num_guests result = slices_per_guest return re...
Student: Haley is a sales representative who makes $2000 per month base salary and 5% commission on her sales. If she makes $5000 in sales this month, how much does she earn before taxes?
def solve() -> int: base_salary = 2000 sales = 5000 commission_rate = 0.05 commission = sales * commission_rate total_salary = base_salary + commission result = total_salary return result
A pizza parlor sells pizza slices for $2 each. If the parlor sells an average of 10 slices per hour for 8 hours per day, how much money does the parlor earn in a week (7 days)?
def solve() -> int: price_per_slice = 2 slices_per_hour = 10 hours_per_day = 8 days_per_week = 7 earnings = price_per_slice * slices_per_hour * hours_per_day * days_per_week result = earnings return result
In a zoo, the number of rabbits is four times the number of parrots. If the number of parrots in the zoo is 7 and after 35 minutes, half of the birds are released into the wild, calculate the total number of animals remaining in the zoo.
def solve() -> int: parrots = 7 rabbits = 4 * parrots total_birds = parrots + rabbits released_birds = total_birds / 2 remaining_animals = total_birds - released_birds result = remaining_animals return result
A park has 30 trees that need to be trimmed. Each tree will take 3 hours to complete. The company doing the work was able to do half of the required hours due to a shortage of employees. How many trees have been trimmed?
def solve() -> int: trees = 30 hours_per_tree = 3 total_hours = trees * hours_per_tree half_hours = total_hours / 2 trees_trimmed = half_hours / hours_per_tree result = trees_trimmed return result
Jillian works at a call center and can solve 8 problems per hour. She works for 7 hours a day. How many problems can Jillian solve in 4 days of work?
def solve() -> int: problems_per_hour = 8 hours_per_day = 7 days_of_work = 4 problems_solved = problems_per_hour * hours_per_day * days_of_work result = problems_solved return result