question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A recipe requires 3/4 cup of sugar to make 12 cookies. How many cups of sugar are needed to make 24 cookies?
def solve() -> int: cookies = 24 sugar = (cookies / 12) * (3/4) result = sugar return result
Harry and Meghan are inviting couples to their wedding reception. Of the 150 guests they are expecting, 40 percent of them are couples. How many couples are they expecting?
def solve() -> int: total_guest = 150 couple_guest_percent = 0.4 couple_guest = total_guest * couple_guest_percent result = couple_guest return result
Hairu had 20 boxes of strawberries. He ate 2 boxes and gave 12 away. If he ate 25% of the remaining boxes, how many boxes does he now have?
def solve() -> int: total_boxes = 20 boxes_eaten = 2 boxes_gave_away = 12 remaining_boxes = total_boxes - (boxes_eaten + boxes_gave_away) box_eaten_after = remaining_boxes * 0.25 result = remaining_boxes - box_eaten_after return result
Justin has 86 plates of 3 colors. He gave away twice as many green plates than blue plates, and one third of his plates in total. How many plates of each color did he give away?
def solve() -> int: total_plates = 86 green_plates = 0.5*total_plates blue_plates = 0.25*total_plates plates_given_away = (1/3)*total_plates green_plates_given_away = (2/3)*plates_given_away blue_plates_given_away = (1/3)*plates_given_away result = green_plates_given_away, blue_plates_gi...
Do not write anything else other than the question and the program. Possible questions and programs are: A pair of earrings costs three times as much as a bracelet, and a necklace costs twice as much as a pair of earrings. If a bracelet costs $5, how much do 2 pairs of earrings, 1 bracelet, and 1 necklace cost together...
def solve() -> int: earring_price = 3 * 5 necklace_price = 2 * earring_price total_cost = 2 * earring_price + 1 * 5 + 1 * necklace_price result = total_cost return result
A car rental company offers a base rate of $50 per day and $0.20 per mile. If John rented a car and drove 100 miles in 2 days, how much will he have to pay?
def solve() -> int: base_rate = 50 per_mile_rate = 0.20 miles_driven = 100 days_rented = 2 total_rental_cost = (base_rate * days_rented) + (per_mile_rate * miles_driven) result = total_rental_cost return result
A hotel room costs $80 per night. If you stay for 5 nights, how much will it cost?
def solve() -> int: cost_per_night = 80 nights = 5 total_cost = cost_per_night * nights result = total_cost return result
A lamp costs $30 less than a chair. If a chair costs $50, find the total cost of both items.
def solve() -> int: chair_cost = 50 lamp_cost = chair_cost - 30 total_cost = chair_cost + lamp_cost result = total_cost return result
Matthew needs to go 15 miles by car. He can go 10 mph for one hour before taking breaks, and he can go 5 mph during the breaks until he gets to his destination. How long will it take Matthew to get to his destination?
def solve() -> int: time1 = 60 speed1 = 10 distance1 = 15 * (speed1 * (time1/60)) time2 = (15 - (speed1 * time1/60)) / 5 result = time1 + time2 return result
ally ordered a pizza that was divided into 4 equal slices. She ate 2 slices. What fraction of the pizza did Sally eat?
def solve() -> int: total_slices = 4 slices_eaten = 2 fraction_eaten = slices_eaten/total_slices result = fraction_eaten return result
Student: Joe has 30 marbles, if he gives away 22 marbles, how many marbles does he have left?
def solve() -> int: marbles = 30 marbles = marbles - 22 result = marbles return result
A museum exhibit features sculptures made by 12 artists. If each artist contributes 6 sculptures, how many sculptures are in the exhibit in total?
def solve() -> int: artists = 12 sculptures_per_artist = 6 total_sculptures = artists * sculptures_per_artist result = total_sculptures return result
The cost of three notebooks and two pencils is Kshs. 372 while the cost of three pencils and from notebooks is Kshs. 342. Determine the cost of one notebook and cost for one pencil.
def solve() -> int: total_1 = 372 total_2 = 342 notebook_cost = (total_1 - 2 * total_2)/6 pencil_cost = (total_2 - 3 * notebook_cost) / 3 result = notebook_cost, pencil_cost return result
A group of friends decides to order pizza for their movie night. There are 12 people in the group and each pizza has 8 slices. If each person eats 3 slices on average, how many pizzas do they need to order?
def solve() -> int: people = 12 slices = 8 slices_per_person = 3 total_slices = people * slices_per_person pizzas = (total_slices + slices - 1) // slices result = pizzas return result
A company discovered that 15% of their total expenditure goes to salaries. If the company’s expenses amounted to $200,000, how much of it went to salaries?
def solve() -> int: total_expenditure = 200000 salary_percentage = 0.15 salary_amount = total_expenditure * salary_percentage result = salary_amount return result
There is a crate of 100 oranges. If 4 oranges are packed into a bag, how many bags are needed to pack all of the oranges?
def solve() -> int: oranges = 100 oranges_per_bag = 4 bags = oranges // oranges_per_bag result = bags return result
Rahul had 40 pens. He gives away 4/5 of them to his friends. The following day, he borrows 10 from his sister and the next day, he loses half of that number. How many pens does he have now?
def solve() -> int: pens = 40 given_away = pens * 4/5 remaining = pens - given_away borrowed = 10 lost = borrowed / 2 total = remaining + borrowed - lost result = total return result
New drivers haveAva is trying to consume no more than 2200 calories a day. If she has already eaten 600 calories for breakfast, 800 calories for lunch, and 1100 calories for dinner, how many more calories can she eat for today to stay within her limit?
def solve() -> int: breakfast_calories = 600 lunch_calories = 800 dinner_calories = 1100 total_calories_eaten = breakfast_calories + lunch_calories + dinner_calories calories_limit = 2200 remaining_calories = calories_limit - total_calories_eaten result = remaining_calories return result...
Jim was reading a book and came across 55 words on a page. He divided the words equally among 3 piles, with 12 words remaining. How many words were in each pile?
def solve() -> int: words_per_pile = (55 - 12) / 3 result = words_per_pile return result
At a birthday party, there are five cupcakes on each tray. If six children each eat three-quarters of the cupcakes on their respective trays, how many cupcakes are remaining on average?
def solve() -> int: trays = 6 cupcakes_per_tray = 5 children = 6 cupcakes_eaten = (3/4) * cupcakes_per_tray * children cupcakes_remaining = trays * cupcakes_per_tray - cupcakes_eaten average_cupcakes_remaining = cupcakes_remaining / trays result = average_cupcakes_remaining return result...
Mark has 8 books and Greg has 3 times as many books as Mark. How many books does Greg have?
def solve() -> int: mark_books = 8 number_times_of_mark_books = mark_books * 3 greg_books = number_times_of_mark_books result = greg_books return result
Liam measures the diameter of his pizza. The diameter of Mia's pizza is half the size of Liam's and the diameter of Noah's pizza is 3 times the size of Mia's. If Noah's pizza has a diameter of 36 inches, what is the diameter of Liam's pizza, in inches?
def solve() -> int: diameter_noah = 36 diameter_mia = diameter_noah / 3 diameter_liam = diameter_mia * 2 result = diameter_liam return result
Student: Jenny wants to make 9 chocolate cakes for a birthday party. Each cake needs 300 grams of flour, 200 grams of sugar, 150 grams of butter, and 100 grams of chocolate. She already has 2.5 kilograms of flour, 1.8 kilograms of sugar, 1.2 kilograms of butter, and 600 grams of chocolate in her pantry. How many more g...
def solve() -> int: flour_needed = 9 * 300 sugar_needed = 9 * 200 butter_needed = 9 * 150 chocolate_needed = 9 * 100 flour_in_pantry = 2.5 * 1000 sugar_in_pantry = 1.8 * 1000 butter_in_pantry = 1.2 * 1000 chocolate_in_pantry = 600 flour_to_buy = flour_needed - flour_in_pantry...
A cylinder has a radius of 6 cm and a height of 10 cm. What is the volume of the cylinder?
def solve() -> int: pi = 3.14 radius = 6 height = 10 volume = pi*(radius**2)*height result = volume return result
Hannah needs to score 75 points to pass the exams. She got 20 points for each of the three exams but lost 10 points for not following papers guidelines. How many more points can she lose and still be able to pass the exams?
def solve() -> int: score = 75 points_exam1 = 20 points_exam2 = 20 points_exam3 = 20 points_penalty = 10 result = score - (points_exam1 + points_exam2 + points_exam3 + points_penalty) return result
The local gym has a membership fee of $100 per month. They are running a special offer and offering 15% off their regular rate. Kevin wants to join with his spouse. How much will they pay for 6 months of membership after the discount?
def solve() -> int: regular_rate = 100 discount_rate = 0.15 discounted_rate = regular_rate * (1 - discount_rate) membership_duration = 6 total_cost = discounted_rate * 2 * membership_duration result = total_cost return result
Student: Maria bought 8 apples, 10 bananas and 4 oranges at the grocery store. The apples were sold for $2 each, the bananas were sold for $1 each, and the oranges were sold for 50 cents each. How much did she pay in total?
def solve() -> int: num_apples = 8 num_bananas = 10 num_oranges = 4 price_apple = 2 price_banana = 1 price_orange = 0.5 total_cost_apples = num_apples * price_apple total_cost_bananas = num_bananas * price_banana total_cost_oranges = num_oranges * price_orange total_cost = total_...
A grocery store sold 120 apples in the morning and 150 apples in the afternoon. If there were 50 apples left at the end of the day, how many apples were there at the start of the day?
def solve() -> int: apples_morning = 120 apples_afternoon = 150 apples_left = 50 apples_start = apples_morning + apples_afternoon + apples_left result = apples_start return result
ara has to read 280 pages of a book in a week. How many pages does she need to read in a day, if she reads the same amount each day?
def solve() -> int: pages_to_read = 280 days = 7 pages_per_day = pages_to_read / days result = pages_per_day return result
Alex has 9 marbles. His friend owns various types of marbles, which are three times as many as Alex's. He has 3 big marbles, 4 small marbles, and the rest are medium-sized marbles. How many medium-sized marbles does Alex's friend own?
def solve() -> int: alex_marbles = 9 friend_marbles = 3 * alex_marbles big_marbles = 3 small_marbles = 4 medium_marbles = friend_marbles - big_marbles - small_marbles - alex_marbles result = medium_marbles return result
A bakery sells 2 cakes every hour for 9 hours. If each cake has 12 slices, and each person eats 2 slices, how many slices are leftovers at the end of the day?
def solve() -> int: num_cakes = 2 hours = 9 cake_slices = 12 per_person_slices = 2 total_cakes = num_cakes * hours total_slices = total_cakes * cake_slices total_people = total_slices // per_person_slices leftovers = total_slices - (total_people * per_person_slices) result = leftover...
John has a total of 50 coins in his pocket, consisting of pennies, dimes, and quarters. If the total value of the coins is $5.15, how many dimes are in his pocket?
def solve() -> int: pennies = 0 dimes = 0 quarters = 0 total_value = 5.15 total_coins = 50 total_value_eq = (0.01 * pennies) + (0.10 * dimes) + (0.25 * quarters) total_coins_eq = pennies + dimes + quarters dimes_eq = total_coins_eq - pennies - quarters ...
A soccer team won a total of 18 games in a season. The first player scored 1/3 of the team's total goals, the second player scored twice as much as the first, and the third player scored 6 goals. How many goals did the first player score?
def solve() -> int: total_games = 18 third_player_goals = 6 second_player_goals = 2 * (total_games - third_player_goals) / 3 first_player_goals = (total_games - third_player_goals - second_player_goals) result = first_player_goals return result
Olivia, William, and James collect baseball cards. Olivia has five times as many baseball cards as William, but William has four times as many baseball cards as James. If James currently has 30 baseball cards in his collection, how many baseball cards does Olivia need to add to her collection to have a collection as la...
def solve() -> int: james_cards = 30 william_cards = 4 * james_cards olivia_cards = 5 * william_cards cards_needed = william_cards - olivia_cards result = cards_needed return result
William runs a sports store selling basketballs for $25, soccer balls for $20, and volleyballs for $15. By the end of the day, William earned $495 from selling sports balls. He recalls selling $60 worth of soccer balls and $105 worth of volleyballs. How much did he earn from selling basketballs?
def solve() -> int: basketball_price = 25 soccerball_price = 20 volleyball_price = 15 total_earned = 495 soccerball_earned = 60 volleyball_earned = 105 basketball_earned = total_earned - soccerball_earned - volleyball_earned result = basketball_earned return result
Lucy collects stickers. She has 120 stickers at the beginning of the month. She earns 5 stickers for each chore she does and spends 10 stickers for each treat she buys. She does 20 chores and buys 8 treats in the month. How many stickers does she have at the end of the month?
def solve() -> int: stickers = 120 chores = 20 treats = 8 earn = 5 spend = 10 change = chores * earn - treats * spend stickers = stickers + change result = stickers return result
Lila works at a restaurant. She works 8 hours on weekdays and 6 hours on weekends. She earns $11 per hour. If she works 5 days and 2 weekends in a week, how much will she earn that week?
def solve() -> int: hours_per_weekday = 8 hours_per_weekend = 6 hourly_rate = 11 days_per_week = 5 weekends_per_week = 2 total_weekday_hours = hours_per_weekday * days_per_week total_weekend_hours = hours_per_weekend * weekends_per_week total_hours_worked = total_weekday_hours ...
A total of 200 candies are distributed evenly among 10 children. How many candies does each child get?
def solve() -> int: total_candies = 200 number_of_children = 10 candies_per_child = total_candies / number_of_children result = candies_per_child return result
A gym trainer had 30 sets of dumbbells. At the end of the day, they realized that they were only left with 20 sets. 4 sets of dumbbells were broken and needed to be removed from the gym floor. How many sets of dumbbells were used by the gym members that day?
def solve() -> int: total_sets = 30 left_sets = 20 broken_sets = 4 used_sets = total_sets - left_sets - broken_sets result = used_sets return result
Carrie has $50. The candy store sells lollipops for $0.25 each and chocolate bars for $1.50 each. Carrie buys 12 lollipops and 6 chocolate bars. How much money, in dollars, does she have left?
def solve() -> int: money = 50 lollipop_price = 0.25 chocolate_bar_price = 1.5 total_cost = lollipop_price * 12 + chocolate_bar_price * 6 money_left = money - total_cost result = money_left return result
There were 300 people in a park. 1/4 of them were children, 1/2 of them were women and the rest were men. How many men were there in the park?
def solve() -> int: total = 300 children = total * 0.25 women = total * 0.5 men = total - children - women result = men return result
Anna has a bucket of water that can hold 15 liters. She fills the bucket to the brim and then pours 2 liters into a smaller container. She then adds some sand to the bucket, which makes the water level rise by 10%. How much sand did Anna add to the bucket?
def solve() -> int: water_left = 15 - 2 new_water_level = water_left * 1.1 sand_added = new_water_level - 15 result = sand_added return result
A pizza has 8 slices. If 3 friends each eat 2 slices of pizza, how many slices are left?
def solve() -> int: friends = 3 slices_per_friend = 2 slices_total = 8 slices_left = slices_total - (friends * slices_per_friend) result = slices_left return result
Mina wants to buy new furniture for the bedroom. The table costs 200 dollars, the chairs cost 35 each and the bed costs 600 dollars. How much money does Mina need to buy all the items?
def solve() -> int: furniture_total = 200 + 35 * 4 + 600 result = furniture_total return result
A store has 99 shelves filled with books. 64 are full of children story books, how many are filled with other types of books?
def solve() -> int: shelf_count = { 'children': 64, 'others': 0 } total_shelves = 99 shelf_count['others'] = total_shelves - shelf_count['children'] result = shelf_count['others'] return result
6. At a market, a dozen eggs costs $3 while a pound of cheese costs $4.25. If a family had $25 to spend and wanted to buy as many items as possible, how many eggs and cheeses could they buy?
def solve() -> int: dozen_eggs = 3 pound_cheese = 4.25 total_cost = 25 max_dozen_eggs = total_cost // dozen_eggs max_pound_cheese = total_cost // pound_cheese eggs_cost = max_dozen_eggs * dozen_eggs cheese_cost = max_pound_cheese * pound_cheese remaining_cost = total_cost ...
Mrs. Chong bought 8 items, a pair of sneakers, 2 shorts and 5 socks. The sneakers and 2 shorts cost $134, and the sneakers, 5 socks cost $270. The 5 socks cost $20 more than the sneakers and 2 shorts. How much did Mrs. Chong pay for one of the socks?
def solve() -> int: sneakers_shorts = 134 all_items = 270 socks_price = all_items - sneakers_shorts sock = socks_price/5 result = sock return result
A pizza has 8 slices. Leo eats 2 slices and shares the rest with his 3 friends equally. How many slices does each friend get?
def solve() -> int: slices = 8 slices = slices - 2 slices_per_friend = slices / 3 result = slices_per_friend return result
In a bookstore, paperbacks cost $8 each, hardcovers cost $12 each, and magazines cost $4 each. If John buys 2 paperbacks, 3 hardcovers, and 5 magazines, how much will he spend?
def solve() -> int: paperback_cost = 8 hardcover_cost = 12 magazine_cost = 4 num_paperbacks = 2 num_hardcovers = 3 num_magazines = 5 total_paperback_cost = paperback_cost * num_paperbacks total_hardcover_cost = hardcover_cost * num_hardcovers total_magazine_cost = magazine_...
A bag contains 30 marbles, 10 of which are red and 20 of which are blue. What is the probability of drawing a red marble from the bag?
def solve() -> int: total_marbles = 30 red_marbles = 10 probability = red_marbles/total_marbles result = probability return result
Ryan spent 5 hours doing 1000 work tasks at $0.20 each. Then Ryan spent 15 minutes doing 3 work tasks at $10.00 each. How much more did Ryan make doing the higher-paid work compared to the lower-paid work?
def solve() -> int: hours_low_paid = 5 tasks_low_paid = 1000 rate_low_paid = 0.20 hours_high_paid = 15/60 tasks_high_paid = 3 rate_high_paid = 10.00 total_low_paid = hours_low_paid * tasks_low_paid * rate_low_paid total_high_paid = hours_high_paid * tasks_high_paid * rate_high_...
Mia reads every night. She reads 20 pages per hour. If she reads for 2 hours every night, how many pages can she read in a month? Assume that a month has 30 days.
def solve() -> int: read_rate = 20 read_time = 2 days_per_month = 30 pages_read = read_rate * read_time * days_per_month result = pages_read return result
In a dance competition, there are 25 pairs of contestants. If each pair must consist of one male and one female, how many female contestants will be left without a partner?
def solve() -> int: num_pairs = 25 num_females = num_pairs num_males = num_pairs total_contestants = num_females + num_males num_female_pairs = num_pairs num_female_without_partner = num_females - num_female_pairs result = num_female_without_partner return result
Student: Melissa walks at a rate of 2 km/h and runs at a rate of 8 km/h. If she walks for 9 minutes and runs for 7 minutes, how far did she travel?
def solve() -> int: walk_rate = 2 run_rate = 8 walk_time = 9 run_time = 7 walk_time_hr = walk_time / 60 run_time_hr = run_time / 60 walk_distance = walk_rate * walk_time_hr run_distance = run_rate * run_time_hr result = walk_distance + run_distance return result
At Tom's burger joint, he has burgers with 2 patties and sliders with 1 patty. If he sells 15 sliders and 20 burgers, how many patties does Tom need to use?
def solve() -> int: sliders = 15 burgers = 20 slider_patties = 1 burger_patties = 2 total_patties = sliders * slider_patties + burgers * burger_patties result = total_patties return result
Rachel works at a travel agency for $16/hour. She gets a commission of 5% on every sale. In one month, she made 15 sales, and every sale was $1000. If Rachel worked overtime for 10 hours, how much did she earn in that month?
def solve() -> int: hourly_pay = 16 commission_rate = 0.05 sales_made = 15 sale_amount = 1000 overtime_hours = 10 regular_hours = 160 regular_pay = hourly_pay * regular_hours overtime_pay = hourly_pay * 1.5 * overtime_hours total_commission = commission_rate * sale_amount * sales_mad...
My pencil case weighs 300 grams when empty. If I add 5 grams worth of pencils every day and I always refill it every 7 days, how much will it weigh if there are still 2 grams worth of pencils left when I refill it?
def solve() -> int: empty_weight = 300 daily_pencil_weight = 5 refill_interval = 7 remaining_pencil_weight = 2 total_pencil_weight = (refill_interval - 1) * daily_pencil_weight final_weight = empty_weight + total_pencil_weight + remaining_pencil_weight result = final_weight ...
Emma started with 30 paper clips. She gave 10 to her co-worker and then received 12 more from her boss. However, she accidentally dropped 3 of them on the floor and could not find them. How many paper clips does Emma have now?
def solve() -> int: paper_clips = 30 paper_clips -= 10 paper_clips += 12 paper_clips -= 3 result = paper_clips return result
Lily owns a bakery that supplies cakes to nearby cafes. The first cafe needs 2 cakes, the second cafe needs 3 cakes, and the third cafe needs 6 cakes per week. How many cakes does she need to supply for all cafes in 10 days?
def solve() -> int: cafe1_cakes_per_week = 2 cafe2_cakes_per_week = 3 cafe3_cakes_per_week = 6 total_cakes_per_week = cafe1_cakes_per_week + cafe2_cakes_per_week + cafe3_cakes_per_week cakes_per_day = total_cakes_per_week / 7 cakes_per_10_days = cakes_per_day * 10 result ...
Sarah and her family are planning a road trip. They will travel a total of 300 miles and each person will take turns driving equal distances. So far, they have completed 4 shifts with each shift covering the same distance. In the fifth shift, Sarah's mom unexpectedly gets car sick and cannot continue driving. How many ...
def solve() -> int: total_distance = 300 completed_shifts = 4 remaining_shifts = 5 - completed_shifts distance_per_shift = total_distance / completed_shifts remaining_distance = total_distance - (distance_per_shift * completed_shifts) distance_per_shift_before_sick = remaining_distance...
A car travels 30 miles per gallon of gasoline. If the gasoline costs $4 per gallon, how much will it cost to drive the car for 200 miles?
def solve() -> int: miles_per_gallon = 30 miles_to_drive = 200 gallons_needed = miles_to_drive / miles_per_gallon cost_per_gallon = 4 total_cost = gallons_needed * cost_per_gallon result = total_cost return result
Lucy has a bag of candies that weighs 300 grams. She eats 10% of them and gives 25% of them to her friend. She then buys another bag of candies that weighs 200 grams. How much does she have in total?
def solve() -> int: bag1 = 300 eat = 0.1 give = 0.25 bag2 = 200 left = bag1 * (1 - eat - give) total = left + bag2 result = total return result
Possible questions and programs: Simon's height increased by 3 cm in the past year. He is now 157 cm tall. How tall was he a year ago?
def solve() -> int: height_last_year = 0 height_now = height_last_year + 3 height_last_year = 157 - 3 result = height_last_year return result
A container has 1 liter of water. If it is poured equally into 5 smaller containers, how much water will each container have?
def solve() -> int: original_volume = 1 num_containers = 5 each_volume = original_volume / num_containers result = f'<<<{each_volume}>>>' result = each_volume return result
Student: Kelly is making a quilt with different colored squares. She wants to use 5 red squares, 4 blue squares, and 3 green squares for every 12 white squares. If she has 60 red squares, 48 blue squares, 36 green squares, and 144 white squares, how many quilts can she make with these squares?
def solve() -> int: red_squares = 60 blue_squares = 48 green_squares = 36 white_squares = 144 quilts = min(red_squares // 5, blue_squares // 4, green_squares // 3, white_squares // 12) result = quilts return result
Marco has 1089 coins, half of them are pennies and the rest are nickles. How many nickles does Marco have?
def solve() -> int: num_pennies = 1089/2 num_nickles = 1089 - num_pennies result = num_nickles return result
9 siblings decided to go out for dinner at a fancy restaurant. The total cost of the dinner was $630, including a 15% service charge. They decided to share the bill equally, but 3 siblings left early and didn't pay their share. How much extra does each sibling now have to pay?
def solve() -> int: total_cost = 630 num_of_siblings = 9 service_charge_percent = 15 service_charge_amount = (service_charge_percent/100)*total_cost bill_without_service_charge = total_cost-service_charge_amount cost_per_sibling = bill_without_service_charge/num_of_siblings num_of_siblings_l...
Jack loves to play video games and earns 20 dollars every time he wins a competition. He wants to buy a new game that costs 100 dollars. After 4 competitions, he saved up 80 dollars. What is the minimum number of additional competitions Jack needs to win to afford the game?
def solve() -> int: competitions_won = 4 money_saved = 80 game_cost = 100 additional_competitions_needed = (game_cost - money_saved) / 20 additional_competitions_needed = int(additional_competitions_needed) + 1 result = additional_competitions_needed return result
Possible questions and programs: A car can travel 60 miles on one gallon of gas; a truck can travel 40 miles on one gallon of gas; a motorcycle can travel 80 miles on one gallon of gas; a bus can travel 30 miles on one gallon of gas. If the car, the truck, the motorcycle, and the bus each used 5 gallons of gas in a jou...
def solve() -> int: car_miles = 60 * 5 truck_miles = 40 * 5 motorcycle_miles = 80 * 5 bus_miles = 30 * 5 total_miles = car_miles + truck_miles + motorcycle_miles + bus_miles result = total_miles return result
A shopkeeper has 150 items to sell, including 30 watches, 48 earrings, 60 bracelets, and 12 necklaces. What percentage of items are not jewelry pieces?
def solve() -> int: total_items = 150 jewelry_items = 48 + 60 + 12 non_jewelry_items = total_items - jewelry_items percentage_non_jewelry = (non_jewelry_items / total_items) * 100 result = percentage_non_jewelry return result
Student: A seventh of Ella's money was $28. She gave $14 to her friend and twice as much to her cousin. How much does Ella have left?
def solve() -> int: money = 7 * 28 friend = 14 cousin = 2 * friend left = money - friend - cousin result = left return result
Ethan uses 1 gallon of paint to cover a wall 3 times. If each gallon costs $15.00, and he repaints his room once a year for 5 years, how much does he spend on paint?
def solve() -> int: gallons_per_wall = 1 cost_per_gallon = 15.00 repaint_frequency = 1 years = 5 total_gallons = gallons_per_wall * 3 * years total_cost = total_gallons * cost_per_gallon result = total_cost return result
Maria runs 5 miles every day. She wants to run double the amount of miles every day for the next month. If she runs everyday for a month, how many total miles will she run in the month?
def solve() -> int: miles_per_day = 5 double_miles = 2*miles_per_day days_per_month = 30 total_miles = double_miles*days_per_month result = total_miles return result
Ryan and his two coworkers decide to split the cost of lunch. It is 25% more expensive than Ryan's old lunch cost which is $10 per day. How much does Ryan save per day by sharing lunch compared to buying it alone?
def solve() -> int: old_lunch_cost = 10 new_lunch_cost = old_lunch_cost * 1.25 savings_per_day = new_lunch_cost - old_lunch_cost result = savings_per_day return result
Ben, Bob and Bill are collecting apples from a nearby orchard. Each has a basket they fill with apples from different trees. If Ben's basket can hold 12 apples more than Bob's, and Bob's can hold 4 apples less than Bill's, and Bill's is 16 apples, how many apples do the three of them collect after 5 rounds each?
def solve() -> int: bill_basket = 16 bob_basket = bill_basket - 4 ben_basket = bob_basket + 12 rounds = 5 ben_apples = ben_basket * rounds bob_apples = bob_basket * rounds bill_apples = bill_basket * rounds total_apples = ben_apples + bob_apples + bill_apples r...
A car travels 300 miles in 8 hours. How much faster does it need to drive in order to travel 400 miles in the same time?
def solve() -> int: distance1 = 300 distance2 = 400 time = 8 speed1 = distance1 / time speed2 = distance2 / time result = speed2 - speed1 return result
A factory produces 100 widgets per hour. If the factory operates for 8 hours a day, how many widgets does it produce in a week?
def solve() -> int: widgets_per_hour = 100 hours_per_day = 8 widgets_per_day = widgets_per_hour * hours_per_day widgets_per_week = widgets_per_day * 7 result = widgets_per_week * 1 return result
Olivia sells lemonade. She had twice as much pink lemonade as regular lemonade. If she mixes 8 more cups of regular lemonade to her collection, and she now has 48 pink lemonade cups, how many regular cups of lemonade does she have?
def solve() -> int: regular_lemonade = 48 / 2 regular_lemonade += 8 result = regular_lemonade return result
A car rental company charges a base fee of $50, plus $0.10 per mile driven. Jake rented a car and drove 300 miles. How much did he pay for the car rental?
def solve() -> int: miles_driven = 300 rental_fee = 50 mileage_fee = miles_driven * 0.10 total_cost = rental_fee + mileage_fee result = total_cost return result
In the Farmer's market, cabbages are sold in bundles of 4. A customer purchased 9 bundles in total. How many cabbages did they buy?
def solve() -> int: num_bundles = 9 num_cabbages_in_bundle = 4 total_cabbages = num_bundles * num_cabbages_in_bundle result = total_cabbages return result
Tomas has 12 toy cars, and he gives away 3 to each of his 4 cousins. How many toy cars does Tomas have left?
def solve() -> int: num_cousins = 4 cars_given = 3 total_given = num_cousins * cars_given total_left = 12 - total_given result = total_left return result
At a wedding, the ratio of people aged 18 and under to people aged 19 and above is 1:5. If a total of 126 people attended the wedding, how many more people aged 19 and above than aged 18 and below were there?
def solve() -> int: age_under_18 = 126 * 1 / 6 age_above_19 = 126 * 5 / 6 result = age_above_19 - age_under_18 return result
Emma wants to make a necklace with 50 beads. She has 15 red beads, 12 blue beads, and 8 green beads. How many more beads of different colors does she need to buy?
def solve() -> int: remaining_beads = 50 - (15 + 12 + 8) result = remaining_beads return result
If a family has a total of 100 cookies and wants to divide them in the ratio of 3:5, with one person's ratio being 5, how many cookies does that person get?
def solve() -> int: total_cookies = 100 ratio_1 = 3 ratio_2 = 5 person_1_ratio = 5 total_ratio = ratio_1 + ratio_2 cookies_per_ratio_unit = total_cookies / total_ratio person_1_cookies = person_1_ratio * cookies_per_ratio_unit result = person_1_cookies return...
Student: Tara needs to pack a box with 60 pencils and 39 markers. If she decides to pack twice as many pencils as markers, calculate the total number of pencils she needs to pack?
def solve() -> int: p = 2 * 39 m = 39 total_pencils = p + m result = total_pencils return result
Paul needs to buy groceries for the month. All the groceries cost $600 and he has to pay 6% tax. How much did he pay in total?
def solve() -> int: price = 600 tax_rate = 6 tax_amount = price * (tax_rate/100) result = price + tax_amount return result
Bob's pet rabbit lays 35 eggs in the first day, on the second day it lays twice as many eggs as the previous day, and on the third day it adds 25 more eggs than the previous day. How many eggs does Bob's pet rabbit lay over the span of 3 days?
def solve() -> int: total_eggs = 0 day1 = 35 day2 = day1 * 2 day3 = day2 + 25 total_eggs = day1 + day2 + day3 result = total_eggs return result
A bag contains 20 black marbles and 30 white marbles. What is the percentage of black marbles in the bag?
def solve() -> int: total_marbles = 20 + 30 black_marble_percent = (20/total_marbles)*100 result = black_marble_percent return result
``` Maria has 3 bags of markers. Each of her bags has 25 markers less than four-fifths of David's bags. If David's bags have 40 markers each, how many markers does Maria have?
def solve() -> int: davids_markers = 40 marias_markers = (davids_markers * 4 / 5 - 25) * 3 result = marias_markers return result
A coffee shop sells 100 cups of coffee per day for $2 each. However, for every $1 increase in price, they sell 10 fewer cups of coffee per day. What price should they charge in order to maximize their daily revenue?
def solve() -> int: revenue = lambda price: (100-(price-2)*10) * price prices = [i/100 for i in range(200, 300)] max_price = max(prices, key=revenue) result = max_price return result
Student: A train traveled 500 miles in 10 hours. What was the average speed of the train in miles per hour?
def solve() -> int: distance = 500 time = 10 speed = distance / time result = speed return result
Daniel wants to buy 6 ice cream cones for his friends. Each cone costs $1.25 and he wants to buy an extra topping for all 6 ice creams equal to $3. How much will Daniel need to spend in total?
def solve() -> int: cone = 1.25 topping = 3 total_cones = 6 * cone result = total_cones + topping return result
Possible questions: Anna wants to buy some candy for her friends. She has $10 and each candy costs $0.75. If she buys two candies for each of her four friends, how much money will she have left?
def solve() -> int: money = 10 candy_price = 0.75 friends = 4 candies_per_friend = 2 total_cost = candy_price * friends * candies_per_friend money_left = money - total_cost result = money_left return result
If Jessica can run at a pace of 8.5 mph and completed a 12-mile race, how many minutes ahead of the second-place finisher did she finish if they ran at a pace of 9 minutes per mile?
def solve() -> int: jessica_pace = 8.5 race_distance = 12 second_place_pace = 9 jessica_time = race_distance / jessica_pace jessica_time *= 60 second_place_time = race_distance * second_place_pace time_ahead = second_place_time - jessica_time result = time...
A rectangular box has a height of 5 inches, a width of 6 inches, and a length of 7 inches. What is the volume of the box?
def solve() -> int: height = 5 width = 6 length = 7 volume = height * width * length result = volume return result
Hannah wants to save money for a vacation. She plans to save $20 in the first week and then increase her savings by $5 each week for the next six weeks. How much money will she have saved up in 7 weeks?
def solve() -> int: week_1 = 20 weekly_increase = 5 total_savings = week_1 + (weekly_increase * 6) result = total_savings return result
If a painter needs 1 gallon of paint to color a room, how many gallons of paint does he need to color 4 rooms and a hall?
def solve() -> int: rooms = 4 hall = 1 total_rooms = rooms + hall paint_per_room = 1 total_paint = total_rooms * paint_per_room result = total_paint return result
Bob is driving at a speed of 60 miles per hour. How far can he drive in 3.5 hours?
def solve() -> int: speed = 60 time = 3.5 distance = speed * time result = distance return result
There are four times as many apples as oranges. If there are 15 oranges, how many apples are there?
def solve() -> int: oranges = 15 apples = oranges * 4 result = apples return result
If Sharon needs to drive 300 miles and her car travels 30 miles per gallon of gas, how many gallons of gas does she need?
def solve() -> int: distance_to_travel = 300 miles_per_gallon = 30 gallons_of_gas_required = distance_to_travel/miles_per_gallon result = gallons_of_gas_required return result