question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A store is having a sale and is offering a 15% discount on all items. If a dress normally costs $75, how much will it cost during the sale?
def solve() -> int: original_price = 75 discount_percentage = 0.15 discount_amount = original_price * discount_percentage new_price = original_price - discount_amount result = new_price return result
James gets ten cans of soda. He drinks a third of a can every day and drinks one entire can during the weekends. If it takes him 5 such weeks to finish ten cans, how much soda is in a can?
def solve() -> int: cans_of_soda = 10 weeks = 5 days_in_a_week = 7 total_days = weeks * days_in_a_week total_cans_drunk = (total_days - 2 * weeks) * (1/3) + 2 * weeks soda_in_a_can = total_cans_drunk / cans_of_soda result = soda_in_a_can return result
In a class of 30 students, 2/5 of the students wear glasses. Of those who wear glasses, 1/4 are boys. How many girls in the class do not wear glasses?
def solve() -> int: glasses = 2/5 * 30 boys = 1/4 * glasses girls = glasses - boys result = 30/2 - girls return result
Student: Acme and corp are selling the same type of product. Acme sold 4 times as many products as corp, and they have a total of 76 products in combined stocks. How many products did Acme sell?
def solve() -> int: acme_products = 0 corp_products = 0 total_products = 76 corp_products = total_products / 5 acme_products = total_products - corp_products result = acme_products return result
Student: In a class of 20 students, 12 are boys and 8 are girls. The average score of the boys on a test is 80 and the average score of the girls is 90. What is the average score of the whole class?
def solve() -> int: boys = 12 girls = 8 boys_score = 80 girls_score = 90 total_score = boys * boys_score + girls * girls_score total_students = boys + girls result = total_score / total_students return result
In a store, 12 T-Shirts were selling for $15, 8 Shorts were selling for $25 and 14 Hats were selling for $18. What was the total amount made by selling all the items?
def solve() -> int: tshirts = 12 tshirt_price = 15 shorts = 8 shorts_price = 25 hats = 14 hats_price = 18 total_tshirt_price = tshirts * tshirt_price total_shorts_price = shorts * shorts_price total_hats_price = hats * hats_price total_amount_made = total_tshirt_price +...
A clothing store sold 15 items for $25 each, 6 items for $30 each, and 12 items for $35 each. In dollars, how much money did the store make throughout the day?
def solve() -> int: price_25 = 25 price_30 = 30 price_35 = 35 num_25 = 15 num_30 = 6 num_35 = 12 total_25 = price_25 * num_25 total_30 = price_30 * num_30 total_35 = price_35 * num_35 total_profit = total_25 + total_30 + total_35 result = total_profit r...
Emma has 6 bags of candies and her brother Max has 10 bags of candies. Together, they decided to bring all their candies and split them equally into 4 bowls. How many bags of candies did they each contribute to the bowls?
def solve() -> int: emma_bags = 6 max_bags = 10 total_bags = emma_bags + max_bags bowls = 4 bags_per_bowl = total_bags // bowls result = bags_per_bowl return result
An art class needs to paint murals on 10 walls. Each wall measures 8 feet tall by 20 feet wide. If each mural requires 4 colors and each color costs $8, how much will the art class spend on paint?
def solve() -> int: walls = 10 height = 8 width = 20 area = height * width colors = 4 cost = 8 total_cost = walls * area * colors * cost result = total_cost return result
The ages of Alex and Ava together are 30. Alex is three years older than Ava. How old is Ava?
def solve() -> int: alex_age = 0 ava_age = 0 alex_age = 30 / 2 ava_age = alex_age - 3 result = ava_age return result
arah bought 2 backpacks and 3 pens for school. Each backpack costs $15 and each pen costs $2. How much money did Sarah spend in total?
def solve() -> int: num_backpacks = 2 backpack_cost = 15 num_pens = 3 pen_cost = 2 total_cost = num_backpacks * backpack_cost + num_pens * pen_cost result = total_cost return result
Student: A restaurant bill comes out to $75. If four friends split the bill equally, how much will each person pay?
def solve() -> int: bill = 75 num_friends = 4 amount_each = bill / num_friends result = amount_each return result
A dance class charges $8 per lesson. If someone signs up for a class that meets twice a week for four weeks, how much will it cost?
def solve() -> int: lessons_per_week = 2 weeks = 4 cost_per_lesson = 8 total_lessons = lessons_per_week * weeks total_cost = total_lessons * cost_per_lesson result = total_cost return result
A company has a budget of $10,000 and they want to hire 3 new employees. If each employee will be paid the same amount, how much can they afford to pay each employee per month if they want to stay within their budget for the year (12 months)?
def solve() -> int: total_budget = 10000 num_employees = 3 months_in_year = 12 subtotal = total_budget / (num_employees * months_in_year) result = subtotal return result
Andrew is making pancakes with flour and milk. He uses a ratio of 2 cups of flour to every 1 cup of milk. If he wants to make 10 pancakes, how much flour will he need? If a motorbike is travelling at a constant speed of 50 miles per hour, how many miles will it cover in 2.5 hours?
def solve() -> int: flour_to_milk_ratio = 2/1 pancakes = 10 flour_needed = flour_to_milk_ratio * pancakes motorbike_speed = 50 time = 2.5 distance_covered = motorbike_speed * time result = flour_needed result = distance_covered return result
Noah is making a collage with photos. He has a rectangular poster board that measures 24 inches by 18 inches. He wants to arrange 12 photos on the poster board, each measuring 4 inches by 6 inches. He also wants to leave a 1 inch border around the poster board and a 0.5 inch gap between each photo. How many square inch...
def solve() -> int: poster_length = 24 poster_width = 18 photo_length = 4 photo_width = 6 border_width = 1 gap_width = 0.5 photo_area_length = poster_length - 2 * border_width photo_area_width = poster_width - 2 * border_width photo_rows = photo_area_length / (photo_length + ga...
Amy likes to knit scarves and hats. She can knit one scarf in 3 hours and one hat in 2 hours. She spends 6 hours each weekend knitting. She sells each scarf for $10 and each hat for $8. How much money does she make in a month (assume 4 weeks in a month)?
def solve() -> int: scarves_per_week = 6 // 3 hats_per_week = 6 // 2 scarf_price = 10 hat_price = 8 weeks_per_month = 4 scarves_per_month = scarves_per_week * weeks_per_month hats_per_month = hats_per_week * weeks_per_month revenue = scarves_per_month * scarf_price + hat...
Jordan is filling bags with candy for a party and needs to use up all of the candy she has. She needs to fill 16 bags with 12 pieces of candy in each bag. She has 158 pieces of candy. Can she fill all bags with the available candy?
def solve() -> int: bags_needed = 16 pieces_per_bag = 12 total_pieces_available = 158 total_pieces_needed = bags_needed * pieces_per_bag if total_pieces_available == total_pieces_needed: result = "All bags can be filled" elif total_pieces_available < total_pieces_needed: ...
Tina is making necklaces for her cousins. She has 75 beads of three colors: red, blue, and green. She wants to use all the beads and make the necklaces as similar as possible. How many necklaces can she make and how many beads of each color will each necklace have?
def solve() -> int: necklaces = 75 // 3 beads_per_necklace = 75 // necklaces beads_per_color = beads_per_necklace // 3 result = (necklaces, beads_per_color) return result
Dylan noticed 9 cars parked in the lot. Three more cars came in and parked beside them. Then a convoy of 20 motorcycles rode in and parked in a separate section. How many vehicles did Dylan see in the lot?
def solve() -> int: cars_parked = 9 additional_cars = 3 motorcycles = 20 total_vehicles = cars_parked + additional_cars + motorcycles result = total_vehicles return result
A bag contains 35 marbles of which 16 are red. What percentage of the marbles are red?
def solve() -> int: total_marbles = 35 red_marbles = 16 percentage_red = (red_marbles/total_marbles) * 100 result = percentage_red return result
In a library, there are 500 books and 300 magazines. If 100 books and 50 magazines are borrowed, how many books and magazines remain in the library?
def solve() -> int: books = 500 magazines = 300 books_borrowed = 100 magazines_borrowed = 50 books_remaining = books - books_borrowed magazines_remaining = magazines - magazines_borrowed result = f'<<<{books_remaining} books and {magazines_remaining} magazines remain in the li...
Student: Your car goes 18 miles per gallon of gas. If you need to drive 300 miles, how much gas will you need?
def solve() -> int: distance = 300 miles_per_gallon = 18 amount_of_gas = distance / miles_per_gallon result = amount_of_gas return result
If a football team needs to divide 24 jerseys equally into 8 lockers, how many jerseys will be in each locker?
def solve() -> int: num_jerseys = 24 num_lockers = 8 jerseys_per_locker = num_jerseys / num_lockers result = jerseys_per_locker return result
Mia has a coupon that gives her 20% off any purchase at a bookstore. She wants to buy two books: one costs $15 and the other costs $12. She also has to pay 10% sales tax on the total amount after the coupon. How much will she save by using the coupon compared to buying the books without the coupon?
def solve() -> int: total_without_coupon = (15 + 12) * (1 + 0.1) total_with_coupon = (15 + 12) * (1 - 0.2) * (1 + 0.1) result = total_without_coupon - total_with_coupon return result
Student: A bus driver charges $5.50 per person for a ride. If he filled up his bus completely with 42 passengers, how much money did he earn for that ride?
def solve() -> int: price = 5.50 passengers = 42 total = price * passengers result = total return result
A delivery company is transporting packages to a remote area. The distance to the area is 100 miles and the taxi ride costs $5.55 per mile. How much will the company spend on the taxi ride?
def solve() -> int: distance = 100 cost_per_mile = 5.55 total_cost = distance * cost_per_mile result = total_cost return result
Lisa bought one dress at $12, two pairs of earrings at $3 each, and one necklace. She gave the cashier $25 and got $2 back. How much does a necklace cost?
def solve() -> int: cost_of_dress_and_earrings = 12 + 2 * 3 amount_remaining = 25 - cost_of_dress_and_earrings cost_of_necklace = amount_remaining - 2 result = cost_of_necklace return result
Mia went apple picking and picked 5 baskets. Each basket has 20 apples. Then she gave 15 apples to her friend. How many apples does she have now?
def solve() -> int: apples = 5 * 20 apples -= 15 result = apples return result
Two boxes have a combined volume of 60 cubic inches. The second box has a volume that is 4 cubic inches more than the first. What is the volume of each box?
def solve() -> int: combined_volume = 60 added_volume = 4 box1_volume = (combined_volume - added_volume) / 2 box2_volume = (combined_volume + added_volume) / 2 result = box1_volume, box2_volume return result
Lily goes to the grocery store and buys apples for $0.75 each and oranges for $0.50 each. If she buys 2 apples and 5 oranges, how much does she spend in total?
def solve() -> int: total_cost = (0.75 * 2) + (0.5 * 5) result = total_cost return result
Olivia is an aircraft mechanic. She replaces all the tires on 40 commercial airplanes and all the tires on 30 private jets. How many tires did she replace overall?
def solve() -> int: commercial_planes = 40 private_jets = 30 tires_per_plane = 4 total_tires_replaced = (commercial_planes * tires_per_plane) + (private_jets * tires_per_plane) result = total_tires_replaced return result
Thomas has a factory that contains 72 drills, 98 hammers, and 144 saws. If he sells 8 drills, 12 hammers, and 18 saws, how many products will be left?
def solve() -> int: products = 72 + 98 + 144 amount_sold = 8 + 12 + 18 products_left = products - amount_sold result = products_left return result
A marble tower is 32 centimeters tall. It breaks in half, with the top of the tower now resting 10 centimeters from the base. How far from the base, in centimeters, did the tower break?
def solve() -> int: height_of_tower = 32 distance_from_base = 10 distance_from_break = height_of_tower - distance_from_base result = distance_from_break return result
The ratio of the sides of a rectangle is 3:4 and the perimeter is 98 cm. Find the area of the rectangle.
def solve() -> int: ratio = 3/4 perimeter = 98 width = (perimeter/(2*(1+ratio))) length = (perimeter/(2*(1+1/ratio))) area = width*length result = area return result
Possible questions and programs: Mary makes $12 an hour as a babysitter. She works for 20 hours a week and saves 25% of her earnings. She wants to buy a bike that costs $300. How many weeks does she need to save for the bike?
def solve() -> int: saving_rate = 0.25 hourly_rate = 12 hours_per_week = 20 saving_per_week = saving_rate * hourly_rate * hours_per_week bike_cost = 300 number_of_weeks = bike_cost / saving_per_week number_of_weeks = round(number_of_weeks, 2) result = number_of_weeks return r...
Sofia spends $200 on makeup every 6 months. She wants to save up by selling homemade candles. She sells each candle for $5 and wants to save up for her makeup supplies in 1 month. How many candles does she need to sell per day to reach her goal?
def solve() -> int: makeup_cost = 200 time_period = 6 candle_price = 5 saving_time = 1 total_makeup_cost = makeup_cost / time_period * saving_time num_candles = total_makeup_cost / candle_price / 30 result = num_candles return result
Student: A rectangular box has a length of 10 cm, a width of 8 cm, and a height of 6 cm. What is the volume of the box?
def solve() -> int: length = 10 width = 8 height = 6 volume = length * width * height result = volume return result
Student: Aishwarya has saved $200 for bookstore trip. She costed $80 for entrace fee and she buys $15 worth of books in the bookstore. How much money is left after her visit to the bookstore?
def solve() -> int: savings = 200 entrance_fee = 80 book_cost = 15 total_cost = entrance_fee + book_cost money_left = savings - total_cost result = money_left return result
A house is being painted. Its length is 40 feet and its height is 20 feet. The windows and doors together take up 80 square feet. What is the total square feet the painter has to paint?
def solve() -> int: length = 40 height = 20 windows_doors = 80 total_area = (length * height) - windows_doors result = total_area return result
A recipe for a cake requires 3 cups of flour, 2 cups of sugar, and 4 eggs. How much of each ingredient is needed to make 2.5 times the recipe?
def solve() -> int: flour = 3 * 2.5 sugar = 2 * 2.5 eggs = 4 * 2.5 result = flour, sugar, eggs return result
A baker had 24 cupcakes in his oven. He took out 4 cupcakes every 5 minutes until the oven was empty. How many minutes did it take for him to take out all the cupcakes?
def solve() -> int: cupcakes = 24 minutes = 0 while cupcakes > 0: cupcakes = cupcakes - 4 minutes = minutes + 5 result = minutes return result
William needs to plant 20 trees in his garden. If each tree needs 4 meters of space, what is the total area of space needed?
def solve() -> int: num_of_trees = 20 space_per_tree = 4 result = num_of_trees * space_per_tree return result
If a team completes 12 laps in 1 hour, how many hours will it take them to complete 48 laps?
def solve() -> int: laps_per_hour = 12 total_laps = 48 hours = total_laps / laps_per_hour result = hours return result
A company produced 8000 units of a product at a cost of $30 per unit. If the selling price is $40 per unit, what is the company's profit?
def solve() -> int: units = 8000 cost_per_unit = 30 selling_price = 40 profit_per_unit = selling_price - cost_per_unit total_profit = units*profit_per_unit result = total_profit return result
Student: John deposits $300 in a bank account that pays a simple annual interest rate of 6%. How much interest will he earn after 3 years?
def solve() -> int: principal = 300 rate = 0.06 time = 3 interest = principal * rate * time result = principal + interest return result
There are 120 students in a school. If 25% of them are absent on a given day, how many students are present at the school on that day?
def solve() -> int: total_students = 120 absent_students = total_students * 0.25 present_students = total_students - absent_students result = present_students return result
There are 400 pencils in a store. Box A has 20 fewer pencils than Box B. Box B has double the pencils as Box C. How many total pencils are in Boxes A-C?
def solve() -> int: box_c = 400 / (1 + 1 + 2) box_b = 2 * box_c box_a = box_b - 20 total_pencils = box_a + box_b + box_c result = total_pencils return result
Rachel has $150 and wants to buy 5 books that cost $20 each. If she wants to have $25 left over after buying the books, how much money must she find or borrow to reach her goal?
def solve() -> int: money_needed = 5*20 + 25 - 150 result = money_needed return result
Johnny is saving money for a new bike. He already has $80 in his piggy bank. He gets $10 every week as allowance, and he spends $5 every week on snacks. He also gets $20 every month as a bonus for doing chores. How many weeks will it take him to save $200?
def solve() -> int: weekly_saving = 10 - 5 monthly_saving = weekly_saving * 4 + 20 money_needed = 200 - 80 months_needed = money_needed // monthly_saving weeks_needed = months_needed * 4 result = weeks_needed return result
Sam is collecting stamps. He has 120 stamps from the USA, 80 stamps from France, and 60 stamps from Japan. He wants to put them in an album that has 20 pages and 16 slots on each page. How many stamps can he fit in the album? How many stamps will he have left over?
def solve() -> int: total_stamps = 120 + 80 + 60 slots = 20 * 16 stamps_in_album = min(total_stamps, slots) stamps_left_over = total_stamps - stamps_in_album result = stamps_in_album, stamps_left_over return result
Billy practices his guitar for 30 minutes every day. How many hours does he spend practicing in a month with 31 days?
def solve() -> int: total_hours = (30/60) * 31 result = total_hours return result
David has 48 rounds of ammo for his gun. He shoots 4 rounds a day, but he also buys 8 new rounds every week. How many weeks will it take for him to run out of ammo?
def solve() -> int: ammo = 48 daily_shoot = 4 weekly_buy = 8 ammo -= daily_shoot weeks = 0 while ammo > 0: ammo -= weekly_buy ammo -= daily_shoot * 7 weeks += 1 result = weeks return result
George has a pile of coins that contains 12 quarters, 15 dimes, and 18 nickels. He randomly picks one coin from the pile and does not put it back. What is the expected value of the coin he picks in cents?
def solve() -> int: quarters = 12 dimes = 15 nickels = 18 quarter_value = 25 dime_value = 10 nickel_value = 5 total = quarters + dimes + nickels expected_value = quarter_value * quarters / total + dime_value * dimes / total + nickel_value * nickels / total result = expected_value ...
Arun and Olivia are running a race. Arun runs the race in 35 minutes and Olivia runs the race in 28 minutes. How many more minutes did Arun take to complete the race as compared to Olivia?
def solve() -> int: arun_time = 35 olivia_time = 28 time_diff = arun_time - olivia_time result = time_diff return result
A recipe calls for 2 cups of sugar for every 3 cups of flour. If you want to make half the recipe which requires 6 cups of flour, how much sugar do you need?
def solve() -> int: flour = 6 sugar = (flour / 3) * 2 result = sugar return result
-Below are 2 examples Possible additional questions: A bakery is making pastries for a large order. They have 500 cups of flour, 300 cups of sugar, 200 cups of butter, and 100 eggs. Each pastry requires 1/4 cup of flour, 1/8 cup of sugar, 1/16 cup of butter, and 1/12 of an egg. How many pastries can they make with the ...
def solve() -> int: flour_pastries = 500 / 0.25 sugar_pastries = 300 / 0.125 butter_pastries = 200 / 0.0625 egg_pastries = 100 * 12 min_pastries = min(flour_pastries, sugar_pastries, butter_pastries, egg_pastries) result = min_pastries return result
Laura went to a flower shop with $40 and bought 5 roses. Then her mother called her and asked her to buy three times as many roses as she already bought. Each rose costs $2. Finally, she also bought a pot of soil worth $6. How much money does Laura have remaining? Karen has an exam on Monday. She plans to study 3 hours...
def solve() -> int: money = 40 roses_bought = 5 roses_needed = 3 * roses_bought rose_cost = 2 soil_cost = 6 total_cost = (roses_needed * rose_cost) + soil_cost remaining_money = money - total_cost day1 = 3 day2 = 2 * day1 day3 = day2 - 45 total_minutes = (day1 * 60)...
Ida has 15 books and she wants to divide them among her 5 friends. How many books does each friend get?
def solve() -> int: books = 15 num_friends = 5 result = books // num_friends return result
There are some stickers in a pack. Five twelfths of the stickers are animal, and one third of the animal stickers are cat. If 250 stickers are cat, how many stickers are there in the pack?
def solve() -> int: cat = 250 animal = cat * 3 pack = animal * 12 / 5 result = pack return result
A toy store sells toy cars in packs of 4. If the store sold 56 toy cars in total, how many packs did they sell?
def solve() -> int: total_toy_cars = 56 cars_per_pack = 4 packs_sold = total_toy_cars // cars_per_pack result = packs_sold return result
A pack of crayons contains 24 pieces. A teacher buys 10 packs for their class. If each student needs 4 pieces, how many more pieces of crayons does the teacher need to buy?
def solve() -> int: pack_size = 24 packs_bought = 10 students = 30 crayon_per_student = 4 crayons_needed = students * crayon_per_student - (pack_size * packs_bought) result = crayons_needed return result
There are 48 candies to be shared equally among 6 children. How many candies will each child get?
def solve() -> int: num_candies = 48 num_children = 6 candies_per_child = num_candies / num_children result = candies_per_child return result
Maria has 12 cats in her house. Each cat eats 1/3 of a can of cat food per day. If there are 30 cans of food in a package, how many packages does she need to feed her cats for 45 days?
def solve() -> int: total_cats_food = 12 * (1/3) * 45 packages_of_food = total_cats_food // 30 result = packages_of_food return result
arah has a rectangular garden with a length of 10 feet and a width of 5 feet. What is the area of her garden?
def solve() -> int: length = 10 width = 5 result = length*width return result
If a recipe calls for 3/4 cup of sugar and you want to make half the recipe, how much sugar do you need?
def solve() -> int: original_recipe = 0.75 scale_factor = 0.5 new_recipe = original_recipe*scale_factor result = new_recipe return result
Student: Martin reads six times as fast as Peter. If Martin read 240 pages in an hour, how many pages did Peter read in the same time?
def solve() -> int: martin_speed = 6 martin_pages = 240 peter_speed = 1/6 * martin_speed peter_pages = peter_speed * martin_pages result = peter_pages return result
Sam can paint a fence in 5 hours. His friend Tom can paint the same fence in 4 hours. If they work together, how long will it take them to paint the fence?
def solve() -> int: result = 20/9 return result
Victoria is making sandwiches for her friends. She cuts each sandwich into 4 triangle pieces. For each sandwich, what is the area of each triangle piece if the sandwich itself has an area of 36 square inches?
def solve() -> int: area_of_sandwich = 36 area_of_triangle = area_of_sandwich / 4 result = area_of_triangle return result
Jack bought 2 kg of beef and 4 kg of chicken. The total cost of beef was $24. The chicken was three times cheaper than the beef. How much did Jack pay for 1 kg of chicken?
def solve() -> int: beef_quantity = 2 chicken_quantity = 4 beef_cost = 24 chicken_cost = beef_cost / 3 chicken_cost_per_kg = chicken_cost / chicken_quantity result = chicken_cost_per_kg return result
Student: Ali is building a square sandbox in the backyard that is 4 feet long. What is the area of the sandbox?
def solve() -> int: length = 4 area = length ** 2 result = area return result
A coffee shop sells coffee and pastries. For every 3 cups of coffee you buy, you must buy 2 pastries which cost 3/5 the price of the coffees. If they sold 30 cups of coffee and earned $150, how much do the pastries cost?
def solve() -> int: cups_of_coffee = 30 price_of_coffee = 150 / 30 pastries_per_coffee = 2 / 3 price_of_pastries = pastries_per_coffee * price_of_coffee * 3/5 result = price_of_pastries return result
Robert wants to buy a quarter of a dozen bagels for breakfast. The regular price of a bagel is $2.50 and is now on sale at a 12% discount. How much will Robert pay for the bagels?
def solve() -> int: bagels = 0.25 * 12 regular_price = 2.50 discount = 0.12 total_price = bagels * regular_price * (1 - discount) result = round(total_price, 2) return result
Emily and her 3 friends plan to go to the amusement park. The admission fee is $45 per person. They also plan on taking the train that will cost $32 in total. If they plan on splitting the costs equally, how much will each person’s share be?
def solve() -> int: total_cost = 45*4 + 32 share_per_person = total_cost/4 result = share_per_person return result
Sarah is making a quilt. Each square requires 1/4 yard of fabric. She needs to make 20 squares. How much extra yard of fabric does she need if she already has 3 yards?
def solve() -> int: squares_needed = 20 fabric_per_square = 1/4 fabric_already_have = 3 total_fabric_needed = squares_needed * fabric_per_square extra_fabric_needed = total_fabric_needed - fabric_already_have result = extra_fabric_needed return result
Student: Monica collected 60 stamps. She had decided to sell 1/3 of her stamps to buy new ones. How many stamps does Monica have left?
def solve() -> int: stamps = 60 sold = stamps * 1/3 left = stamps - sold result = left return result
Jill is baking cookies for a party. If each batch yields 24 cookies, and she needs to make 72 cookies, how many batches of cookies will she need to make?
def solve() -> int: num_cookies = 72 cookies_per_batch = 24 num_batches = num_cookies // cookies_per_batch result = num_batches return result
If a train speeds up from 14.6 m/s to 16.4 m/s in 8 seconds, what is the acceleration of the train?
def solve() -> int: time = 8 speed_1 = 14.6 speed_2 = 16.4 acceleration = (speed_2 - speed_1)/time result = acceleration return result
Tina made 3 batches of muffins. Each batch makes 12 muffins. Tina gave away 4 muffins from the first batch, 8 muffins from the second batch, and 5 muffins from the third batch. How many muffins does Tina have left?
def solve() -> int: batch1 = 12 batch2 = 12 batch3 = 12 muffinsGone1 = 4 muffinsGone2 = 8 muffinsGone3 = 5 muffinsLeft = batch1 - muffinsGone1 + batch2 - muffinsGone2 + batch3 - muffinsGone3 result = muffinsLeft return result
Maria can vacuum 10 rooms in 2 hours. There are 60 rooms in the building. How many days will it take her to vacuum all the rooms if she only has 2 hours a day?
def solve() -> int: rooms_vacuumed_per_hour = 10 total_rooms = 60 hours_per_day = 2 rooms_vacuumed_per_day = rooms_vacuumed_per_hour * hours_per_day days_to_vacuum_all_rooms = total_rooms / rooms_vacuumed_per_day result = days_to_vacuum_all_rooms return result
Sarah has a shelf of books. She has 30 books. 4 of them are 500 pages. 1 of them is 35% shorter than that. The remaining books are 60% larger than the 4 books. How many pages are in all her books altogether?
def solve() -> int: books_total = 30 books_500_pages = 4 books_35_percent_shorter = 1 books_larger = books_total - books_500_pages - books_35_percent_shorter pages_500_books = 500 pages_35_percent_shorter = pages_500_books * 0.35 pages_larger_books = pages_500_books * 1.6 total...
Possible questions and programs: Jen wants to make lemonade for a school fair. She has 36 liters of water and 6 kilograms of sugar. She needs 0.75 liters of water and 0.2 kilograms of sugar for every liter of lemonade. How many liters of lemonade can she make and how much water and sugar will she have left?
def solve() -> int: water = 36 sugar = 6 water_ratio = 0.75 sugar_ratio = 0.2 water_limit = water / water_ratio sugar_limit = sugar / sugar_ratio lemonade = min(water_limit, sugar_limit) water_left = water - water_ratio * lemonade sugar_left = sugar - suga...
Sarah read 30 pages of her book before she fell asleep. She continued reading the next day and completed two-thirds of the remaining book in six hours. If the book has 400 pages in total, how many pages did Sarah read on the second day?
def solve() -> int: total_pages = 400 pages_read_first_day = 30 remaining_pages = total_pages - pages_read_first_day pages_read_second_day = (2/3) * remaining_pages result = pages_read_second_day return result
A store is having a 20% off sale. If an item originally costs $50, how much will it cost during the sale?
def solve() -> int: original_cost = 50 discount = 0.2 discount_amount = original_cost * discount sale_price = original_cost - discount_amount result = sale_price return result
A soccer tournament has 28 teams, and each team had 11 players. Another 30% of that number formed a reserve team. The coach ordered an additional 5 sets of jerseys just in case. Each set of jerseys has 2 sleeves. How many sleeves in total are needed?
def solve() -> int: teams = 28 players_per_team = 11 reserve_teams = int(0.3 * teams) reserve_players = reserve_teams * players_per_team total_players = teams * players_per_team + reserve_players jerseys_per_set = 2 sets_of_jerseys = 5 total_jerseys = sets_of_jerseys * jerseys_per_set ...
David earned $72 for baking 6 cakes. How many cakes does he have to bake to earn $180?
def solve() -> int: cakesBaked = 6 earningsPerCake = 72/6 totalCakesNeeded = 180 / earningsPerCake result = totalCakesNeeded return result
Samantha buys a rectangular piece of fabric that is 20 feet by 12 feet. She cuts the fabric into 5 pieces, all of equal size except for one, which is four times bigger than the others. What is the size of the bigger piece?
def solve() -> int: length = 20 width = 12 total_area = length * width small_piece_area = total_area / 5 big_piece_area = 4 * small_piece_area result = big_piece_area return result
Jackson is building a bookshelf. It takes 5 hours to assemble one shelf, and then another 2 hours to paint it. If he builds 8 shelves and paints each one as soon as it's finished being assembled, how many hours will it take?
def solve() -> int: num_shelves = 8 assemble_time = 5 paint_time = 2 total_time = num_shelves * (assemble_time + paint_time) result = total_time return result
Hannah got a new job and is paid $50 for each day she works. She worked 7 days in the first week, 8 days in the second week and 9 days in the third week, how much money did she get in total?
def solve() -> int: payPerDay = 50 firstWeek = 7 secondWeek = 8 thirdWeek = 9 totalWorked = firstWeek + secondWeek + thirdWeek result = totalWorked * payPerDay return result
A group of 14 friends decided to order a pizza that costs $18. They decided to split the cost equally. How much will each person pay for their share of the pizza?
def solve() -> int: number_of_friends = 14 pizza_cost = 18 cost_per_person = pizza_cost/number_of_friends result = cost_per_person return result
Emily is baking a chocolate cake for her friend's birthday. She needs 2 cups of flour, 1/2 cup of cocoa powder, and 1 cup of sugar. If she wants to make twice the amount for a larger party, how much of each ingredient does she need altogether?
def solve() -> int: flour_needed = 2 cocoa_powder_needed = 0.5 sugar_needed = 1 cake_multiplier = 2 flour_total = flour_needed*cake_multiplier cocoa_total = cocoa_powder_needed*cake_multiplier sugar_total = sugar_needed*cake_multiplier result = (flour_total, cocoa_total, sugar_total) ...
Olivia and Noah sold lemonade and cookies at a stand. Olivia sold 15 cups of lemonade at $0.50 each and 12 cookies at $0.25 each while Noah sold 18 cups of lemonade at $0.40 each and 10 cookies at $0.30 each. If they sold all of their lemonade and cookies, how much did they make at the stand?
def solve() -> int: olivia_lemonade = 15 olivia_lemonade_price = 0.50 olivia_cookies = 12 olivia_cookie_price = 0.25 olivia_lemonade_earnings = olivia_lemonade * olivia_lemonade_price olivia_cookie_earnings = olivia_cookies * olivia_cookie_price olivia_earnings = olivia_lemonade_earnings + o...
If the area of a circle is 36π square units, what is its radius?
def solve() -> int: area = 36 * 3.14 radius = (area / 3.14) ** 0.5 result = f'The radius of the circle is {radius} units.' result = radius return result
Martha has a total of 24 pieces of candy, some of them are sour candy and some of them are sweet. She has 15 more sour candy pieces than sweet candy pieces. How many sweet candy pieces does Martha have?
def solve() -> int: sour_candy = 0 sweet_candy = 0 sour_candy = sweet_candy + 15 total = sour_candy + sweet_candy result = sweet_candy return result
Student: Rubina runs 8 kilometres a day. How many kilometres would she have run at the end of 24 days?
def solve() -> int: distance_run = 8 days = 24 total_distance_run = distance_run * days result = total_distance_run return result
Mrs. Davis buys 27 pizzas for her class of 30 students and 2 teachers while on a field trip. Each pizza costs $10. How much will the pizzas altogether cost?
def solve() -> int: pizzas = 27 students = 30 teachers = 2 cost_per_pizza = 10 total_cost = pizzas * cost_per_pizza result = total_cost return result
A group of five friends decided to split the cost of a concert ticket equally. However, one of the friends arrived late to the concert and missed the opening act, so he wants to pay only 80% of the ticket price. If they paid $200 in total and the late friend already contributed $50, how much does he still owe to the gr...
def solve() -> int: total_cost = 200 late_friend_contribution = 50 num_friends = 5 late_friend_percentage = 0.8 ticket_cost = total_cost - late_friend_contribution cost_per_friend = ticket_cost / num_friends late_friend_owed = cost_per_friend * late_friend_percentage - late_fr...
Student: Andy has 200 nickels in his drawer. He spends $7 on a book. After buying the book, how many nickels will Andy have left in his drawer?
def solve() -> int: num_nickels = 200 book_cost = 7 nickels_spent = book_cost / 0.05 nickels_left = num_nickels - nickels_spent result = nickels_left return result
A family of four goes to a buffet restaurant for dinner. The adult price is $18.99 and the child price is $12.99. The family also orders two drinks for $2.99 each and leaves a 15% tip. How much is the total bill for the family?
def solve() -> int: buffet_cost = 2 * 18.99 + 2 * 12.99 drink_cost = 2 * 2.99 subtotal = buffet_cost + drink_cost tip = subtotal * 0.15 total_bill = subtotal + tip result = total_bill return result
Result: 22 A construction worker is building a patio. The patio is 8 feet long and 6 feet wide. If each square foot of the patio costs $5, how much will the construction worker charge for the entire patio?
def solve() -> int: patio_cost = 8 * 6 * 5 result = patio_cost return result