question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Jonathan has 50 pieces of candy and wants to distribute them equally among his 5 friends. How many pieces of candy will each friend get?
def solve() -> int: candy = 50 friends = 5 pieces_per_friend = candy // friends result = pieces_per_friend return result
Possible questions and programs: The Eiffel Tower is 324 meters tall, which is 177 meters more than the height of the Great Pyramid of Giza. How tall is the Great Pyramid of Giza?
def solve() -> int: eiffel = 324 diff = 177 pyramid = eiffel - diff result = pyramid return result
Student: Q7: A box of donuts contains 12 donuts. If each donut is cut into 8 pieces, how many pieces of donuts are in the box?
def solve() -> int: num_donuts = 12 num_pieces = 8 total_pieces = num_donuts * num_pieces result = total_pieces return result
Student: An oven uses 2.5 kilowatts per hour. How many kilowatts does it consume if it is used for 1 hour and 45 minutes?
def solve() -> int: power = 2.5 time = 1.75 result = power * time return result
Carl has a budget of $200 for his birthday party. He wants to buy a cake for $25, balloons for $15, and snacks for $10 per person. How many people can he invite to his party?
def solve() -> int: fixed = 25 + 15 variable = 10 remaining = 200 - fixed people = remaining // variable result = people return result
Student: On Monday, Emma was 15 minutes late. Four of her classmates were each 5 minutes early than she was. What is the total time for which the five students were either late or early for school?
def solve() -> int: emma_late = 15 classmate_1_early = emma_late - 5 classmate_2_early = emma_late - 5 classmate_3_early = emma_late - 5 classmate_4_early = emma_late - 5 total_time = emma_late + classmate_1_early + classmate_2_early + classmate_3_early + classmate_4_early result = total_tim...
There are 10 coins in a jar. 6 of them are quarters and 4 of them are dimes. How much money is there in the jar in cents?
def solve() -> int: quarters = 6 dimes = 4 value_of_quarter = 25 value_of_dime = 10 money_from_quarters = quarters * value_of_quarter money_from_dimes = dimes * value_of_dime total_money = money_from_quarters + money_from_dimes result = total_money return result
Max had 630 blocks in total. 2/5 of them were blue and the rest were red. How many blocks of each color did Max have?
def solve() -> int: n = 630 blue = 2/5 * n red = n - blue result = blue = int(blue) result = red = int(red) return result
5. Mr. Brown was planting trees in his garden. He planted 5 rows of trees and 4 trees in each row. He also planted 3 rows of flowers and 6 flowers in each row. How many plants in total did he plant in his garden?
def solve() -> int: tree_rows = 5 trees_per_row = 4 flower_rows = 3 flowers_per_row = 6 trees = tree_rows * trees_per_row flowers = flower_rows * flowers_per_row plants = trees + flowers result = plants return result
Student: Q10: There are 36 farmyard animals altogether, 16 of them are chickens. What percent of the animals are chickens?
def solve() -> int: total_animals = 36 chickens = 16 percent_chickens = (chickens / total_animals) * 100 result = percent_chickens return result
John is going to buy a laptop. The regular price of the laptop is $800 and he can get a 5% discount if he pays using cash. John also needs to pay 8.25% sales tax on the total price. How much money does he need to pay in total?
def solve() -> int: price = 800 discount = 0.05 tax_rate = 0.0825 discount_payment = price*discount total_price = price - discount_payment tax_payment = total_price*tax_rate final_price = total_price + tax_payment result = final_price return result
A store offers a 20% discount on all items in the store. If a customer purchases a shirt for $25, what is the price of the shirt after the discount?
def solve() -> int: original_price = 25 discount_rate = 20 / 100 discount_amount = original_price * discount_rate discounted_price = original_price - discount_amount result = discounted_price return result
A rectangle has a length of 15cm and a width of 10cm. What is the perimeter of the rectangle?
def solve() -> int: length = 15 width = 10 perimeter = 2*(length + width) result = perimeter return result
A store is having a sale. If the original price of an item is $150 and it's currently on sale for 20% off, what is the sale price?
def solve() -> int: discount = 0.2 * 150 sale_price = 150 - discount result = sale_price return result
There are 4 red balls, 5 green balls and 3 blue balls in a box. If Sally picks 2 balls at random, what's the probability that she picks a green ball and then a blue ball?
def solve() -> int: total_balls = 4 + 5 + 3 green_balls = 5 blue_balls = 3 prob_green_ball = green_balls / total_balls prob_blue_given_green = (blue_balls / (total_balls - 1)) * ((green_balls - 1) / (total_balls - 2)) prob_green_then_blue = prob_green_ball * prob_blue_given_green result = pr...
Possible additional questions and programs are: In the jam store, the bulk price of jam is $4 per jar and the minimum purchase is $35 before tax. The jam is taxed at $0.50 per jar. If Lisa has paid $112 for jam, by how many jars has Lisa's purchase exceed the minimum purchase?
def solve() -> int: jars = 112 / (4 + 0.5) min_jars = 35 / 4 diff = jars - min_jars result = round(diff) return result
A toy store sells jigsaw puzzles of different sizes. Hannah bought three puzzles. The dimensions of the first one were 20cm x 30cm and it cost $8, the second one was 40cm x 50cm and it cost $18, and the third one was 50cm x 60cm and it cost $26. What was the total cost of the puzzles?
def solve() -> int: total_cost = 8+18+26 result = total_cost return result
Student: A teacher divided a 480-page history book into 4 sections for her students to read. The first section has 80 pages, the second section has twice the number of pages as the first, and the third section has a quarter of the remaining pages. How many pages are in the last section?
def solve() -> int: total_pages = 480 section1 = 80 section2 = section1 * 2 remaining_pages = total_pages - section1 - section2 section3 = remaining_pages / 4 last_section = total_pages - section1 - section2 - section3 result = last_section return result
A store sold 75 t-shirts yesterday and twice as many today. If they want to sell out tomorrow, how many t-shirts should the store have in stock at the beginning of the day?
def solve() -> int: yesterday = 75 today = yesterday * 2 stock = yesterday + today result = stock return result
Question 2:If a bus runs at an average speed of 28 mph for 3.5 hours, how far does the bus travel?
def solve() -> int: average_speed = 28 hours = 3.5 result = average_speed * hours return result
I walk 3 miles to school and then take a bus for another 6 miles. The bus travels at an average speed of 30 miles per hour. How long does my total journey take?
def solve() -> int: total_distance = 3 + 6 bus_time = 6 / 30 walk_speed = 3 walk_time = 3 / walk_speed total_time = bus_time + walk_time total_minutes = total_time * 60 result = 'My total journey takes 60 minutes' return result
Ryan has two cylindrical containers. The first container has a radius of 5 inches and a height of 12 inches. The second container has a radius of 4 inches and a height of 10 inches. How much more liquid can the first container hold compared to the second container?
def solve() -> int: radius1 = 5 radius2 = 4 height1 = 12 height2 = 10 pi = 3.14159 vol1 = pi * (radius1**2) * height1 vol2 = pi * (radius2**2) * height2 diff = vol1 - vol2 result = diff return result
Student: Jake can do a job in 6 hours and Alex can do the same job in 8 hours. How long will it take if they work together?
def solve() -> int: jake_time = 6 alex_time = 8 total_time = jake_time + alex_time result = total_time return result
If a building has 50 floors, and each floor has 30 rooms, and out of all the rooms, 10% are vacant, how many rooms are occupied?
def solve() -> int: total_rooms = 50 * 30 vacant_rooms = total_rooms * 0.10 occupied_rooms = total_rooms - vacant_rooms result = occupied_rooms return result
In a classroom there are 27 students. If there are 16 second graders and the remaining are first graders, how many first graders are in the classroom?
def solve() -> int: second_graders = 16 total_students = 27 first_graders = total_students - second_graders result = first_graders return result
An apartment building has 16 floors, and the elevator travels to each floor in 10 seconds. However, it stops for 30 seconds on the 6th floor, and 60 seconds on the 14th floor. If someone gets in the elevator on the 2nd floor and goes to the 15th floor, how long will the trip take?
def solve() -> int: time_per_floor = 10 time_stopped_floor_6 = 30 time_stopped_floor_14 = 60 total_time = (15-2)*time_per_floor + time_stopped_floor_6 + time_stopped_floor_14 result = total_time return result
A toy store has 80 different toys available for purchase. Of those, 20 toys have batteries, 40 toys have lights, and 10 toys have both batteries and lights. If Michael dislikes toys that have batteries and won't touch them, but he can play with 3 of the light-up toys that he would be willing to try, how many toys are l...
def solve() -> int: total_toys = 80 toys_with_batteries = 20 toys_with_lights = 40 toys_with_both = 10 toys_with_only_lights = toys_with_lights - toys_with_both toys_without_batteries = total_toys - toys_with_batteries toys_without_lights = total_toys - toys_with_lights toys_le...
A library has 30 books and magazines (in total) for check out. A third of the items are magazines, and a quarter of the books were published in the last year. How many books were published in the last year?
def solve() -> int: total_items = 30 magazines = total_items / 3 books = total_items - magazines last_year_books = books / 4 result = last_year_books return result
Student: Kira and Leo both bought 4 pairs of sneakers, each pair costing $65 from an online store, and decided to sell them on a local market. Kira sold her sneakers at $85 each, while Leo sold his sneakers at $75 each. How much more profit did Kira get from the sale of her sneakers than Leo?
def solve() -> int: kira_cost = 65 leo_cost = 65 kira_price = 85 leo_price = 75 kira_profit = (kira_price - kira_cost) * 4 leo_profit = (leo_price - leo_cost) * 4 result = kira_profit - leo_profit return result
Sarah is a gardener looking to support her tomato plants with a trellis. She has 10 tomato plants that weigh 2 pounds each and a trellis that can hold a maximum weight of 30 pounds. How much weight can each tomato plant contribute?
def solve() -> int: num_plants = 10 plant_weight = 2 trellis_weight_limit = 30 total_plant_weight = num_plants * plant_weight remaining_weight = trellis_weight_limit - total_plant_weight weight_per_plant = remaining_weight / num_plants result = weight_per_plant return resu...
A shirt normally costs $30 but is being sold at a 20% discount. If you also have a coupon for $5 off, what is the final cost?
def solve() -> int: original_cost = 30 discounted_cost = 0.8 * original_cost final_cost = discounted_cost - 5 result = final_cost return result
Student: John needs to paint his house. If the house requires 6 liters of paint and each liter covers 200 square feet, how much area will the paint cover?
def solve() -> int: liters_of_paint = 6 area_per_liter = 200 total_area = liters_of_paint * area_per_liter result = total_area return result
Student: Rebecca has three times as many books as Steven. Steven has 30 books and Rebecca just gave him 4 books. How many books does Rebecca have now?
def solve() -> int: rebecca = 3 * 30 steven = 30 rebecca = rebecca - 4 steven = steven + 4 result = rebecca return result
A music festival sold 800 tickets. 3/5 of the tickets were sold on the first day and the remaining tickets were sold on the second day. If 100 tickets were sold on the second day, how many tickets were sold on the first day?
def solve() -> int: total_tickets = 800 tickets_sold_second_day = 100 tickets_sold_first_day = total_tickets - tickets_sold_second_day result = tickets_sold_first_day return result
A park had 800 visitors on a Sunday. 55% of the visitors were adults, 25% were children, and the rest were seniors. How many seniors visited the park?
def solve() -> int: total_visitors = 800 percent_adults = 0.55 percent_children = 0.25 percent_seniors = 1 - percent_adults - percent_children seniors = total_visitors * percent_seniors result = seniors return result
Tom has $50 in his wallet. He wants to buy a shirt that costs $30. How much money does Tom have left after buying the shirt?
def solve() -> int: money = 50 shirt_cost = 30 money -= shirt_cost result = money return result
Possible new questions and programs: There are 60 cookies in a jar. 15% of them have chocolate chips and 30% of them have raisins. How many cookies have neither chocolate chips nor raisins?
def solve() -> int: total = 60 chocolate = total * 0.15 raisin = total * 0.3 both = chocolate * raisin / total neither = total - (chocolate + raisin - both) result = neither return result
A recipe calls for 3/4 cup of sugar to make 24 cookies. How much sugar is needed to make 48 cookies?
def solve() -> int: sugar_per_cookie = 3/4/24 sugar_for_48 = sugar_per_cookie * 48 result = sugar_for_48 return result
A math book has 20 lessons and each lesson has 50 problems. If Alex does 8 lessons a day, how many days would it take him to finish the whole math book?
def solve() -> int: lessons_per_book = 20 problems_per_lesson = 50 lessons_per_day = 8 total_lessons = lessons_per_book total_problems = total_lessons * problems_per_lesson days_to_finish = total_lessons / lessons_per_day result = days_to_finish return result
Henry is cooking a stew. He obtains 7 pounds of venison and 9 pounds of mixed vegetables. The vegetables cost $4 per pound, and the venison is 1.5 times that price. What is the total cost of everything Henry purchased?
def solve() -> int: venison_weight = 7 vegetables_weight = 9 vegetables_price_per_pound = 4 venison_price_per_pound = 1.5 * vegetables_price_per_pound venison_cost = venison_weight * venison_price_per_pound vegetables_cost = vegetables_weight * vegetables_price_per_pound total_cost...
Student: There are 136 kids at the school field trip. They decide to split into groups of 8. How many groups will there be?
def solve() -> int: kids = 136 group_size = 8 groups = kids // group_size result = groups return result
A rectangle has a length of 14 cm and a width of 8 cm. What is the perimeter of the rectangle?
def solve() -> int: length = 14 width = 8 perimeter = 2 * (length + width) result = perimeter return result
Tom sells lemonade at a stand. He sells 50 cups of lemonade the first day and 60 cups the second day. On the third day, he sells 10% less cups than the second day. He charges $0.5 per cup of lemonade. How much money did he make in total?
def solve() -> int: cups_day1 = 50 cups_day2 = 60 cups_day3 = cups_day2 * 0.9 total_cups = cups_day1 + cups_day2 + cups_day3 total_money = total_cups * 0.5 result = total_money return result
There is a group of 18 people. 12 of them are men and the rest are women. If the men take up one-third of the group, then how many women are there?
def solve() -> int: total_people = 18 men = 12 ratio_men = 1/3 total_men_in_group = total_people*ratio_men women = total_people - total_men_in_group result = round(women) return result
- Anna wanted to make some lemonade for a picnic and needed to know how much sugar to use. She had a recipe that called for 1/4 cup of sugar per quart of lemonade and she wanted to make 2.5 gallons of lemonade. She knew that there are 4 quarts in a gallon and 16 cups in a gallon. How much sugar did Anna need to use for...
def solve() -> int: quarts = 2.5 * 4 sugar_per_quart = (1/4) / 16 total_sugar = quarts * sugar_per_quart result = total_sugar return result
Mia runs on the treadmill at a speed of 8 MPH on weekdays and cycles on weekends at a speed of 18 MPH. The gym is 3 miles away. If she goes to the gym on Saturday and Wednesday, what is the average time in minutes that she takes to get there?
def solve() -> int: weekday_speed = 8 weekend_speed = 18 distance = 3 weekday_time = distance / weekday_speed weekend_time = distance / weekend_speed total_time = weekday_time + weekend_time average_time = total_time * 60 / 2 result = average_time ret...
If Sarah can paint a house in 6 hours, how long will it take her to paint 3 houses if she works at the same rate?
def solve() -> int: time_per_house = 6 number_of_houses = 3 total_time = time_per_house * number_of_houses result = total_time return result
A factory produces 400 units of product A and 250 units of product B per day. Out of these, 20% of product A and 40% of product B fails quality control. How many units of product are of good quality?
def solve() -> int: good_A = 400 - (400 * 20/100) good_B = 250 - (250 * 40/100) result = good_A + good_B return result
Charles and Victoria roll a dice together. If they get a number above five they get 3 dollars each, otherwise they get nothing. What is the probability of them getting 3 dollars each?
def solve() -> int: outcomes_num = 6 outcomes_satisfy = 2 probability = outcomes_satisfy / outcomes_num result = probability return result
arah has $60 to buy her school supplies. She bought a backpack for $20, notebooks for $12, folders for $8 and pencils for $9. How much money does Sarah have left?
def solve() -> int: total_money = 60 backpack_price = 20 notebooks_price = 12 folders_price = 8 pencils_price = 9 money_spent = backpack_price + notebooks_price + folders_price + pencils_price money_left = total_money - money_spent result = money_left return result
Student: 4. Anna travelled 5000 miles in 4 weeks. On average, how many miles did she travel each day?
def solve() -> int: miles_travelled = 5000 weeks = 4 miles_per_day = miles_travelled / (weeks * 7) result = miles_per_day return result
A stack of coins has a height of 18 centimeters. Each coin has a thickness of 1.5 millimeters. How many coins are in the stack?
def solve() -> int: height_in_mm = 18 * 10 coins_in_stack = height_in_mm // 1.5 result = coins_in_stack return result
A toy store sells 30 dolls for $15 each. How much money will they make if they sell all the dolls?
def solve() -> int: num_dolls = 30 price_per_doll = 15 total_sales = num_dolls * price_per_doll result = total_sales return result
A store had 135 books in stock. They sold off 48 books and then restocked 73 books. How many books do they have now?
def solve() -> int: books_in_stock = 135 books_sold = 48 books_restocked = 73 total_books = books_in_stock - books_sold + books_restocked result = total_books return result
Rita got a bonus of $1500 and she spent 30% of it on holiday. How much money did she spend on the holiday?
def solve() -> int: def get_amount_spent(bonus, percentage): amount_spent = bonus*percentage/100 return amount_spent result = get_amount_spent(1500, 30) return result
Emma needs to travel from City A to City B. The distance between the two cities is 120 km. She has enough gas to travel for 450 km. How much gas will she use for the trip?
def solve() -> int: distance_between_cities = 120 total_distance = 450 gas_used = total_distance-distance_between_cities result = gas_used return result
A box contains 4 red balls, 6 blue balls, and 8 green balls. What is the probability of drawing a green ball if a ball is chosen at random?
def solve() -> int: total_balls = 4 + 6 + 8 probability_of_green_ball = 8/total_balls result = f"The probability of drawing a green ball is {probability_of_green_ball}" return result
5. Amanda is having a party and needs to know how many cans of soda she needs to buy for 70 people if each person needs 3 cans on average. How many cans of soda does Amanda need to buy?
def solve() -> int: num_people = 70 num_cans_per_person = 3 total_cans = num_people * num_cans_per_person result = total_cans return result
Caleb and Lucille wanted to buy a new car and they had exactly $6000 cash to spend. If the car costed $7000, how much will Caleb and Lucille need to take out in a loan?
def solve() -> int: cash = 6000 carCost = 7000 loan = carCost - cash result = loan return result
Kelly is making bracelets for her friends. She uses 8 beads for each bracelet and each bead costs 25 cents. She makes 12 bracelets and gives them to her friends. How much money did Kelly spend on the beads?
def solve() -> int: bead_number = 8 bracelet_number = 12 bead_cost = 25 total_cost = bead_number * bracelet_number * bead_cost total_cost = total_cost / 100 result = total_cost return result
Andy's bakery made 300 donuts. Unfortunately, 15% of the donuts were burnt and had to be thrown away. If Andy bought four times as many donuts as the burnt ones, how many donuts does he have now?
def solve() -> int: total_donuts = 300 burnt_donuts = total_donuts * 0.15 good_donuts = total_donuts - burnt_donuts new_donuts = burnt_donuts * 4 total_donuts_now = good_donuts + new_donuts result = total_donuts_now return result
Student: Emma had $10 and she wanted to buy a new movie ticket that cost $12. How much more money does she need?
def solve() -> int: cost = 12 money = 10 more_money = cost - money result = more_money return result
Monica wants to buy a new oven for $600. If she has already saved 25% of the amount that she needs, how much more money does Monica need to buy the new oven?
def solve() -> int: saved_money = 600 * 0.25 needed_money = 600 - saved_money result = needed_money result return result
Greta went to the store and bought 5 bags of chips for $2 each and 3 boxes of crackers for $2.50 each. How much money did Greta spend in total?
def solve() -> int: num_bags_chips = 5 cost_per_bag_chips = 2 num_boxes_crackers = 3 cost_per_box_crackers = 2.50 total_cost = num_bags_chips * cost_per_bag_chips + num_boxes_crackers * cost_per_box_crackers result = total_cost return result
Andrew's age is 12 years less than double Sarah's age. If Sarah is 20 years old, how old is Andrew?
def solve() -> int: sarah_age = 20 andrew_age = 2 * sarah_age - 12 result = andrew_age return result
Student: Leo has 4 coins: a quarter, a dime, a nickel, and a penny. He flips each of them randomly and gets a point for each head. How much money does he have if he gets 3 points?
def solve() -> int: quarter = 25 dime = 10 nickel = 5 penny = 1 heads = 3 total_value = (quarter + dime + nickel + penny) * heads total_value /= 100 result = total_value return result
On a hot summer day, Jim decides to have his friends over. He has 3 watermelons and each watermelon has 17 slices. How many slices does Jim have in total?
def solve() -> int: slices_one_watermelon = 17 num_watermelons = 3 total_slices = slices_one_watermelon * num_watermelons result = total_slices return result
In a savings account, $500.00 earns 2% interest per year. If the interest earned is added to the account at the end of each year, how much money will be in the account after 5 years?
def solve() -> int: starting_amount = 500 interest_rate = 0.02 years = 5 amount = starting_amount * (1 + interest_rate) ** years result = amount return result
A sports team has 11 players and each of them gets to play 3 quarters on the same day. How many total quarters do they play?
def solve() -> int: number_of_players = 11 number_of_quarters_per_player = 3 result = number_of_players * number_of_quarters_per_player return result
A garden is in the shape of a square. The length of one side is 6 meters. What is the perimeter of the garden?
def solve() -> int: perimeter = 4 * 6 result = perimeter return result
Amy is filling a cylindrical tank with water. The tank has a radius of 1.5 meters and a height of 2 meters. She can pump 300 liters of water per minute. How many minutes will it take her to fill the tank completely?
def solve() -> int: base_area = 3.14 * 1.5 ** 2 tank_volume = base_area * 2 water_volume = 300 * 0.001 time = tank_volume / water_volume result = time return result
Tom's boat has a fuel tank that can hold 40 gallons. He also has a motorcycle with a fuel tank that holds 6 gallons. The boat's tank is one-sixth full. The motorcycle's tank is three-eighths full. If he fills them both up completely, how many gallons does he add?
def solve() -> int: boat_tank = 40 motorcycle_tank = 6 boat_current = boat_tank / 6 motorcycle_current = motorcycle_tank * 3 / 8 total_added = (boat_tank - boat_current) + (motorcycle_tank - motorcycle_current) result = total_added return result
A delivery truck is driving up a mountain. It takes 5 minutes to drive up the mountain, but 9 minutes to drive down the mountain. If the truck travels up and down the mountain for 3 hours, how many times did it make the journey?
def solve() -> int: up_time = 5 down_time = 9 total_time = 3 * 60 up_total_time = total_time * (up_time / (up_time + down_time)) down_total_time = total_time * (down_time / (up_time + down_time)) journey_times = up_total_time + down_total_time result = journey_times return result
Rachel and Chloe are singers who need to sing a song. Rachel can sing the entire song in 2 minutes, while Chloe can sing the same song in 3 minutes. What is the average time it takes both singers to sing the song? Samantha sold her bike at 75% of what she originally paid. She uses the proceeds of that sale and needs on...
def solve() -> int: rachel_time = 2 chloe_time = 3 total_time = rachel_time + chloe_time average_time = total_time / 2 samantha_paid = 800 / 0.25 difference = samantha_paid - 800 result = difference return result
Possible new questions: Annie is 7 years older than Ben. Ben is 3 years younger than Chris. If Chris is 15 years old, how old is Annie?
def solve() -> int: chris = 15 ben = chris - 3 annie = ben + 7 result = annie return result
Student: Peter collects stickers. He has 120 stickers at the beginning of the month. He buys 3 new stickers every day and gives away 2 stickers to his friend every week. How many stickers does he have at the end of the month?
def solve() -> int: stickers = 120 buy = 3 give = 2 days = 30 weeks = 4 stickers = stickers + buy * days stickers = stickers - give * weeks result = stickers return result
A store sells a container of 20 pens for $24.00. A container of 50 pens sell for $60.00. What is the selling price of a container of ten pens?
def solve() -> int: price_of_20_pens = 24 price_of_50_pens = 60 price_per_pen_20 = price_of_20_pens/20 price_per_pen_50 = price_of_50_pens/50 price_per_pen = (price_per_pen_20 + price_per_pen_50)/2 price_of_10_pens = price_per_pen*10 result = price_of_10_pens return result
Tom is covering a 15-mile hiking trail, hiking at a rate of 2.5 miles per hour. How much faster must he hike to complete the trail in two-thirds of the time?
def solve() -> int: distance = 15 current_speed = 2.5 current_time = distance / current_speed new_time = current_time * (2/3) new_speed = distance / new_time increase_in_speed = new_speed - current_speed result = increase_in_speed return result
A farmer has 45 goats and he wants to divide them into 9 groups. How many goats will there be in each group?
def solve() -> int: goats = 45 groups = 9 each_group = goats // groups result = each_group return result
A pizza parlor charges $10 for a medium pizza and $15 for a large pizza. If Jake spent $75 and bought 5 pizzas, how many medium and large pizzas did he buy?
def solve() -> int: price_medium = 10 price_large = 15 total_spent = 75 num_pizzas = 5 num_medium = 2 num_large = 3 result = (num_medium, num_large) return result
A pizza place charges $12 for each pizza plus an additional $2 per topping. If Anna orders 2 pizzas with 3 toppings each, how much money will she spend?
def solve() -> int: pizza_price = 12 topping_price = 2 pizzas_ordered = 2 toppings_per_pizza = 3 total_cost = (pizzas_ordered * pizza_price) + (toppings_per_pizza * toppings_per_pizza * topping_price) result = total_cost return result
Tom's sunscreen blocks all but 40% of UV rays, and 30% of the rays it doesn't block are actually harmful. What percentage of UV rays aren't harmful and don't get blocked?
def solve() -> int: block_percentage = 40 harmful_percentage = 30 unblocked_percentage = 100 - block_percentage not_harmful_percentage = unblocked_percentage * (100 - harmful_percentage) / 100 result = not_harmful_percentage return result
John has 20 dollars and spends 7 dollars at the grocery store. He earns 15 dollars from his part-time job the next day. How much money does he have now?
def solve() -> int: money = 20 money -= 7 money += 15 result = money return result
A triangular prism has a length of 15 cm, a height of 7 cm, and a width of 9 cm. What is the volume of the triangular prism?
def solve() -> int: length = 15 height = 7 width = 9 volume = (1/2) * length * height * width result = volume return result
Rachel had an equal number of balloons and ribbons. If she had 50 balloons and gave eight decorations to each of her seven friends, how many decorations did she have left?
def solve() -> int: balloons = 50 ribbons = balloons decorations_given = 8 * 7 decorations_left = balloons - decorations_given result = decorations_left return result
The coffee shop owner has 120 cups of coffee to serve to his customers. He has 6 tables with equal number of cups on each table. How many cups of coffee are on each table? Five employees and three interns order lunch for a total of $24. The interns each pay $5 for their meals. How much did each employee's meal cost, in...
def solve() -> int: cups_of_coffee = 120 tables = 6 cups_on_each_table = cups_of_coffee / tables employees = 5 interns = 3 total_cost = 24 cost_per_intern = 5 cost_per_employee = (total_cost - (cost_per_intern * interns)) / employees result = cups_on_each_table, c...
Student: If a book has 360 pages and is divided into 12 chapters, how many pages does each chapter have?
def solve() -> int: pages = 360 chapters = 12 pages_per_chapter = pages / chapters result = pages_per_chapter return result
If a crab has ten legs, and one crab cage can hold 30 crabs, how many crab legs would be in eleven less than 6 cages?
def solve() -> int: legs_per_crab = 10 crabs_per_cage = 30 cages = 6 - 11 total_crabs = cages * crabs_per_cage total_legs = total_crabs * legs_per_crab result = total_legs return result
Ella has a coupon that gives her 15% off any purchase at a clothing store. She buys a jacket for $80 and a pair of jeans for $50. How much does she pay after applying the coupon and adding 10% sales tax?
def solve() -> int: total = 80 + 50 discount = total * 0.15 after_coupon = total - discount tax = after_coupon * 0.1 final = after_coupon + tax result = final return result
Sophia is building a sandcastle. She uses 10 buckets of sand, then removes 3 buckets, and then uses 2 more. For every bucket she removes after that, she has to use 5 more buckets. If she removes 2 more buckets, how many buckets does Sophia need to use to balance them out?
def solve() -> int: buckets_used = 10 buckets_removed = 3 buckets_used += 2 buckets_removed += 2 buckets_used -= buckets_removed * 5 result = buckets_used return result
Mahesh is building a bird house that requires 8 pieces of wood that each measure 20 inches. He cuts 2 of the pieces into 10 inch pieces. How much wood does he have left (in inches)?
def solve() -> int: total_wood = 8*20 cut_wood = 2*10 wood_left = total_wood - cut_wood result = wood_left return result
Student: Pam has 10 apples and was able to divide them into 2 portions of equal size. If she then ate half of the portion she had originally set aside, how many apples does Pam have left?
def solve() -> int: num_apples = 10 portion_size = num_apples // 2 num_apples_left = num_apples - (portion_size // 2) result = num_apples_left return result
Jacob decided to clear out his closet and sell some of his clothes. He sold his favorite jacket for $50. He got $20 for a pair of jeans and agreed to sell his sweater at a 10% discount. He also sold both of his t-shirts for $7 each. How much money did Jacob make?
def solve() -> int: jacket_price = 50 jeans_price = 20 sweater_price = 30 * 0.9 tshirt_price = 7 * 2 total_money = jacket_price + jeans_price + sweater_price + tshirt_price result = total_money return result
A company has a factory that can manufacture up to 10,000 units per month with no overtime, or up to 15,000 units per month with overtime. If they need to manufacture a total of 120,000 units, how many months will it take to finish the manufacturing process without overtime?
def solve() -> int: units_needed = 120000 normal_rate = 10000 normal_time = units_needed / normal_rate result = normal_time return result
If the perimeter of a square is 20 cm, then what is the area of the square?
def solve() -> int: perimeter = 20 side_length = perimeter / 4 area = side_length ** 2 result = area return result
A car rental company charges a flat fee of $30 per day plus an additional $0.25 per mile driven. If a customer rents a car for 5 days and drives 300 miles, what is the total cost?
def solve() -> int: base_fee = 30 miles_driven = 300 days_rented = 5 mileage_fee = 0.25 total_cost = (base_fee * days_rented) + (mileage_fee * miles_driven) result = total_cost return result
Student: Paul bought a car for $20,000. However, he was able to negotiate a deal and get 20% off the price. In total, how much money did Paul spend on the car?
def solve() -> int: price = 20000 discount = 0.2 total_amount = price * (1 - discount) result = total_amount return result
A car travels 50 miles in 2 hours. What is the average speed of the car in miles per minute?
def solve() -> int: distance = 50 time = 2 * 60 result = round(distance/time, 2) return result
At a pet store on Monday, there were 6 dogs, 9 cats, and 3 parrots. On Tuesday, the store had 3 dogs, 5 cats, and 8 parrots. What percentage of pets did the store have more on Monday than on Tuesday?
def solve() -> int: dogs_monday = 6 cats_monday = 9 parrots_monday = 3 dogs_tuesday = 3 cats_tuesday = 5 parrots_tuesday = 8 total_pets_monday = dogs_monday + cats_monday + parrots_monday total_pets_tuesday = dogs_tuesday + cats_tuesday + parrots_tuesday more_pets = to...
After spending 25 dollars on groceries in the first week of the month, Jin spends 10% less each week. If her budget is $125 for the entire month, how much money can she spend on groceries in the fourth week?
def solve() -> int: totalbudget = 0 week1 = 25 for week in range(2, 4): totalbudget = totalbudget + week1 - 0.1 * week1 week1 = week1 - 0.1 * week1 result = totalbudget - 125 return result