question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A toy store had 60 stuffed animals. They sold 30 stuffed animals during a sale. Then they received 20 more the next day. If they sold 10 stuffed animals the following day, How many stuffed animals did the toy store have left?
def solve() -> int: stuffed_animals = 60 stuffed_animals -= 30 stuffed_animals += 20 stuffed_animals -= 10 result = stuffed_animals return result
Student: A water tank can hold 1200 gallons of water. After filling the tank, 3/8 of the water leaked out. How many gallons of water remain in the tank?
def solve() -> int: tank_capacity = 1200 leak_fraction = 3/8 leak_amount = tank_capacity * leak_fraction remain_amount = tank_capacity - leak_amount result = remain_amount return result
A theme park has 2000 tickets to sell. If Jennifer sold 4 times as many tickets as Amanda and James sold half the number of tickets Amanda sold plus 10, how many tickets did Amanda sell?
def solve() -> int: amanda_tickets = 0 jennifer_tickets = 0 james_tickets = 0 jennifer_tickets = 4 * amanda_tickets james_tickets = (amanda_tickets / 2) + 10 total_tickets_sold = amanda_tickets + jennifer_tickets + james_tickets remaining_tickets = 2000 - total_tickets_so...
A supermarket sells apples in bags of 5 and charges $4 per bag, while oranges are sold in bags of 8 and cost $6 per bag. If John bought 3 bags of apples and 5 bags of oranges, calculate the total amount John spent.
def solve() -> int: apples_per_bag = 5 cost_of_apple_bag = 4 oranges_per_bag = 8 cost_of_orange_bag = 6 total_apple_bags = 3 total_orange_bags = 5 total_apples = apples_per_bag * total_apple_bags total_oranges = oranges_per_bag * total_orange_bags total_amount = (total_apples * (cost...
Ben is collecting bottle caps. He has 36 bottle caps in his bag and 18 more in his pocket. He wants to divide them equally among his 4 friends. How many bottle caps will each friend get?
def solve() -> int: bag = 36 pocket = 18 friends = 4 total = bag + pocket per_friend = total // friends result = per_friend return result
A farmer has 800 cows and wants to distribute them among 5 farms. If he wants to distribute them equally, how many cows will each farm get?
def solve() -> int: num_cows = 800 num_farms = 5 cows_per_farm = num_cows / num_farms result = cows_per_farm return result
Nick and Mike need a total of 22 cubes that are orange to play their game. Nick has a bag of 7 cubes and 71.42% of them are orange. Mike has a bag of 9 cubes and 85.7% of them are orange. How many cubes will the boys need to buy to play their game?
def solve() -> int: nickOrange = 1.0 * (7 * 0.7142) mikeOrange = 1.0 * (9 * 0.857) totalOrange = nickOrange + mikeOrange buy = 22 - totalOrange result = buy return result
A jar has 48 marbles of equal size. If 3 marbles are removed, what percentage of marbles are left in the jar?
def solve() -> int: marbles_left = (45/48) * 100 result = marbles_left return result
Student: Kim spends 20 minutes on average to finish one sudoku puzzle. She has a book of 50 sudoku puzzles and she wants to finish them all in one week. How many minutes per day does she have to spend on sudoku puzzles?
def solve() -> int: average_time = 20 total_puzzles = 50 days_in_week = 7 total_time = average_time * total_puzzles average_time_per_day = total_time / days_in_week result = average_time_per_day return result
In a grocery store, the number of apples is 4 times that of oranges. If there are 100 fruits in total, how many oranges are there?
def solve() -> int: o = 20 result = o return result
Rachel purchased 54 ounces of glue and divided it into 6 equal portions. If she used 4 parts of the glue, how many ounces of glue were left unused?
def solve() -> int: glue_purchased = 54 num_portions = 6 portion_size = glue_purchased / num_portions num_used = 4 glue_unused = glue_purchased - (num_used * portion_size) result = glue_unused return result
Olivia's tutoring service charges $20 per hour for regular tutoring and $35 per hour for advanced tutoring. If she tutors fourteen hours with regular tutoring and eleven hours with advanced tutoring in a week, how much money will she earn?
def solve() -> int: regular_tutoring_rate = 20 advanced_tutoring_rate = 35 regular_tutoring_hours = 14 advanced_tutoring_hours = 11 regular_tutoring_earnings = regular_tutoring_rate * regular_tutoring_hours advanced_tutoring_earnings = advanced_tutoring_rate * advanced_tutoring_hours ...
A citrus farmer harvests 500 oranges. He needs to pack them into crates. Each crate holds 50 oranges. How many crates does he need?
def solve() -> int: oranges = 500 oranges_per_crate = 50 total_crates_needed = int(oranges / oranges_per_crate) result = total_crates_needed return result
The triangle has a height of 8 inches and the base is 6 inches. What is the area of the triangle?
def solve() -> int: height = 8 base = 6 area = 0.5 * height * base result = area return result
Student: John has 12 cookies. He gave half of them to his friend, and then received 4 more from his mother. Finally, he ate 3 more cookies. How many cookies does John have left?
def solve() -> int: cookies_John_has = 12 cookies_John_gave = cookies_John_has / 2 cookies_John_received = 4 cookies_John_ate = 3 cookies_John_left = cookies_John_has - cookies_John_gave + cookies_John_received - cookies_John_ate result = cookies_John_left return result
ally practices the piano for 30 minutes every day. If she practices for 5 days in a row, how many total minutes of practice did she complete?
def solve() -> int: minutes_per_day = 30 days_practiced = 5 total_practice_minutes = minutes_per_day * days_practiced result = total_practice_minutes return result
Student: A grocery store has 12 apples in each bag. If they have 30 bags of apples, how many apples do they have in total?
def solve() -> int: bags = 30 apples_per_bag = 12 total_apples = bags * apples_per_bag result = total_apples return result
Ethan's allowance is $8 per week. He has saved $72 in the past year. How many weeks has he been saving his allowance?
def solve() -> int: allowance_per_week = 8 total_savings = 72 weeks_saving = total_savings / allowance_per_week result = weeks_saving return result
Ryan has 9 bags of chips with 15 chips in each bag. He had 18 chips already. He finishes all the chips in 3 days. How many chips does he eat a day?
def solve() -> int: bags_of_chips = 9 chips_per_bag = 15 chips_already_eaten = 18 days_to_finish_chips = 3 total_chips = bags_of_chips * chips_per_bag chips_eaten = total_chips - chips_already_eaten chips_per_day = chips_eaten / days_to_finish_chips result = chips_per...
John got a 20% discount on a pair of shoes that originally cost $80. How much did John pay after the discount?
def solve() -> int: original_price = 80 discount_rate = 0.2 discount_amount = original_price * discount_rate final_price = original_price - discount_amount result = f'John paid ${final_price} after the discount.' result = final_price return result
A train leaves a station and travels east at a speed of 90 km/h for 2 hours. It then turns north and travels at 60 km/h for 3 hours. How far is the train from the starting point?
def solve() -> int: east_distance = 90 * 2 north_distance = 60 * 3 distance_from_starting_point = (east_distance**2 + north_distance**2)**0.5 result = distance_from_starting_point return result
Student: Ella has a jar with 36 candies. She shares the candies equally with her three siblings. Then, she eats 2 candies from her share and gives 3 candies to her friend. How many candies does she have left?
def solve() -> int: total_candies = 36 siblings = 3 eaten = 2 given = 3 candies_per_sibling = total_candies // (siblings + 1) ella_candies = candies_per_sibling - eaten - given result = ella_candies return result
Jack has to build a wall. He works for 4 hours on the first day, spends twice as long on the second day as on the first day, and 1 hour less than the second day on the third day. How many hours does Jack work over the 3 days?
def solve() -> int: first_day = 4 second_day = 2 * first_day third_day = second_day - 1 total_hours = first_day + second_day + third_day result = total_hours return result
James is running a lemonade stand. He starts with 12 cups of lemonade, with 3 lemons per cup. He adds 2 more lemons to each cup to make the drink tangier. Then James spills 1/4 of his cups due to an accident. How many cups of lemonade does James have left?
def solve() -> int: cups_start = 12 lemons_per_cup = 3 additional_lemons = 2 total_lemons = cups_start * (lemons_per_cup + additional_lemons) cups_spilled = cups_start / 4 cups_left = cups_start - cups_spilled result = cups_left return result
Student: A box has a length of 10 cm, a width of 7 cm, and a height of 12 cm. What is its volume and surface area?
def solve() -> int: length = 10 width = 7 height = 12 volume = length * width * height area_front = length * height area_side = width * height area_top = length * width surface_area = 2 * (area_front + area_side + area_top) result = (volume, surface_area) return result
A soccer team scored 28 goals this season. If a player scored half as many goals as the top scorer, and he was the second best scorer on the team, how many goals did he score?
def solve() -> int: top_scorer_goals = 28 second_best_scorer_goals = top_scorer_goals / 2 result = second_best_scorer_goals return result
Zoe has 9 flowers in her vase. Liam has 4 less flowers than Zoe and Ella has 5 more flowers than Liam. How many flowers do the three friends have in total?
def solve() -> int: Zoe = 9 Liam = Zoe - 4 Ella = Liam + 5 total = Zoe + Liam + Ella result = total return result
A digital art piece is 36 inches by 24 inches. If there are 200 dots per inch, how many total pixels are there in the art piece?
def solve() -> int: width = 36 height = 24 dpi = 200 total_pixels = width * dpi * height * dpi result = total_pixels return result
Ursula, Victor, and Wendy have a meeting at 2:00 pm. Ursula arrives at 2:15 pm, Victor arrives 30 minutes after Ursula, and Wendy arrives 6 times later than Victor. What time does Wendy arrive?
def solve() -> int: meeting_time = 14 ursula_arrival = 14.15 victor_arrival = ursula_arrival + 0.30 wendy_arrival = victor_arrival + (6 * 0.30) result = (wendy_arrival - meeting_time) * 60 return result
Lisa has invested $10,000 in stocks. After a year, the stocks were worth $15,000 but she had to pay $1,000 in fees. What was her profit on investment?
def solve() -> int: initial_investment = 10000 final_value = 15000 fees = 1000 profit = final_value - initial_investment - fees result = profit return result
A pair of shoes costs $60. If Rachel has $200, how many pairs of shoes can she buy?
def solve() -> int: price = 60 money = 200 pairs = money // price result = pairs return result
The daily production goal of a factory is 120 units. If 96 units were produced, what percent of the goal was achieved?
def solve() -> int: daily_goal = 120 units_produced = 96 percent_achieved = (units_produced / daily_goal) * 100 result = percent_achieved return result
A computer game costs $30. If John has $150, how many games can he buy?
def solve() -> int: game_cost = 30 john_money = 150 games_can_buy = john_money // game_cost result = games_can_buy return result
David borrowed $500 from his friend and agreed to pay back 10% interest every month. He paid back $200 in the first month and $150 in the second month. How much does he still owe his friend after two months?
def solve() -> int: interest_1 = 500 * 0.1 balance_1 = 500 + interest_1 - 200 interest_2 = balance_1 * 0.1 balance_2 = balance_1 + interest_2 - 150 result = balance_2 return result
Possible questions: Mary bakes 3 cakes. The first cake weighs 2 pounds more than the second cake, and the second cake weighs 1 pound more than the third cake. If the first cake weighs 6 pounds, how much, in pounds, do the cakes weigh in total?
def solve() -> int: result = 13 return result
On Monday, Rachel has 45 pencils. On Tuesday, Rachel gives away a sixth of them. On Wednesday, Rachel buys 16 more pencils. On Thursday, Rachel buys a third of what she had on Tuesday. How many pencils does Rachel have on Thursday?
def solve() -> int: monday_pencils = 45 tuesday_pencils = monday_pencils - (monday_pencils / 6) wednesday_pencils = tuesday_pencils + 16 thursday_pencils = wednesday_pencils + (tuesday_pencils / 3) result = thursday_pencils return result
Pizza costs 12.99 dollars for a 16 inch and 9.99 dollars for a 12 inch pizza. What is the price difference per square inch?
def solve() -> int: area_16 = 3.14*(8**2) area_12 = 3.14*(6**2) cost_per_sq_inch_16 = 12.99/area_16 cost_per_sq_inch_12 = 9.99/area_12 difference = cost_per_sq_inch_16 - cost_per_sq_inch_12 result = difference return result
Student: At the start of the day I bought 10 apples, but at the end of the day I sold 5 apples. How many apples do I have now?
def solve() -> int: start_apples = 10 sold_apples = 5 result = start_apples - sold_apples return result
A store is having a clearance sale where everything is 40% off. A shirt costs $25 and a pair of sneakers costs $75. How much will it cost to buy a shirt and sneakers together during the clearance sale?
def solve() -> int: price_of_shirt = 25 price_of_sneakers = 75 total_price = price_of_shirt + price_of_sneakers discounted_price = total_price * (1 - 0.4) result = discounted_price return result
Student: - A pack of cookies costs $2.50, while a pack of crackers is 20% cheaper. Ben bought six packs of cookies and eight packs of crackers. How much did he pay for his purchases?
def solve() -> int: cookies = 6 crackers = 8 cookie_price = 2.50 cracker_price = cookie_price * 0.8 total_price = cookies * cookie_price + crackers * cracker_price result = total_price return result
In a classroom, there are 45 girls and 30 boys. The teacher made some new rules for the students. If 40% of the girls followed the rules and 60% of the boys didn't, how many students didn't follow the rules?
def solve() -> int: total_students = 75 girls_followed = 45 * 0.4 boys_not_followed = 30 * 0.6 students_not_followed = total_students - girls_followed - boys_not_followed result = students_not_followed return result
A TV costs 150 dollars. If the price rises by 20%, what will be the new price?
def solve() -> int: price = 150 percent_increase = 20 new_price = price + (percent_increase / 100) * price result = new_price return result
A classroom has 25 students. If the students can sit 2, 3, or 4 people to a table, how many tables are needed to seat all students if there can be no empty seats?
def solve() -> int: tables7 = 25 // 4 + (25 % 4) // 3 + ((25 % 4) % 3) // 2 result = tables7 return result
The librarian gives 3 book reports for not returning a book, 1 more than twice that number of reports for talking during silent reading time, and 1/2 the number of talking-reports for not following the library rules. If each book report takes 15 minutes to complete, how much time do the students spend writing book repo...
def solve() -> int: num_book_reports = 3 num_talking_reports = 1 + 2*num_book_reports num_rule_reports = 0.5*num_talking_reports total_reports = num_book_reports + num_talking_reports + num_rule_reports time_spent = total_reports * 15 result = time_spent return result
John needs to drive a total of 420 miles. His car has a fuel efficiency of 30 miles per gallon. If gas costs $2.60 per gallon, how much will John need to spend on gas for his trip?
def solve() -> int: total_miles = 420 miles_per_gallon = 30 gallons_needed = total_miles / miles_per_gallon cost_per_gallon = 2.6 total_cost = gallons_needed * cost_per_gallon result = total_cost return result
Delhi had 10 dollars on the first day of winter. In the next two days, they spent 4 dollars each day. On the third day, they found an old coin that was worth 5 times the amount of money they had on the first day. How many dollars do they have now?
def solve() -> int: dollars_on_first_day = 10 dollars_spent_per_day = 4 old_coin_value = dollars_on_first_day * 5 total_dollars_spent = dollars_spent_per_day * 2 total_dollars = dollars_on_first_day - total_dollars_spent + old_coin_value result = total_dollars return result
Student: A family is planning a road trip. They will need to drive 900 miles. The car they will be driving gets 30 miles per gallon, and gas is $3.50 per gallon. How much will they spend on gas for the trip?
def solve() -> int: miles = 900 mpg = 30 price_per_gallon = 3.50 gallons = miles / mpg total_cost = gallons * price_per_gallon result = total_cost return result
Natalie is given a commission of 5% for every vacuum she sells, and she gets a bonus of 100 dollars every time she sells 10 vacuums. If she sells 80 vacuums, what is her total commission including bonuses?
def solve() -> int: vacuums_sold = 80 commission_rate = 0.05 bonus_threshold = 10 bonus_amount = 100 commission = vacuums_sold * commission_rate bonuses_earned = vacuums_sold // bonus_threshold total_bonus = bonuses_earned * bonus_amount total_commission = commission ...
Michael has a music player with 8GB of storage. He has used 3GB. If a song takes up 3.5MB of storage, how many songs can Michael store on his player?
def solve() -> int: total_storage = 8 * 1024 used_storage = 3 * 1024 song_size = 3.5 available_storage = total_storage - used_storage num_songs = available_storage // song_size result = num_songs return result
Maria spent 2 hours doing 600 work tasks at $1.25 each. Then Maria spent 30 minutes doing 3 work tasks at $4.00 each. How much more did Maria make doing the high-paid work compared to the low-paid work?
def solve() -> int: hours_low_paid = 2 tasks_low_paid = 600 rate_low_paid = 1.25 hours_high_paid = 0.5 tasks_high_paid = 3 rate_high_paid = 4.00 total_low_paid = hours_low_paid * tasks_low_paid * rate_low_paid total_high_paid = hours_high_paid * tasks_high_paid * rate_high_paid...
There are 91 cards. Raul divides them into 7 piles and then each pile into 2 unequal piles. How many cards does each of the unequal pile have?
def solve() -> int: tot_cards = 91 num_piles = 7 piles_share = tot_cards // num_piles each_share = piles_share // 2 unequal_piles = tot_cards % 2 result = each_share + unequal_piles return result
There are 7 classrooms in a school and each classroom has 5 desks. Each desk has 4 legs and each leg has 1 screw. How many screws are in the school?
def solve() -> int: classrooms = 7 desks = 5 legs = 4 screws = 1 screws_per_leg = screws * 1 screws_per_desk = legs * screws_per_leg screws_per_classroom = desks * screws_per_desk total_screws = classrooms * screws_per_classroom result = total_screws ...
Brian is starting a new job and he wants to maximize his savings. His monthly salary is $3000. His monthly expenses are $1500. He wants to save 40% of his monthly salary. How much can he save each month?
def solve() -> int: monthly_salary = 3000 monthly_expenses = 1500 savings_percentage = 0.4 max_savings = ((monthly_salary - monthly_expenses) * savings_percentage) result = max_savings return result
If one bag of flour can make 30 pancakes, and gluten-free flour can only make two-thirds as many pancakes as regular flour, then how many pancakes can be made from 3/4 of a bag of a mixture of gluten-free and regular flour?
def solve() -> int: regular_flour_pancakes = 30 gluten_free_flour_pancakes = (2/3) * regular_flour_pancakes mixture_flour_pancakes = (3/4) * (regular_flour_pancakes + gluten_free_flour_pancakes) result = mixture_flour_pancakes return result
Lily is hosting a wine and cheese party. She has invited 20 guests, and she plans to serve three types of cheese and three types of crackers. If she uses a new plate for each type of cheese and crackers for each guest, how many plates will she need in total?
def solve() -> int: num_guests = 20 num_cheese = 3 num_crackers = 3 total_plates = num_cheese + num_crackers total_plates *= num_guests result = total_plates return result
Peter is baking 24 cupcakes for a party. He can only bake 6 cupcakes at a time because of his small muffin pan. If it takes 20 minutes to bake each batch, what is the latest time he can start baking to have all cupcakes ready by 3 pm?
def solve() -> int: total_cupcakes = 24 batch_size = 6 batch_time = 20 total_batches = total_cupcakes // batch_size + (total_cupcakes % batch_size > 0) total_time = total_batches * batch_time latest_start_time = 3 * 60 - total_time result = latest_start_time return result
If John is 5 years older than his sister Lisa, and the sum of their ages is 27, how old is Lisa?
def solve() -> int: john_age = 0 lisa_age = 0 lisa_age = (27 - 5) / 2 result = lisa_age return result
A pizza restaurant has 12 slices of pepperoni pizza and 14 slices of cheese pizza. If they sell 7 slices of pepperoni pizza and 8 slices of cheese pizza, how many slices are left?
def solve() -> int: pepperoni_slices = 12 cheese_slices = 14 pepperoni_sold = 7 cheese_sold = 8 remaining_pepperoni_slices = pepperoni_slices - pepperoni_sold remaining_cheese_slices = cheese_slices - cheese_sold total_slices_remaining = remaining_pepperoni_slices + remaining_cheese_slices ...
A jewelry store is offering a 30% discount on all items. Emma wants to buy a necklace that is worth $500. How much will she pay after the discount is applied?
def solve() -> int: original_price = 500 discount = 0.3 * original_price final_price = original_price - discount result = final_price return result
Timmy and Tommy are twins who like to play with cars. If Timmy has 10 cars, while Tommy has 4 less cars than Timmy. How many cars do they have together?
def solve() -> int: timmy = 10 tommy = timmy - 4 together = timmy + tommy result = together return result
Jessica has 30 balloons. Emma has 10 fewer balloons than Jessica, and Taylor has three times the number of balloons that Jessica has. How many balloons are there in total?
def solve() -> int: jessica_balloons = 30 emma_balloons = jessica_balloons - 10 taylor_balloons = 3 * jessica_balloons total_balloons = jessica_balloons + emma_balloons + taylor_balloons result = total_balloons return result
At a store, the original price of a pair of shoes is $80. The store is offering a discount of 25% on the original price. What is the new price of the shoes?
def solve() -> int: original_price = 80 discount = original_price*0.25 new_price = original_price - discount result = new_price return result
Maria wants to reduce her grocery bill by $15. For every coupon she uses, she can reduce her bill by $0.50. If a coupon booklet costs $3 and contains 10 coupons, how much would it cost Maria to reach her goal?
def solve() -> int: coupon_booklet_cost = 3 num_coupons_in_booklet = 10 coupon_savings_per_coupon = 0.50 goal_savings = 15 total_savings = coupon_savings_per_coupon * (goal_savings / coupon_savings_per_coupon) num_coupons_needed = total_savings / coupon_savings_per_coupon num_booklets_n...
In a car dealership, there are 200 vehicles. 120 of them are SUVs. The rest are either sedans or trucks. The number of sedans is equal to the number of trucks. How many trucks are there in the car dealership?
def solve() -> int: vehicles = 200 suv = 120 sedans = vehicles - suv trucks = sedans / 2 result = trucks return result
A shopkeeper sells 200 items every day. If 50 items are returned and cannot be resold each day, how many items are left after 10 days if 1500 items were on the shelves at the beginning?
def solve() -> int: items_sold_per_day = 200 items_returned_per_day = 50 total_items_on_shelves = 1500 items_sold = items_sold_per_day * 10 items_returned = items_returned_per_day * 10 items_left = total_items_on_shelves - items_sold + items_returned result = items_left re...
Student: If Tom swims 500 meters in 5 minutes, what is his average speed in meters per second?
def solve() -> int: distance = 500 time = 5 time_in_seconds = time * 60 average_speed = distance / time_in_seconds result = average_speed return result
A swimmer swims for 2 hours every day for a month (30 days). If he continues to swim for the next 6 days, how many hours will he have swum in total?
def solve() -> int: swim_time_per_day = 2 days_in_month = 30 extra_days = 6 total_swim_time = swim_time_per_day * days_in_month + swim_time_per_day * extra_days result = total_swim_time return result
am's family has seven members. On average, they eat a total of 63 slices of pizza a week. The first member eats an average of 3 slices a day. How many slices a day do the other six members eat on average?
def solve() -> int: member_1_slices_per_day = 3 total_slices_per_week = 63 member_2_slices_per_day = total_slices_per_week - (7*member_1_slices_per_day) member_2_literal_average_per_day = member_2_slices_per_day / 6 result = member_2_literal_average_per_day return result
Possible additional questions are: Sara is a florist who buys roses for $5 per dozen and sells them for $1.5 each. She also buys orchids for $2 each and sells them for $4 each. Every week, she buys 10 dozen roses and 50 orchids and pays a rent of $200. How much does she earn every week after paying the rent and buying ...
def solve() -> int: cost_roses = 10 * 5 cost_orchids = 50 * 2 total_cost = cost_roses + cost_orchids revenue_roses = 10 * 12 * 1.5 revenue_orchids = 50 * 4 total_revenue = revenue_roses + revenue_orchids profit = total_revenue - total_cost - 200 result = profit return result
Three cousins went to a water park and paid $60 for entrance fees, rented three beach chairs that cost $10 each, and ordered a bucket of ice cream that cost $25. If they split the cost evenly, how much will each of them pay?
def solve() -> int: entrance_fee = 60 beach_chair_cost = 10 ice_cream_cost = 25 total_cost = entrance_fee + (3 * beach_chair_cost) + ice_cream_cost each_pay = total_cost / 3 result = each_pay return result
A recipe calls for 2 1/2 cups of flour and 3/4 cups of sugar. If you want to make half of the recipe, how much flour and sugar do you need?
def solve() -> int: half_flour = 2.5 / 2 half_sugar = 0.75 / 2 result = (half_flour, half_sugar) return result
Alexa saved 40 dollars in 8 weeks for a concert. How much money did she save in total?
def solve() -> int: weeks = 8 saved_per_week = 40/weeks total_saved = saved_per_week * 52 result = total_saved return result
Student: While traveling by boat, Leah can cover a distance of 36 miles in 2 hours. At the same rate of speed, how far will she be from her starting point if she travels for 4 hours?
def solve() -> int: distance_per_hour = 36 / 2 total_hours = 4 total_distance = distance_per_hour * total_hours result = total_distance return result
A rectangular movie screen has an area of 800 square feet. Its length is 40 feet. What is its width?
def solve() -> int: area = 800 length = 40 width = area/length result = width return result
At a hardware store, screws are sold in packs of 50 for $2.75 and nails are sold in packs of 100 for $7.25. If John buys 3 packs of screws and 2 packs of nails, how much does he spend?
def solve() -> int: num_screw_packs = 3 num_nail_packs = 2 cost_screw_packs = num_screw_packs*(2.75*50) cost_nail_packs = num_nail_packs*(7.25*100) total_cost = cost_screw_packs + cost_nail_packs result = total_cost return result
Anne collects coins. She has 15 2 pence coins, 10 10 pence coins and 6 20 pence coins. How much money does Anne have in total?
def solve() -> int: two_pence = 15 ten_pence = 10 twenty_pence = 6 total = (two_pence*2) + (ten_pence*10) + (twenty_pence*20) result = total return result
Tom wants to paint his room. He can paint 7 sq. feet/minute. One wall takes 120 sq. feet to be painted, the ceiling takes 200 sq. feet, and the floor takes 100 sq. feet. If Tom wants to paint all four walls, the ceiling, and the floor of his room, how many minutes does he need to spend painting?
def solve() -> int: wall_area = 120 ceiling_area = 200 floor_area = 100 total_area = 4 * wall_area + ceiling_area + floor_area painting_speed = 7 time_needed = total_area / painting_speed result = time_needed return result
Anne and her brother have a combined total of 48 toy cars. If Anne has 3 times as many as her brother, how many cars does each one have?
def solve() -> int: n_cars = 48 n_anna_cars = n_cars * 3 / 4 n_brother_cars = n_cars * 1 / 4 result = (n_anna_cars, n_brother_cars) return result
If it takes Rachel 30 seconds to solve a math problem, and it takes Henry 35 seconds to solve the same problem, while Laura and Nicole each take 40 seconds. How long, on average, does it take to solve the math problem?
def solve() -> int: rachel_time = 30 henry_time = 35 laura_time = 40 nicole_time = 40 total_time = rachel_time + henry_time + laura_time + nicole_time average_time = total_time / 4 result = average_time return result
A company has a budget of $5000. If they spend $3750, what percentage of the budget do they still have left?
def solve() -> int: budget = 5000 spend = 3750 remaining_budget = budget - spend percentage_remaining_budget = (remaining_budget/budget) * 100 result = percentage_remaining_budget return result
Kim wants to buy a new bicycle. She plans to spend one week's salary on the bike. She makes $300 per week and can save $25 per week. How many weeks will it take before she can buy the bike?
def solve() -> int: salary_per_week = 300 savings_per_week = 25 total_savings = 0 weeks = 0 while total_savings < salary_per_week: total_savings += savings_per_week weeks += 1 result = weeks return result
At a store, jeans cost $35, and the store offers a 15% discount. How much will it cost for 3 jeans after the store's discount?
def solve() -> int: cost_jeans = 35 discount = 15 no_of_jeans = 3 discount_amount = cost_jeans * (discount/100) final_cost = (cost_jeans * no_of_jeans) - discount_amount result = final_cost return result
Michael and Matthew ran a total of 16 miles. If Michael ran 2 more than 5 times the amount of miles that Matthew ran, how many miles did Michael run?
def solve() -> int: miles_matthew = 16 / 6 miles_michael = 5 * miles_matthew + 2 result = miles_michael return result
A small fountain requires 4.5 gallons of water per minute. If the fountain runs for 3 hours and 15 minutes, how many gallons of water does it use?
def solve() -> int: gallons_per_minute = 4.5 total_minutes = (3 * 60) + 15 total_gallons = gallons_per_minute * total_minutes result = total_gallons return result
A library has books in 5 different categories, with 30 books in each category. If 20% of the books are checked out, how many books are available?
def solve() -> int: total_books = 5 * 30 checked_out_rate = 0.2 checked_out_books = total_books * checked_out_rate available_books = total_books - checked_out_books result = available_books return result
A rectangular box has a length of 10cm, width of 8cm and height of 6cm. What is its total surface area?
def solve() -> int: total_surface_area = 2*(10*8 + 8*6 + 10*6) result = total_surface_area return result
A rectangle has a length of 10cm and a width of 5cm. What is the area of the rectangle?
def solve() -> int: rectangle_length = 10 rectangle_width = 5 rectangle_area = rectangle_length * rectangle_width result = rectangle_area return result
A rectangular field has a length of 50 feet and a width of 30 feet. What is the area of the field in square feet?
def solve() -> int: length = 50 width = 30 area = length * width result = area return result
**** Brian has 13 pears. Mike has 10 more pears than Brian. Larry has one-third as many pears as Mike while Laura has one-half as many pears as Larry. How many pears do they have in total?
def solve() -> int: result = 82 x = 13 y = x + 10 z = y/3 result = x + (x + 10 + (x + 10)/3 + ((x + 10)/3)/2) return result
A car has 12 gallons of gas in its tank. It can travel 22 miles per gallon. How many miles can it travel before it runs out of gas?
def solve() -> int: gas_in_tank = 12 miles_per_gallon = 22 total_miles_that_can_be_travelled = gas_in_tank * miles_per_gallon result = total_miles_that_can_be_travelled return result
Hank drinks 10 cups of coffee on Monday and double the quantity on Tuesday. On Wednesday, he drinks half the amount he had on Monday. How many cups of coffee did Hank drink in total over the three days?
def solve() -> int: monday_cups = 10 tuesday_cups = monday_cups * 2 wednesday_cups = monday_cups / 2 total_cups = monday_cups + tuesday_cups + wednesday_cups result = total_cups return result
Alex received $2000 as a gift from his parents. He spent 25% of it on buying a new guitar and another 35% on books for his college. If he still has $700 left, how much did he spend on the guitar?
def solve() -> int: gift_money = 2000 guitar_cost = gift_money * 0.25 books_cost = gift_money * 0.35 total_spent = guitar_cost + books_cost remaining_money = gift_money - total_spent guitar_spent = guitar_cost - (gift_money - remaining_money - 700) result = guitar_spent return ...
The first and second angles of a triangle are in a ratio of 1:2. What is the value of the third angle if the sum of all the angles is 180 degrees?
def solve() -> int: total_sum = 180 angle1_ratio = 1 angle2_ratio = 2 angle3_ratio = total_sum - angle1_ratio - angle2_ratio result = angle3_ratio return result
A triangle has a base of 12cm and a height of 8cm. What is its area in cm^2?
def solve() -> int: base = 12 height = 8 area = 0.5 * base * height result = area return result
A rectangular sheet of paper has a length of 8 inches and a width of 5 inches. If you fold the paper in half along the longer side, what are the dimensions of the resulting rectangle?
def solve() -> int: original_length = 8 original_width = 5 new_length = original_length / 2 new_width = original_width result = (new_length, new_width) return result
Possible math questions and programs: Angela had $20.00 to spend at the bookstore. She bought 3 books that cost $4.25 each and a bookmark that cost $1.50. How much money does Angela have left to buy more books?
def solve() -> int: total = 20.00 book_cost = 4.25 bookmark_cost = 1.50 total_cost = 3 * book_cost + bookmark_cost remaining = total - total_cost result = remaining return result
A fast-food chain sells burgers for $4 each, fries for $2 each, and drinks for $1 each. A customer bought 3 burgers, 2 fries, and 1 drink. How much did the customer pay?
def solve() -> int: burger_cost = 4*3 fries_cost = 2*2 drink_cost = 1*1 total_cost = burger_cost + fries_cost + drink_cost result = total_cost return result
Mike is working in a hotel and has to clean 9 rooms, 1 gym, and 2 lobbies. Each room takes 15 minutes to clean, the gym takes as long as 3 rooms combined, and each lobby takes 20 minutes to clean. Mike splits the work with his coworkers who are equally efficient as him. How long, in hours, will they work to clean every...
def solve() -> int: rooms = 9 gym = 1 lobbies = 2 room_time = 15 gym_time = room_time * 3 lobby_time = 20 total_time = (rooms * room_time + gym * gym_time + lobbies * lobby_time) / 2 / 60 result = total_time return result
There are 150 roses in a garden. 60 percent of the roses are red, how many roses are not red?
def solve() -> int: total_roses = 150 red_roses = total_roses * 0.6 not_red_roses = total_roses - red_roses result = not_red_roses return result
A grocery store owner has two suppliers for potatoes. From the first supplier, he buys potatoes at $0.50 per pound, and from the second supplier, he can buy potatoes for $0.60 per pound. Today, he needs to purchase 200 lb potatoes to meet the day's demand. If he purchased 120 lb of potatoes from the first supplier and ...
def solve() -> int: first_supplier_potato_price = 0.50 second_supplier_potato_price = 0.60 total_potato_quantity = 200 first_supplier_potato_quantity = 120 second_supplier_potato_quantity = total_potato_quantity - first_supplier_potato_quantity total_payment = (first_supplier_potato_pr...